/*
 * Roof Overhang Calculator (/roof-overhang-calculator/, page 142).
 * Extracted from the page's inline <script>/<style> (Phase 2B, 2026-09-22) and
 * repaired: wpautop/TinyMCE markup removed from JS string literals; logic unchanged.
 * Loaded by wp-content/mu-plugins/psa-calculators.php. Do not paste back into the editor.
 */
    #roof-overhang-tool {
      --roc-bg: #f6f8fb;
      --roc-card: rgba(255, 255, 255, 0.92);
      --roc-text: #162033;
      --roc-muted: #667085;
      --roc-line: #d9e2ec;
      --roc-primary: #1677ff;
      --roc-primary-dark: #0f5fd1;
      --roc-accent: #00b894;
      --roc-warning: #f59e0b;
      --roc-danger: #e11d48;
      --roc-shadow: 0 18px 50px rgba(22, 32, 51, 0.12);
      --roc-radius: 24px;
      color: var(--roc-text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      margin: 32px 0;
    }

    #roof-overhang-tool * {
      box-sizing: border-box;
    }

    #roof-overhang-tool .roc-shell {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(217, 226, 236, 0.9);
      border-radius: var(--roc-radius);
      background:
        radial-gradient(circle at top left, rgba(22, 119, 255, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(0, 184, 148, 0.16), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, var(--roc-bg) 100%);
      box-shadow: var(--roc-shadow);
    }

    #roof-overhang-tool .roc-inner {
      display: grid;
      grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
      gap: 0;
      min-height: 100%;
    }

    #roof-overhang-tool .roc-intro {
      padding: clamp(24px, 4vw, 46px);
      border-right: 1px solid rgba(217, 226, 236, 0.85);
    }

    #roof-overhang-tool .roc-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: fit-content;
      margin-bottom: 18px;
      padding: 8px 12px;
      border: 1px solid rgba(22, 119, 255, 0.18);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.72);
      color: var(--roc-primary-dark);
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    #roof-overhang-tool .roc-badge::before {
      content: "";
      width: 9px;
      height: 9px;
      border-radius: 999px;
      background: var(--roc-accent);
      box-shadow: 0 0 0 5px rgba(0, 184, 148, 0.14);
    }

    #roof-overhang-tool h2 {
      margin: 0 0 14px;
      color: var(--roc-text);
      font-size: clamp(30px, 4vw, 48px);
      line-height: 1.04;
      letter-spacing: -0.04em;
    }

    #roof-overhang-tool .roc-intro p {
      max-width: 58ch;
      margin: 0 0 22px;
      color: var(--roc-muted);
      font-size: 16px;
      line-height: 1.7;
    }

    #roof-overhang-tool .roc-formula {
      margin-top: 24px;
      padding: 18px;
      border: 1px solid rgba(217, 226, 236, 0.9);
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.72);
    }

    #roof-overhang-tool .roc-formula strong {
      display: block;
      margin-bottom: 8px;
      font-size: 14px;
      color: var(--roc-text);
    }

    #roof-overhang-tool .roc-formula code {
      display: block;
      overflow-x: auto;
      color: #0f172a;
      font-size: 14px;
      white-space: nowrap;
    }

    #roof-overhang-tool .roc-panel {
      padding: clamp(22px, 4vw, 36px);
      background: rgba(255, 255, 255, 0.58);
      backdrop-filter: blur(10px);
    }

    #roof-overhang-tool form {
      margin: 0;
    }

    #roof-overhang-tool .roc-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    #roof-overhang-tool .roc-field {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    #roof-overhang-tool .roc-field.roc-wide {
      grid-column: 1 / -1;
    }

    #roof-overhang-tool label {
      color: #27364f;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.35;
    }

    #roof-overhang-tool .roc-help {
      color: var(--roc-muted);
      font-size: 12px;
      font-weight: 500;
    }

    #roof-overhang-tool input,
    #roof-overhang-tool select {
      width: 100%;
      min-height: 48px;
      border: 1px solid var(--roc-line);
      border-radius: 15px;
      background: var(--roc-card);
      color: var(--roc-text);
      font: inherit;
      font-size: 15px;
      outline: none;
      padding: 12px 14px;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    #roof-overhang-tool input:focus,
    #roof-overhang-tool select:focus {
      border-color: rgba(22, 119, 255, 0.72);
      box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.13);
      background: #fff;
    }

    #roof-overhang-tool .roc-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 20px;
    }

    #roof-overhang-tool button {
      min-height: 48px;
      border: 0;
      border-radius: 999px;
      cursor: pointer;
      font: inherit;
      font-weight: 800;
      padding: 13px 20px;
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    #roof-overhang-tool button:hover {
      transform: translateY(-1px);
    }

    #roof-overhang-tool .roc-primary-btn {
      background: linear-gradient(135deg, var(--roc-primary), var(--roc-primary-dark));
      color: #fff;
      box-shadow: 0 12px 24px rgba(22, 119, 255, 0.26);
    }

    #roof-overhang-tool .roc-secondary-btn {
      border: 1px solid var(--roc-line);
      background: rgba(255, 255, 255, 0.78);
      color: #27364f;
    }

    #roof-overhang-tool .roc-results {
      margin-top: 20px;
      border: 1px solid rgba(217, 226, 236, 0.9);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.78);
      padding: 18px;
    }

    #roof-overhang-tool .roc-results h3 {
      margin: 0 0 10px;
      color: var(--roc-text);
      font-size: 22px;
      letter-spacing: -0.02em;
    }

    #roof-overhang-tool .roc-placeholder,
    #roof-overhang-tool .roc-error {
      margin: 0;
      color: var(--roc-muted);
      line-height: 1.6;
    }

    #roof-overhang-tool .roc-error {
      color: var(--roc-danger);
      font-weight: 700;
    }

    #roof-overhang-tool .roc-kpis {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin: 16px 0;
    }

    #roof-overhang-tool .roc-kpi {
      padding: 16px;
      border: 1px solid rgba(217, 226, 236, 0.9);
      border-radius: 18px;
      background: #fff;
    }

    #roof-overhang-tool .roc-kpi span {
      display: block;
      color: var(--roc-muted);
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    #roof-overhang-tool .roc-kpi strong {
      display: block;
      margin-top: 7px;
      color: var(--roc-text);
      font-size: clamp(20px, 3vw, 28px);
      line-height: 1;
    }

    #roof-overhang-tool .roc-bars {
      display: grid;
      gap: 13px;
      margin: 16px 0;
    }

    #roof-overhang-tool .roc-bar-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
      color: #344054;
      font-size: 13px;
      font-weight: 800;
    }

    #roof-overhang-tool .roc-bar {
      overflow: hidden;
      height: 12px;
      border-radius: 999px;
      background: #eef2f7;
    }

    #roof-overhang-tool .roc-bar span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--roc-primary), var(--roc-accent));
      width: 0%;
      transition: width 0.35s ease;
    }

    #roof-overhang-tool .roc-table-wrap {
      overflow-x: auto;
      margin-top: 14px;
      border: 1px solid rgba(217, 226, 236, 0.9);
      border-radius: 16px;
      background: #fff;
    }

    #roof-overhang-tool table {
      width: 100%;
      border-collapse: collapse;
      margin: 0;
      font-size: 14px;
    }

    #roof-overhang-tool th,
    #roof-overhang-tool td {
      border-bottom: 1px solid #edf1f5;
      padding: 12px 14px;
      text-align: left;
      vertical-align: top;
    }

    #roof-overhang-tool tr:last-child th,
    #roof-overhang-tool tr:last-child td {
      border-bottom: 0;
    }

    #roof-overhang-tool th {
      width: 58%;
      color: #344054;
      font-weight: 800;
    }

    #roof-overhang-tool td {
      color: var(--roc-text);
      font-weight: 700;
    }

    #roof-overhang-tool .roc-note {
      margin: 14px 0 0;
      padding: 14px;
      border-left: 4px solid var(--roc-primary);
      border-radius: 14px;
      background: #f7fbff;
      color: #344054;
      font-size: 14px;
      line-height: 1.6;
    }

    #roof-overhang-tool .roc-note strong {
      color: var(--roc-text);
    }

    @media (max-width: 820px) {
      #roof-overhang-tool .roc-inner {
        grid-template-columns: minmax(0, 1fr); /* Phase 2B: was 1fr, which let wide content overflow the clipped card on phones */
      }

      #roof-overhang-tool .roc-intro {
        border-right: 0;
        border-bottom: 1px solid rgba(217, 226, 236, 0.85);
      }
    }

    @media (max-width: 560px) {
      #roof-overhang-tool .roc-grid,
      #roof-overhang-tool .roc-kpis {
        grid-template-columns: minmax(0, 1fr); /* Phase 2B: was 1fr (content overflowed on phones) */
      }

      #roof-overhang-tool .roc-actions button {
        width: 100%;
      }
    }
  
