      /* —— Themes —— */
      body[data-theme="loan"] {
        --ink: #0c2a2e;
        --ink-soft: #1a454c;
        --mist: #e8f2f0;
        --paper: #f7faf8;
        --line: #c5d9d4;
        --accent: #0d7a6f;
        --accent-deep: #065a52;
        --accent-glow: #1aa896;
        --result: #0b6b4a;
        --result-bg: #d4f5e8;
        --warn-bg: #fff4d6;
        --warn-line: #f0c765;
        --warn-ink: #6b4a09;
        --shadow: 0 20px 50px rgba(12, 42, 46, 0.18);
        --brand: #eaf6f4;
        --brand-muted: rgba(232, 242, 240, 0.78);
        --focus-ring: rgba(13, 122, 111, 0.18);
        --submit-shadow: rgba(13, 122, 111, 0.28);
        --metric-muted: #8aa39e;
        --heading-muted: #6a8a86;
        --bg1: rgba(26, 168, 150, 0.22);
        --bg2: rgba(12, 42, 46, 0.35);
        --bg3: #0c2a2e;
        --bg4: #134448;
        --bg5: #0a3d3a;
        --error: #b42318;
        --error-bg: #fdecea;
      }

      body[data-theme="car"] {
        --ink: #2a1a0c;
        --ink-soft: #4d2f14;
        --mist: #fdefdc;
        --paper: #fffaf3;
        --line: #e8cfa8;
        --accent: #c2570c;
        --accent-deep: #8f3d05;
        --accent-glow: #f2a24a;
        --result: #8f3d05;
        --result-bg: #ffe6c7;
        --warn-bg: #fff4d6;
        --warn-line: #f0c765;
        --warn-ink: #6b4a09;
        --shadow: 0 20px 50px rgba(42, 26, 12, 0.22);
        --brand: #fbeedd;
        --brand-muted: rgba(251, 238, 221, 0.78);
        --focus-ring: rgba(194, 87, 12, 0.18);
        --submit-shadow: rgba(194, 87, 12, 0.28);
        --metric-muted: #b28b5a;
        --heading-muted: #a37742;
        --bg1: rgba(242, 162, 74, 0.28);
        --bg2: rgba(42, 26, 12, 0.4);
        --bg3: #2a1a0c;
        --bg4: #4d2f14;
        --bg5: #3a1f08;
        --error: #b42318;
        --error-bg: #fdecea;
      }

      body[data-theme="total"] {
        --ink: #1a1030;
        --ink-soft: #2f1f5c;
        --mist: #ece7ff;
        --paper: #faf8ff;
        --line: #cec4f0;
        --accent: #5a3fc0;
        --accent-deep: #3d2894;
        --accent-glow: #8a70e6;
        --result: #3d2894;
        --result-bg: #e0d6ff;
        --warn-bg: #fff4d6;
        --warn-line: #f0c765;
        --warn-ink: #6b4a09;
        --shadow: 0 20px 50px rgba(26, 16, 48, 0.22);
        --brand: #ece7ff;
        --brand-muted: rgba(236, 231, 255, 0.78);
        --focus-ring: rgba(90, 63, 192, 0.2);
        --submit-shadow: rgba(90, 63, 192, 0.3);
        --metric-muted: #8578b8;
        --heading-muted: #8578b8;
        --bg1: rgba(138, 112, 230, 0.28);
        --bg2: rgba(26, 16, 48, 0.4);
        --bg3: #1a1030;
        --bg4: #2f1f5c;
        --bg5: #22124a;
        --error: #b42318;
        --error-bg: #fdecea;
      }

      body[data-theme="compare"] {
        --ink: #0c1c2e;
        --ink-soft: #1a3554;
        --mist: #e4eef8;
        --paper: #f6f9fc;
        --line: #c3d4e6;
        --accent: #1a6bb5;
        --accent-deep: #0e4a82;
        --accent-glow: #4aa0e6;
        --result: #0e4a82;
        --result-bg: #d4e8f8;
        --warn-bg: #fff4d6;
        --warn-line: #f0c765;
        --warn-ink: #6b4a09;
        --shadow: 0 20px 50px rgba(12, 28, 46, 0.2);
        --brand: #e4eef8;
        --brand-muted: rgba(228, 238, 248, 0.78);
        --focus-ring: rgba(26, 107, 181, 0.2);
        --submit-shadow: rgba(26, 107, 181, 0.3);
        --metric-muted: #7a96b0;
        --heading-muted: #5a7a96;
        --bg1: rgba(74, 160, 230, 0.24);
        --bg2: rgba(12, 28, 46, 0.38);
        --bg3: #0c1c2e;
        --bg4: #14304c;
        --bg5: #0a2438;
        --error: #b42318;
        --error-bg: #fdecea;
      }

      body[data-theme="finder"] {
        --ink: #2a2208;
        --ink-soft: #5a4a14;
        --mist: #fbf3d8;
        --paper: #fffdf6;
        --line: #e6d59a;
        --accent: #c4920a;
        --accent-deep: #8a6808;
        --accent-glow: #e8c04a;
        --result: #8a6808;
        --result-bg: #f8e9b0;
        --warn-bg: #fff4d6;
        --warn-line: #f0c765;
        --warn-ink: #6b4a09;
        --shadow: 0 20px 50px rgba(42, 34, 8, 0.2);
        --brand: #fbf3d8;
        --brand-muted: rgba(251, 243, 216, 0.78);
        --focus-ring: rgba(196, 146, 10, 0.22);
        --submit-shadow: rgba(196, 146, 10, 0.3);
        --metric-muted: #b09848;
        --heading-muted: #9a8030;
        --bg1: rgba(232, 192, 74, 0.28);
        --bg2: rgba(42, 34, 8, 0.38);
        --bg3: #2a2208;
        --bg4: #4a3a10;
        --bg5: #1e1806;
        --error: #b42318;
        --error-bg: #fdecea;
      }

      body[data-mode="dark"][data-theme="loan"] {
        --ink: #e4f2f0;
        --ink-soft: #b8d4d0;
        --mist: #163836;
        --paper: #102826;
        --line: #2a524e;
        --result: #5ee0b8;
        --result-bg: #0e3a32;
        --warn-bg: #3a3010;
        --warn-line: #8a7020;
        --warn-ink: #f0d88a;
        --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        --metric-muted: #6a908c;
        --heading-muted: #7aa8a2;
        --error-bg: #3a1816;
      }

      body[data-mode="dark"][data-theme="car"] {
        --ink: #f6eadc;
        --ink-soft: #e0c8a8;
        --mist: #3a2814;
        --paper: #2a1c0e;
        --line: #5a4020;
        --result: #f2b06a;
        --result-bg: #3a2410;
        --warn-bg: #3a3010;
        --warn-line: #8a7020;
        --warn-ink: #f0d88a;
        --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        --metric-muted: #a88860;
        --heading-muted: #c0a078;
        --error-bg: #3a1816;
      }

      body[data-mode="dark"][data-theme="total"] {
        --ink: #ece8ff;
        --ink-soft: #c8c0e8;
        --mist: #2a2048;
        --paper: #1a1430;
        --line: #443868;
        --result: #b8a0ff;
        --result-bg: #2a2050;
        --warn-bg: #3a3010;
        --warn-line: #8a7020;
        --warn-ink: #f0d88a;
        --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        --metric-muted: #8878b0;
        --heading-muted: #a090c8;
        --error-bg: #3a1816;
      }

      body[data-mode="dark"][data-theme="compare"] {
        --ink: #e4eef8;
        --ink-soft: #b0c8e0;
        --mist: #163048;
        --paper: #0e1e2e;
        --line: #2a4860;
        --result: #7ec4f0;
        --result-bg: #123448;
        --warn-bg: #3a3010;
        --warn-line: #8a7020;
        --warn-ink: #f0d88a;
        --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        --metric-muted: #6a88a0;
        --heading-muted: #88a8c0;
        --error-bg: #3a1816;
      }

      body[data-mode="dark"][data-theme="finder"] {
        --ink: #f8f0d0;
        --ink-soft: #e0d0a0;
        --mist: #3a3010;
        --paper: #241c08;
        --line: #5a4a20;
        --result: #f0d060;
        --result-bg: #3a2e0c;
        --warn-bg: #3a3010;
        --warn-line: #8a7020;
        --warn-ink: #f0d88a;
        --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        --metric-muted: #b0a060;
        --heading-muted: #d0c080;
        --error-bg: #3a1816;
      }

      /* —— Chrome (header tools, whole-page light/dark) —— */
      body {
        --chrome-bg: rgba(255, 255, 255, 0.12);
        --chrome-bg-hover: rgba(255, 255, 255, 0.22);
        --chrome-border: rgba(255, 255, 255, 0.3);
        --chrome-ink: var(--brand);
      }

      body[data-mode="light"] {
        --chrome-bg: rgba(12, 42, 46, 0.06);
        --chrome-bg-hover: rgba(12, 42, 46, 0.12);
        --chrome-border: rgba(12, 42, 46, 0.16);
      }

      body[data-mode="light"][data-theme="loan"] {
        --brand: #0c2a2e;
        --brand-muted: rgba(12, 42, 46, 0.72);
        --bg1: rgba(26, 168, 150, 0.2);
        --bg2: rgba(13, 122, 111, 0.12);
        --bg3: #eef7f5;
        --bg4: #e2f0ed;
        --bg5: #d5e8e4;
      }
      body[data-mode="light"][data-theme="car"] {
        --brand: #2a1a0c;
        --brand-muted: rgba(42, 26, 12, 0.72);
        --bg1: rgba(242, 162, 74, 0.22);
        --bg2: rgba(194, 87, 12, 0.1);
        --bg3: #fff8f0;
        --bg4: #fdefdc;
        --bg5: #f5e4cc;
      }
      body[data-mode="light"][data-theme="total"] {
        --brand: #1a1030;
        --brand-muted: rgba(26, 16, 48, 0.72);
        --bg1: rgba(138, 112, 230, 0.18);
        --bg2: rgba(90, 63, 192, 0.1);
        --bg3: #f6f3ff;
        --bg4: #ece7ff;
        --bg5: #e2dbfa;
      }
      body[data-mode="light"][data-theme="compare"] {
        --brand: #0c1c2e;
        --brand-muted: rgba(12, 28, 46, 0.72);
        --bg1: rgba(74, 160, 230, 0.18);
        --bg2: rgba(26, 107, 181, 0.1);
        --bg3: #f2f7fc;
        --bg4: #e4eef8;
        --bg5: #d6e5f2;
      }
      body[data-mode="light"][data-theme="finder"] {
        --brand: #2a2208;
        --brand-muted: rgba(42, 34, 8, 0.72);
        --bg1: rgba(232, 192, 74, 0.22);
        --bg2: rgba(196, 146, 10, 0.1);
        --bg3: #fffdf4;
        --bg4: #fbf3d8;
        --bg5: #f3e8b8;
      }

      body[data-mode="dark"][data-theme="loan"] {
        --brand: #eaf6f4;
        --brand-muted: rgba(232, 242, 240, 0.78);
        --bg1: rgba(26, 168, 150, 0.14);
        --bg2: rgba(0, 0, 0, 0.45);
        --bg3: #071617;
        --bg4: #0a1f20;
        --bg5: #061213;
        --chrome-bg: rgba(255, 255, 255, 0.08);
        --chrome-bg-hover: rgba(255, 255, 255, 0.16);
        --chrome-border: rgba(255, 255, 255, 0.22);
        --chrome-ink: #eaf6f4;
      }
      body[data-mode="dark"][data-theme="car"] {
        --brand: #fbeedd;
        --brand-muted: rgba(251, 238, 221, 0.78);
        --bg1: rgba(242, 162, 74, 0.14);
        --bg2: rgba(0, 0, 0, 0.45);
        --bg3: #140c06;
        --bg4: #1c1208;
        --bg5: #100904;
        --chrome-bg: rgba(255, 255, 255, 0.08);
        --chrome-bg-hover: rgba(255, 255, 255, 0.16);
        --chrome-border: rgba(255, 255, 255, 0.22);
        --chrome-ink: #fbeedd;
      }
      body[data-mode="dark"][data-theme="total"] {
        --brand: #ece7ff;
        --brand-muted: rgba(236, 231, 255, 0.78);
        --bg1: rgba(138, 112, 230, 0.14);
        --bg2: rgba(0, 0, 0, 0.45);
        --bg3: #0c0818;
        --bg4: #120e22;
        --bg5: #0a0614;
        --chrome-bg: rgba(255, 255, 255, 0.08);
        --chrome-bg-hover: rgba(255, 255, 255, 0.16);
        --chrome-border: rgba(255, 255, 255, 0.22);
        --chrome-ink: #ece7ff;
      }
      body[data-mode="dark"][data-theme="compare"] {
        --brand: #e4eef8;
        --brand-muted: rgba(228, 238, 248, 0.78);
        --bg1: rgba(74, 160, 230, 0.12);
        --bg2: rgba(0, 0, 0, 0.45);
        --bg3: #060c14;
        --bg4: #0a1420;
        --bg5: #050910;
        --chrome-bg: rgba(255, 255, 255, 0.08);
        --chrome-bg-hover: rgba(255, 255, 255, 0.16);
        --chrome-border: rgba(255, 255, 255, 0.22);
        --chrome-ink: #e4eef8;
      }
      body[data-mode="dark"][data-theme="finder"] {
        --brand: #fbf3d8;
        --brand-muted: rgba(251, 243, 216, 0.78);
        --bg1: rgba(232, 192, 74, 0.12);
        --bg2: rgba(0, 0, 0, 0.45);
        --bg3: #120e04;
        --bg4: #1c1608;
        --bg5: #0c0a04;
        --chrome-bg: rgba(255, 255, 255, 0.08);
        --chrome-bg-hover: rgba(255, 255, 255, 0.16);
        --chrome-border: rgba(255, 255, 255, 0.22);
        --chrome-ink: #fbf3d8;
      }

      body[data-mode="light"] .section-nav button {
        color: var(--ink);
        background: rgba(255, 255, 255, 0.72);
        border-color: color-mix(in srgb, var(--line) 85%, transparent);
        box-shadow: 0 4px 14px rgba(12, 42, 46, 0.06);
      }
      body[data-mode="light"] .section-nav button:hover {
        background: #fff;
      }
      body[data-mode="light"] .section-nav button.active {
        color: #fff;
        background: var(--accent);
        border-color: var(--accent-deep);
        box-shadow: 0 10px 28px var(--submit-shadow);
      }
      body[data-mode="light"] .section-nav__num {
        background: color-mix(in srgb, var(--accent) 16%, #fff);
        color: var(--accent-deep);
      }
      body[data-mode="light"] .section-nav button.active .section-nav__num {
        background: rgba(255, 255, 255, 0.28);
        color: #fff;
      }
      body[data-mode="light"] .site-footer {
        color: var(--brand-muted);
      }
      body[data-mode="light"]::before {
        background-image:
          linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
          linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
      }

      body[data-mode="dark"] .ai-panel {
        background: var(--paper);
        color: var(--ink);
        border-color: var(--line);
      }
      body[data-mode="dark"] .ai-msg.bot {
        background: var(--mist);
      }

      :root {
        --radius: 4px;
        --ok: #0b6b4a;
        --caution: #b8860b;
        --danger: #b42318;
      }

      * {
        box-sizing: border-box;
      }

      body {
        font-family: "Tajawal", sans-serif;
        font-size: 16.5px;
        margin: 0;
        min-height: 100vh;
        color: var(--ink);
        background:
          radial-gradient(
            ellipse 80% 50% at 10% 0%,
            var(--bg1),
            transparent 55%
          ),
          radial-gradient(
            ellipse 70% 45% at 95% 10%,
            var(--bg2),
            transparent 50%
          ),
          linear-gradient(
            165deg,
            var(--bg3) 0%,
            var(--bg4) 42%,
            var(--bg5) 100%
          );
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 28px 16px 80px;
        position: relative;
        overflow-x: hidden;
        transition: background 0.35s ease;
      }

      body::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image:
          linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
          linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
        background-size: 48px 48px;
        pointer-events: none;
        mask-image: radial-gradient(
          ellipse 70% 60% at 50% 40%,
          #000 20%,
          transparent 75%
        );
      }

      html[lang="en"] body {
        font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
        font-size: 17.5px;
        letter-spacing: -0.011em;
        font-optical-sizing: auto;
      }

      html[lang="en"] label,
      html[lang="en"] .section-nav__label,
      html[lang="en"] button[type="submit"],
      html[lang="en"] .btn-primary,
      html[lang="en"] .headline-metric .label,
      html[lang="en"] .result-metric .label {
        letter-spacing: -0.02em;
      }

      html[lang="ar"] body {
        font-size: 16.75px;
      }

      .shell {
        width: 100%;
        max-width: 720px;
        position: relative;
        z-index: 1;
      }

      body[data-theme="compare"] .shell,
      body[data-theme="finder"] .shell {
        max-width: 960px;
      }

      @keyframes reveal {
        from {
          opacity: 0;
          transform: translateY(12px) scale(0.98);
        }
        to {
          opacity: 1;
          transform: translateY(0) scale(1);
        }
      }

      @keyframes shake {
        0%,
        100% {
          transform: translateX(0);
        }
        20% {
          transform: translateX(-6px);
        }
        40% {
          transform: translateX(6px);
        }
        60% {
          transform: translateX(-4px);
        }
        80% {
          transform: translateX(4px);
        }
      }

      .brand {
        text-align: center;
        margin-bottom: 14px;
        color: var(--brand);
        position: relative;
      }

      .brand-top {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
        position: relative;
        min-height: 182px;
      }

      .brand-logo {
        display: block;
        height: 182px;
        width: auto;
        max-width: min(420px, 88vw);
        object-fit: contain;
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35));
        transition:
          filter 0.55s ease,
          transform 0.45s ease,
          opacity 0.45s ease;
      }

      body[data-theme="loan"] .brand-logo {
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35)) hue-rotate(0deg)
          saturate(1);
      }
      body[data-theme="car"] .brand-logo {
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35)) hue-rotate(38deg)
          saturate(1.18);
      }
      body[data-theme="total"] .brand-logo {
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35)) hue-rotate(248deg)
          saturate(1.12);
      }
      body[data-theme="compare"] .brand-logo {
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35)) hue-rotate(188deg)
          saturate(1.08);
      }
      body[data-theme="finder"] .brand-logo {
        filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.35)) hue-rotate(52deg)
          saturate(1.22);
      }

      .brand-logo.logo-pulse {
        animation: logo-pulse 0.55s ease;
      }

      @keyframes logo-pulse {
        0% {
          transform: scale(0.96);
          opacity: 0.72;
        }
        55% {
          transform: scale(1.03);
          opacity: 1;
        }
        100% {
          transform: scale(1);
          opacity: 1;
        }
      }

      .brand-logo--dark {
        display: none;
      }

      body[data-mode="dark"] .brand-logo--light {
        display: none;
      }

      body[data-mode="dark"] .brand-logo--dark {
        display: block;
      }

      .brand-tools {
        position: absolute;
        inset-inline-end: 0;
        top: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
        z-index: 2;
      }

      .brand p {
        margin: 0;
        font-size: 1.02rem;
        color: var(--brand-muted);
        max-width: 36rem;
        margin-inline: auto;
        line-height: 1.5;
      }

      html[lang="en"] .brand p {
        font-size: 1.08rem;
        font-weight: 500;
      }

      .icon-btn {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 1.5px solid var(--chrome-border);
        background: var(--chrome-bg);
        color: var(--chrome-ink);
        cursor: pointer;
        display: grid;
        place-items: center;
        flex-shrink: 0;
        padding: 0;
        transition:
          background 0.2s,
          transform 0.15s,
          border-color 0.2s;
      }

      .icon-btn:hover {
        background: var(--chrome-bg-hover);
        transform: translateY(-1px);
      }

      .icon-btn svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .lang-btn {
        min-width: 42px;
        height: 42px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1.5px solid var(--chrome-border);
        background: var(--chrome-bg);
        color: var(--chrome-ink);
        font-family: inherit;
        font-size: 0.78rem;
        font-weight: 800;
        cursor: pointer;
        letter-spacing: 0.04em;
        transition:
          background 0.2s,
          transform 0.15s;
      }

      .lang-btn:hover {
        background: var(--chrome-bg-hover);
        transform: translateY(-1px);
      }

      .sub-badge {
        height: 42px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1.5px solid var(--chrome-border);
        background: var(--chrome-bg);
        color: var(--chrome-ink);
        font-family: inherit;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        cursor: pointer;
        white-space: nowrap;
        transition:
          background 0.2s,
          transform 0.15s,
          border-color 0.2s;
      }

      .sub-badge:hover {
        background: var(--chrome-bg-hover);
        transform: translateY(-1px);
      }

      .sub-badge.pro {
        border-color: #d4b84a;
        background: linear-gradient(135deg, #f8ecc0, #d4a017);
        color: #1a1404;
      }

      body[data-mode="light"] .icon-btn .icon-sun,
      body[data-mode="dark"] .icon-btn .icon-moon {
        display: none;
      }

      body[data-mode="dark"] .icon-btn .icon-sun,
      body[data-mode="light"] .icon-btn .icon-moon {
        display: block;
      }

      .section-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 22px;
        align-items: stretch;
      }

      .section-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        min-height: 96px;
        padding: 12px 8px 14px;
        font-family: inherit;
        text-align: center;
        color: var(--brand);
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.22);
        border-radius: 12px;
        cursor: pointer;
        transition:
          background 0.2s,
          border-color 0.2s,
          transform 0.15s,
          box-shadow 0.2s;
        position: relative;
      }

      .section-nav button:hover {
        background: rgba(255, 255, 255, 0.16);
        transform: translateY(-2px);
      }

      .section-nav button.active {
        background: var(--accent);
        border-color: #fff;
        color: #fff;
        box-shadow: 0 10px 28px var(--submit-shadow);
        transform: translateY(-2px);
      }

      .section-nav button.done .section-nav__num::after {
        content: "✓";
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 0.72rem;
      }

      .section-nav button.done .section-nav__num {
        background: #1a9a5c;
        color: #fff;
        position: relative;
      }

      .section-nav button.locked .section-nav__num::after {
        content: "🔒";
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 0.62rem;
      }

      .section-nav button.locked .section-nav__num span {
        opacity: 0;
      }

      .pro-chip {
        display: inline-flex;
        align-items: center;
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        padding: 2px 6px;
        border-radius: 999px;
        background: #e8c547;
        color: #1a1404;
        line-height: 1.2;
      }

      .section-nav button.locked .pro-chip {
        background: rgba(255, 255, 255, 0.2);
        color: inherit;
      }

      .section-nav__num {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-size: 0.82rem;
        font-weight: 800;
        background: rgba(255, 255, 255, 0.18);
        line-height: 1;
        position: relative;
        margin-bottom: 2px;
        flex-shrink: 0;
      }

      .section-nav button.active .section-nav__num {
        background: rgba(255, 255, 255, 0.28);
      }

      .section-nav__label {
        font-size: 0.92rem;
        font-weight: 800;
        line-height: 1.25;
        max-width: 100%;
      }

      .section-nav__hint {
        font-size: 0.72rem;
        font-weight: 500;
        opacity: 0.78;
        line-height: 1.3;
        max-width: 100%;
        padding-inline: 2px;
      }

      html[lang="en"] .section-nav__label {
        font-size: 0.98rem;
        font-weight: 700;
      }

      html[lang="en"] .section-nav__hint {
        font-size: 0.76rem;
        font-weight: 500;
      }

      html[lang="ar"] .section-nav__label {
        font-size: 0.95rem;
      }

      html[lang="ar"] .section-nav__hint {
        font-size: 0.74rem;
      }

      .view {
        display: none;
        animation: reveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .view.active {
        display: block;
      }

      .panel {
        background: var(--paper);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 26px 26px 30px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        position: relative;
        overflow: hidden;
      }

      .panel::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(
          90deg,
          var(--accent-deep),
          var(--accent-glow)
        );
      }

      form {
        display: flex;
        flex-direction: column;
        gap: 16px;
      }

      .field {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .field.invalid input,
      .field.invalid select {
        border-color: var(--error);
        box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
      }

      .field-error {
        display: none;
        color: var(--error);
        font-size: 0.78rem;
        font-weight: 600;
      }

      .field.invalid .field-error {
        display: block;
      }

      .label-row {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      label {
        color: var(--ink-soft);
        font-weight: 700;
        font-size: 1rem;
      }

      html[lang="en"] label {
        font-size: 1.04rem;
        font-weight: 600;
      }

      .tip {
        position: relative;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: none;
        background: var(--mist);
        color: var(--heading-muted);
        font-size: 0.7rem;
        font-weight: 800;
        cursor: help;
        font-family: inherit;
        padding: 0;
      }

      .tip:hover .tip-box,
      .tip:focus .tip-box {
        display: block;
      }

      .tip-box {
        display: none;
        position: absolute;
        top: 24px;
        right: 0;
        width: 220px;
        padding: 8px 10px;
        background: var(--ink);
        color: var(--paper);
        font-size: 0.75rem;
        font-weight: 500;
        line-height: 1.45;
        border-radius: 6px;
        z-index: 8;
        text-align: right;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
      }

      .input-wrap {
        position: relative;
        display: flex;
        align-items: center;
      }

      .input-wrap .suffix {
        position: absolute;
        left: 14px;
        color: var(--heading-muted);
        font-weight: 700;
        font-size: 1rem;
        pointer-events: none;
      }

      .input-wrap.has-suffix input {
        padding-left: 44px;
      }

      input[type="number"],
      input[type="text"],
      input[type="password"],
      input[type="search"],
      select,
      textarea {
        width: 100%;
        padding: 13px 15px;
        font-family: inherit;
        font-size: 1.05rem;
        font-weight: 500;
        border: 1.5px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        color: var(--ink);
        transition:
          border-color 0.2s,
          box-shadow 0.2s;
        -moz-appearance: textfield;
      }

      body[data-mode="dark"] input[type="number"],
      body[data-mode="dark"] input[type="text"],
      body[data-mode="dark"] input[type="password"],
      body[data-mode="dark"] input[type="search"],
      body[data-mode="dark"] select,
      body[data-mode="dark"] textarea {
        background: color-mix(in srgb, var(--paper) 70%, #000);
        color: var(--ink);
      }

      input[type="number"]::-webkit-outer-spin-button,
      input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }

      input::placeholder,
      textarea::placeholder {
        color: var(--metric-muted);
        font-weight: 400;
      }

      input:focus,
      select:focus,
      textarea:focus {
        border-color: var(--accent);
        outline: none;
        box-shadow: 0 0 0 3px var(--focus-ring);
      }

      .segmented {
        display: grid;
        gap: 6px;
        padding: 5px;
        background: var(--mist);
        border: 1px solid var(--line);
        border-radius: var(--radius);
      }

      .segmented.cols-3 {
        grid-template-columns: repeat(3, 1fr);
      }

      .segmented.cols-2 {
        grid-template-columns: repeat(2, 1fr);
      }

      .segmented input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
      }

      .segmented label {
        margin: 0;
        text-align: center;
        padding: 11px 8px;
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--ink-soft);
        cursor: pointer;
        border-radius: var(--radius);
        transition:
          background 0.2s,
          color 0.2s;
      }

      .segmented input:checked + label {
        background: var(--accent);
        color: #fff;
        box-shadow: 0 4px 12px var(--submit-shadow);
      }

      .subgroup {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 14px;
        border: 1px dashed var(--line);
        border-radius: var(--radius);
        background: color-mix(in srgb, var(--mist) 55%, transparent);
        animation: reveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .subgroup-title {
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--heading-muted);
        letter-spacing: 0.08em;
        margin: -4px 0;
      }

      .subgroup.is-on {
        border-style: solid;
        border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
        background: color-mix(in srgb, var(--result-bg) 38%, var(--paper));
      }

      .opt-check {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        cursor: pointer;
        margin: 0;
        position: relative;
      }

      .opt-check input {
        position: absolute;
        opacity: 0;
        width: 1px;
        height: 1px;
        pointer-events: none;
      }

      .opt-check-box {
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        margin-top: 1px;
        border: 1.5px solid var(--line);
        border-radius: 6px;
        background: var(--paper);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
        position: relative;
        transition:
          background 0.15s,
          border-color 0.15s,
          box-shadow 0.15s;
      }

      .opt-check input:checked + .opt-check-box {
        background: var(--accent);
        border-color: var(--accent-deep);
        box-shadow: 0 4px 10px var(--submit-shadow);
      }

      .opt-check input:checked + .opt-check-box::after {
        content: "";
        position: absolute;
        top: 3px;
        right: 7px;
        width: 5px;
        height: 10px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
      }

      .opt-check input:focus-visible + .opt-check-box {
        box-shadow: 0 0 0 3px var(--focus-ring);
      }

      .opt-check-copy {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
      }

      .opt-check-title {
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--ink);
      }

      .opt-check-hint {
        font-size: 0.78rem;
        font-weight: 500;
        color: var(--heading-muted);
        line-height: 1.45;
      }

      #takafulFields[hidden],
      #takafulMetric[hidden],
      #bdTakafulCell[hidden],
      #totalLoanSub[hidden] {
        display: none !important;
      }

      #view-loan .results-grid.has-takaful {
        grid-template-columns: repeat(4, 1fr);
      }

      .split-clusters {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .field-cluster {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: var(--radius);
        background: color-mix(in srgb, var(--paper) 75%, var(--mist));
        border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
      }

      .field-cluster + .field-cluster {
        position: relative;
        margin-top: 2px;
        padding-top: 16px;
      }

      .field-cluster + .field-cluster::before {
        content: "";
        position: absolute;
        top: 0;
        right: 8px;
        left: 8px;
        border-top: 1px dashed var(--line);
      }

      .form-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 4px;
      }

      button[type="submit"],
      .btn-primary {
        flex: 1;
        padding: 14px 16px;
        font-family: inherit;
        font-size: 1.1rem;
        font-weight: 800;
        background: var(--accent);
        color: #fff;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        letter-spacing: 0.04em;
        transition:
          background 0.2s,
          transform 0.15s,
          opacity 0.2s;
        box-shadow: 0 8px 20px var(--submit-shadow);
      }

      button[type="submit"]:hover:not(:disabled),
      .btn-primary:hover:not(:disabled) {
        background: var(--accent-deep);
        transform: translateY(-1px);
      }

      button[type="submit"]:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        box-shadow: none;
      }

      .btn-ghost {
        padding: 14px 14px;
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 700;
        background: transparent;
        color: var(--ink-soft);
        border: 1.5px solid var(--line);
        border-radius: var(--radius);
        cursor: pointer;
      }

      .btn-ghost:hover {
        border-color: var(--accent);
        color: var(--accent-deep);
      }

      .btn-ghost.btn-danger {
        color: var(--error);
        border-color: color-mix(in srgb, var(--error) 45%, var(--line));
      }

      .btn-ghost.btn-danger:hover {
        border-color: var(--error);
        color: var(--error);
        background: var(--error-bg);
      }

      .btn-sm {
        padding: 7px 12px;
        font-family: inherit;
        font-size: 0.78rem;
        font-weight: 700;
        background: var(--mist);
        color: var(--ink-soft);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        cursor: pointer;
      }

      .btn-sm:hover {
        border-color: var(--accent);
        color: var(--accent-deep);
      }

      .form.shake {
        animation: shake 0.4s ease;
      }

      .import-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-top: 6px;
        padding: 11px 12px;
        font-family: inherit;
        font-size: 0.86rem;
        font-weight: 800;
        color: var(--accent-deep);
        background: color-mix(in srgb, var(--result-bg) 70%, var(--paper));
        border: 1.5px solid var(--accent);
        border-radius: var(--radius);
        cursor: pointer;
        box-shadow: 0 4px 12px var(--submit-shadow);
        transition:
          background 0.2s,
          transform 0.15s,
          box-shadow 0.2s;
      }
      .import-btn:hover {
        background: var(--accent);
        color: #fff;
        transform: translateY(-1px);
      }
      .import-btn.is-empty {
        opacity: 0.78;
        box-shadow: none;
      }
      .import-btn__ico {
        font-size: 1rem;
        font-weight: 800;
        line-height: 1;
      }
      .import-btn__count {
        min-width: 1.4em;
        padding: 1px 7px;
        border-radius: 999px;
        background: var(--accent-deep);
        color: #fff;
        font-size: 0.72rem;
        font-weight: 800;
      }
      .import-btn:hover .import-btn__count {
        background: #fff;
        color: var(--accent-deep);
      }
      .import-chip {
        margin: 6px 0 0;
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--result);
      }
      .import-chip[hidden] {
        display: none !important;
      }
      .import-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .import-row {
        display: grid;
        gap: 4px;
        width: 100%;
        text-align: start;
        padding: 12px 14px;
        font-family: inherit;
        color: var(--ink);
        background: var(--paper);
        border: 1.5px solid var(--line);
        border-radius: 10px;
        cursor: pointer;
      }
      .import-row:hover,
      .import-row:focus-visible {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--focus-ring);
      }
      .import-row strong {
        font-size: 0.95rem;
      }
      .import-row span {
        font-size: 0.78rem;
        color: var(--ink-soft);
        font-weight: 600;
      }
      .import-empty {
        margin: 0;
        font-weight: 600;
        color: var(--heading-muted);
        line-height: 1.5;
      }
      .modal-card.import-card {
        width: min(520px, 100%);
      }
      .modal-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
      }
      .modal-actions button {
        flex: 1 1 140px;
        padding: 12px 14px;
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 800;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        background: var(--accent);
        color: #fff;
      }
      .modal-actions .btn-quiet {
        background: var(--mist);
        color: var(--ink);
        border: 1.5px solid var(--line);
      }
      .notes-fields {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .notes-fields textarea {
        min-height: 88px;
        resize: vertical;
        font-family: inherit;
        font-size: 0.92rem;
      }

      .tier-picker {
        display: none;
        gap: 6px;
        margin-top: 6px;
      }

      .tier-picker.open {
        display: flex;
      }

      .tier-picker button {
        flex: 1;
        padding: 8px 6px;
        font-family: inherit;
        font-size: 0.78rem;
        font-weight: 700;
        background: #fff;
        color: var(--ink-soft);
        border: 1.5px solid var(--line);
        border-radius: var(--radius);
        cursor: pointer;
      }

      body[data-mode="dark"] .tier-picker button {
        background: var(--paper);
      }

      .results {
        margin-top: 24px;
        padding-top: 22px;
        border-top: 1px dashed var(--line);
        position: relative;
        scroll-margin-top: 20px;
      }

      .results-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 12px;
      }

      .money-burst {
        position: absolute;
        inset: 0;
        pointer-events: none;
        overflow: hidden;
        z-index: 2;
      }

      .money-burst span {
        position: absolute;
        bottom: 18%;
        font-size: 1.1rem;
        font-weight: 800;
        color: var(--accent);
        opacity: 0;
        animation: coin-rise 1.05s ease-out forwards;
      }

      @keyframes coin-rise {
        0% {
          opacity: 0;
          transform: translateY(12px) scale(0.7) rotate(-8deg);
        }
        18% {
          opacity: 1;
        }
        100% {
          opacity: 0;
          transform: translateY(-90px) scale(1.05) rotate(18deg);
        }
      }

      .results-heading {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--heading-muted);
        margin: 0 0 14px;
        letter-spacing: 0.06em;
      }

      .results-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
      }

      #view-loan .results-grid,
      .results-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
      }

      .results-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
      }

      .result-metric {
        background: var(--mist);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 16px 12px;
        text-align: center;
      }

      .result-metric.has-value {
        background: var(--result-bg);
        animation: reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .result-metric .label {
        display: block;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--ink-soft);
        margin-bottom: 8px;
      }

      .result-metric.has-value .label {
        color: var(--result);
      }

      .result-metric .value {
        display: block;
        font-size: 1.25rem;
        font-weight: 800;
        color: var(--metric-muted);
        font-variant-numeric: tabular-nums;
        min-height: 1.4em;
      }

      .result-metric.has-value .value {
        color: var(--result);
      }

      .result-metric .placeholder {
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--metric-muted);
      }

      .result-metric .sub {
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--heading-muted);
        margin-top: 4px;
      }

      .headline-metric {
        background: linear-gradient(
          135deg,
          var(--accent-deep),
          var(--accent-glow)
        );
        color: #fff;
        padding: 22px 16px;
        border-radius: var(--radius);
        text-align: center;
        box-shadow: 0 10px 26px var(--submit-shadow);
        animation: reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .headline-metric .label {
        display: block;
        font-size: 0.9rem;
        font-weight: 700;
        opacity: 0.9;
        margin-bottom: 6px;
      }

      .headline-metric .value {
        display: block;
        font-size: 2rem;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
      }

      .headline-metric .variance {
        display: inline-block;
        margin-top: 8px;
        padding: 4px 10px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 999px;
        font-size: 0.82rem;
        font-weight: 700;
      }

      .disclaimer {
        margin-top: 14px;
        padding: 12px 14px;
        background: var(--warn-bg);
        border: 1px solid var(--warn-line);
        border-right: 4px solid var(--warn-line);
        border-radius: var(--radius);
        color: var(--warn-ink);
        font-size: 0.85rem;
        font-weight: 500;
        line-height: 1.5;
      }

      .disclaimer::before {
        content: "⚠ ";
        font-weight: 800;
      }

      .breakdown {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
      }

      .breakdown.cols-4 {
        grid-template-columns: repeat(4, 1fr);
      }

      .breakdown .cell {
        background: var(--mist);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 10px 8px;
        text-align: center;
      }

      .breakdown .cell .k {
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--ink-soft);
        margin-bottom: 4px;
      }

      .breakdown .cell .v {
        display: block;
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--result);
        font-variant-numeric: tabular-nums;
      }

      .history {
        margin-top: 24px;
        padding-top: 22px;
        border-top: 1px dashed var(--line);
        animation: reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .history-heading {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin: 0 0 12px;
        flex-wrap: wrap;
      }

      .history-heading .title {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--heading-muted);
        letter-spacing: 0.06em;
      }

      .history-heading .hint {
        font-size: 0.75rem;
        color: var(--metric-muted);
        font-weight: 500;
      }

      .history-scroll {
        overflow-x: auto;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        max-height: 360px;
        overflow-y: auto;
      }

      body[data-mode="dark"] .history-scroll {
        background: var(--paper);
      }

      .history-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.82rem;
        min-width: 480px;
      }

      .history-table th,
      .history-table td {
        padding: 10px 8px;
        text-align: center;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
      }

      .history-table th {
        background: var(--mist);
        color: var(--ink-soft);
        font-weight: 700;
        border-bottom: 1px solid var(--line);
        position: sticky;
        top: 0;
      }

      .history-table td {
        color: var(--ink);
        border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, #fff);
      }

      .history-table tbody tr {
        cursor: pointer;
      }

      .history-table tbody tr:hover td {
        background: color-mix(in srgb, var(--mist) 70%, transparent);
      }

      .history-table tbody tr:last-child td {
        border-bottom: none;
      }

      .history-table tbody tr.is-current td {
        background: var(--result-bg);
        color: var(--result);
        font-weight: 700;
      }

      .history-table a {
        color: inherit;
        font-weight: 800;
        text-decoration: underline;
        text-underline-offset: 2px;
      }

      .compare-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }

      .compare-grid.has-three {
        grid-template-columns: 1fr 1fr 1fr;
      }

      .car-card {
        border: 1.5px solid var(--line);
        border-radius: 8px;
        padding: 12px;
        background: color-mix(in srgb, var(--mist) 40%, var(--paper));
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
      }

      .car-card.winner {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px var(--focus-ring);
      }

      .winner-badge {
        position: absolute;
        top: -10px;
        left: 10px;
        background: var(--accent);
        color: #fff;
        font-size: 0.7rem;
        font-weight: 800;
        padding: 3px 8px;
        border-radius: 999px;
        display: none;
      }

      .car-card.winner .winner-badge {
        display: inline-block;
      }

      .compare-grid.has-three .car-card {
        max-height: min(78vh, 940px);
        overflow: auto;
      }

      .car-sec {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: color-mix(in srgb, var(--paper) 80%, var(--mist));
        padding: 0 10px 10px;
      }
      .car-sec summary {
        cursor: pointer;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        color: var(--accent-deep);
        padding: 10px 2px 8px;
        list-style: none;
      }
      .car-sec summary::-webkit-details-marker {
        display: none;
      }
      .car-sec .field {
        margin-top: 8px;
      }
      .car-card .import-btn {
        padding: 9px 10px;
        font-size: 0.78rem;
        margin-top: 4px;
      }

      .ai-warnings {
        margin: 0 0 14px;
        padding: 12px 14px;
        border-radius: 12px;
        background: var(--warn-bg);
        border: 1px solid var(--warn-line);
        color: var(--warn-ink);
      }
      .ai-warnings h4,
      .ai-market h4 {
        margin: 0 0 8px;
        font-size: 0.88rem;
      }
      .ai-warnings ul,
      .ai-market ul {
        margin: 0;
        padding-inline-start: 1.1em;
        line-height: 1.45;
      }
      .ai-market {
        margin: 0 0 14px;
        padding: 12px 14px;
        border-radius: 12px;
        background: var(--paper);
        border: 1px dashed var(--accent);
      }

      .bars {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
      }

      .bar-row {
        display: grid;
        grid-template-columns: 80px 1fr 90px;
        gap: 8px;
        align-items: center;
        font-size: 0.8rem;
      }

      .bar-track {
        height: 10px;
        background: var(--mist);
        border-radius: 99px;
        overflow: hidden;
      }

      .bar-fill {
        height: 100%;
        background: linear-gradient(
          90deg,
          var(--accent-deep),
          var(--accent-glow)
        );
        border-radius: 99px;
        width: 0;
        transition: width 0.6s ease;
      }

      .bar-row .n {
        font-weight: 700;
        color: var(--ink-soft);
      }

      .bar-row .v {
        font-weight: 800;
        color: var(--result);
        font-variant-numeric: tabular-nums;
        text-align: left;
      }

      .site-footer {
        text-align: center;
        margin-top: 22px;
        color: var(--brand-muted);
        font-size: 0.78rem;
      }

      .site-footer button {
        background: none;
        border: none;
        color: inherit;
        text-decoration: underline;
        cursor: pointer;
        font-family: inherit;
        font-size: inherit;
      }

      .ai-fab {
        position: fixed;
        left: 18px;
        bottom: 18px;
        z-index: 40;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, #1a6bb5, #4aa0e6);
        color: #fff;
        font-size: 1.4rem;
        cursor: pointer;
        box-shadow: 0 10px 28px rgba(26, 107, 181, 0.4);
      }

      .fab-flag {
        position: absolute;
        top: -4px;
        right: -4px;
        font-size: 0.55rem;
        font-weight: 800;
        padding: 2px 5px;
        border-radius: 999px;
        background: #6b7280;
        color: #fff;
        letter-spacing: 0.04em;
        line-height: 1.2;
      }

      .ai-fab.is-pro .fab-flag {
        background: #e8c547;
        color: #1a1404;
      }

      .ai-panel {
        position: fixed;
        left: 16px;
        bottom: 84px;
        width: min(380px, calc(100vw - 32px));
        height: min(520px, calc(100vh - 120px));
        background: var(--paper);
        color: var(--ink);
        border-radius: 12px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
        z-index: 41;
        display: none;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid var(--line);
      }

      .ai-panel.open {
        display: flex;
      }

      .ai-head {
        padding: 12px 14px;
        background: linear-gradient(135deg, #0e4a82, #1a6bb5);
        color: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
      }

      .ai-head h2 {
        margin: 0;
        font-size: 0.95rem;
      }

      .ai-head button {
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: #fff;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        cursor: pointer;
      }

      .ai-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .ai-msg {
        max-width: 92%;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 0.85rem;
        line-height: 1.5;
        white-space: pre-wrap;
      }

      .ai-msg.bot {
        background: var(--mist);
        align-self: flex-start;
      }

      .ai-msg.user {
        background: #1a6bb5;
        color: #fff;
        align-self: flex-end;
      }

      .ai-quick {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0 12px 8px;
      }

      .ai-quick button {
        font-family: inherit;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 5px 8px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: var(--mist);
        color: var(--ink-soft);
        cursor: pointer;
      }

      .ai-foot {
        padding: 10px;
        border-top: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .ai-compose {
        display: flex;
        gap: 6px;
      }

      .ai-compose textarea {
        min-height: 42px;
        resize: none;
        font-size: 0.9rem;
        padding: 8px 10px;
      }

      .ai-compose button {
        padding: 8px 12px;
        font-family: inherit;
        font-weight: 800;
        background: #1a6bb5;
        color: #fff;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
      }

      .hidden {
        display: none !important;
      }

      @media (max-width: 720px) {
        .compare-grid,
        .compare-grid.has-three {
          grid-template-columns: 1fr;
        }
        .section-nav {
          grid-template-columns: repeat(5, minmax(0, 1fr));
          gap: 8px;
        }
        .section-nav button {
          min-height: 84px;
          padding: 10px 6px 12px;
        }
        .section-nav__hint {
          display: none;
        }
        #view-loan .results-grid,
        #view-loan .results-grid.has-takaful,
        .results-grid.cols-3,
        .breakdown,
        .breakdown.cols-4 {
          grid-template-columns: 1fr 1fr;
        }
      }

      @media (max-width: 520px) {
        .panel {
          padding: 20px 16px 24px;
        }
        .section-nav {
          grid-template-columns: repeat(3, minmax(0, 1fr));
          gap: 8px;
        }
        .section-nav button {
          min-height: 78px;
          padding: 10px 5px 12px;
          gap: 5px;
        }
        .section-nav__num {
          width: 24px;
          height: 24px;
          font-size: 0.75rem;
        }
        .section-nav__label {
          font-size: 0.82rem;
        }
        html[lang="en"] .section-nav__label {
          font-size: 0.84rem;
        }
        #view-loan .results-grid,
        #view-loan .results-grid.has-takaful,
        .results-grid.cols-3,
        .results-grid.cols-2,
        .breakdown,
        .breakdown.cols-4 {
          grid-template-columns: 1fr;
        }
        .brand-logo {
          height: 140px;
        }
        .brand-top {
          min-height: 140px;
        }
        .headline-metric .value {
          font-size: 1.55rem;
        }
        .bar-row {
          grid-template-columns: 64px 1fr 72px;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        .view,
        .result-metric.has-value,
        .headline-metric,
        .subgroup {
          animation: none;
        }
        .brand-logo.logo-pulse {
          animation: none;
        }
        button[type="submit"]:hover,
        .section-nav button:hover,
        .section-nav button.active {
          transform: none;
        }
      }

      @media print {
        body {
          background: #fff !important;
          padding: 0;
          color: #111;
        }
        body::before,
        .section-nav,
        form,
        .ai-fab,
        .ai-panel,
        .icon-btn,
        .lang-btn,
        .site-footer,
        .import-link,
        .import-btn,
        .tier-picker,
        .results-toolbar,
        .history,
        .modal,
        .brand-tools {
          display: none !important;
        }
        .shell {
          max-width: 100%;
        }
        .view {
          display: none !important;
        }
        .view.active {
          display: block !important;
        }
        .panel {
          box-shadow: none;
          border: none;
        }
        .brand {
          color: #111;
        }
        .brand-logo {
          height: 120px;
          filter: none !important;
        }
        .print-only {
          display: block !important;
        }
        body.print-compare .shell,
        body.print-compare .ai-fab,
        body.print-compare .ai-panel,
        body.print-compare .modal {
          display: none !important;
        }
        body.print-compare .print-sheet {
          display: block !important;
        }
      }

      .print-only {
        display: none;
      }

      .mileage-row {
        display: flex;
        gap: 8px;
        align-items: stretch;
      }

      .mileage-row input {
        flex: 1;
      }

      .map-btn {
        width: 48px;
        flex-shrink: 0;
        border: 1.5px solid var(--line);
        border-radius: var(--radius);
        background: var(--mist);
        color: var(--accent-deep);
        cursor: pointer;
        display: grid;
        place-items: center;
        padding: 0;
      }

      .map-btn:hover {
        border-color: var(--accent);
        background: var(--accent);
        color: #fff;
      }

      .map-btn svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .modal {
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(8, 12, 18, 0.55);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 16px;
      }

      .modal.open {
        display: flex;
      }

      .modal-card {
        width: min(720px, 100%);
        max-height: min(92vh, 860px);
        overflow: auto;
        background: var(--paper);
        color: var(--ink);
        border-radius: 12px;
        border: 1px solid var(--line);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
        padding: 18px 18px 20px;
      }

      .modal-card.map-card {
        width: min(860px, 100%);
      }

      .modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 12px;
      }

      .modal-head h2 {
        margin: 0;
        font-size: 1.05rem;
      }

      .modal-head .icon-btn {
        width: 36px;
        height: 36px;
      }

      #mapCanvas {
        height: 320px;
        border-radius: 8px;
        border: 1px solid var(--line);
        z-index: 1;
        direction: ltr;
      }

      .map-search-row {
        display: flex;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 10px;
        position: relative;
        z-index: 1200;
      }

      .map-search {
        flex: 1;
        position: relative;
        min-width: 0;
        z-index: 1200;
      }

      .map-suggest {
        position: absolute;
        inset-inline: 0;
        top: calc(100% + 4px);
        margin: 0;
        padding: 4px;
        list-style: none;
        max-height: 220px;
        overflow: auto;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
        z-index: 1300;
      }

      .map-suggest button {
        width: 100%;
        text-align: start;
        border: none;
        background: none;
        padding: 8px 10px;
        font: inherit;
        font-size: 0.86rem;
        color: var(--ink);
        cursor: pointer;
        border-radius: 6px;
      }

      .map-suggest button:hover {
        background: var(--mist);
      }

      .user-loc {
        background: none;
        border: none;
      }

      .user-loc-dot {
        display: block;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #2b7fff;
        border: 3px solid #fff;
        box-shadow: 0 0 0 7px rgba(43, 127, 255, 0.28);
      }

      .map-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 12px;
      }

      .map-tools .full {
        grid-column: 1 / -1;
      }

      .trip-list {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-height: 140px;
        overflow: auto;
      }

      .trip-list li {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        font-size: 0.82rem;
        padding: 8px 10px;
        background: var(--mist);
        border-radius: 6px;
      }

      .trip-list button {
        border: none;
        background: none;
        color: var(--error);
        cursor: pointer;
        font-weight: 800;
        font-family: inherit;
      }

      .pay-grid {
        display: grid;
        gap: 12px;
      }

      .pay-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }

      .card-visual {
        background: linear-gradient(
          135deg,
          var(--accent-deep),
          var(--accent-glow)
        );
        color: #fff;
        border-radius: 14px;
        padding: 18px 16px;
        margin-bottom: 14px;
        min-height: 120px;
      }

      .card-visual .brand-mini {
        font-weight: 800;
        letter-spacing: 0.04em;
      }

      .card-visual .num {
        margin-top: 22px;
        font-size: 1.05rem;
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.08em;
        word-break: break-all;
      }

      .compare-table-wrap {
        overflow-x: auto;
        margin-top: 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
      }

      .finder-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-top: 12px;
      }

      .finder-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 14px;
        border: 1.5px solid var(--line);
        border-radius: 10px;
        background: color-mix(in srgb, var(--mist) 45%, var(--paper));
        color: inherit;
        text-decoration: none;
        transition:
          transform 0.15s,
          border-color 0.2s,
          box-shadow 0.2s;
      }

      .finder-card:hover {
        transform: translateY(-2px);
        border-color: var(--accent);
        box-shadow: 0 10px 24px var(--submit-shadow);
      }

      .finder-card__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .finder-ico {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: grid;
        place-items: center;
        background: color-mix(in srgb, var(--accent) 16%, var(--paper));
        color: var(--accent-deep);
        flex-shrink: 0;
      }

      .finder-ico svg,
      .finder-chip svg,
      .finder-meta svg,
      .finder-card .cta svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .finder-chip svg,
      .finder-meta svg,
      .finder-card .cta svg {
        width: 14px;
        height: 14px;
      }

      .finder-chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 0.7rem;
        font-weight: 800;
        padding: 4px 8px;
        border-radius: 999px;
        background: var(--mist);
        color: var(--ink-soft);
      }

      .finder-chip.is-ev {
        background: color-mix(in srgb, #1aa896 22%, var(--paper));
        color: var(--accent-deep);
      }

      .finder-card h3 {
        margin: 0;
        font-size: 1.05rem;
      }

      .finder-card .price,
      .finder-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        font-weight: 800;
        color: var(--result);
        font-size: 0.92rem;
      }

      .finder-meta span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
      }

      .finder-card p {
        margin: 0;
        font-size: 0.84rem;
        line-height: 1.45;
        color: var(--ink-soft);
      }

      .finder-card .cta {
        margin-top: auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--accent-deep);
      }

      .lock-note {
        font-size: 0.85rem;
        color: var(--ink-soft);
        margin: 0 0 10px;
      }

      .pay-status {
        margin: 0 0 12px;
        font-weight: 800;
        color: var(--result);
      }

      .print-sheet {
        display: none;
        background: #fff;
        color: #122;
        padding: 28px 32px;
        font-family: "Plus Jakarta Sans", "Tajawal", sans-serif;
      }

      .print-sheet h1 {
        margin: 0 0 4px;
        font-size: 1.4rem;
      }

      .print-sheet .meta {
        color: #555;
        font-size: 0.85rem;
        margin-bottom: 18px;
      }

      .print-sheet table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.86rem;
      }

      .print-sheet th,
      .print-sheet td {
        border: 1px solid #ccd;
        padding: 8px 10px;
        text-align: center;
      }

      .print-sheet th {
        background: #eef3f8;
      }

      .print-sheet .winner-cell {
        background: #d4f5e8;
        font-weight: 800;
      }

      .print-sheet .ai-warnings {
        background: #fff8e8;
        border: 1px solid #e8c547;
        color: #5a4208;
        padding: 12px 14px;
        border-radius: 10px;
        margin-bottom: 14px;
      }
      .print-sheet .ai-market {
        border: 1px dashed #0d7a6f;
        padding: 12px 14px;
        border-radius: 10px;
        margin-bottom: 14px;
      }
      .print-sheet .legend {
        margin-top: 10px;
        font-size: 0.78rem;
        color: #555;
      }

      .print-sheet .report-hero {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 16px;
        padding-bottom: 16px;
        margin-bottom: 18px;
        border-bottom: 3px solid #0d7a6f;
      }
      .print-sheet .report-hero h1 {
        font-family: Fraunces, "Tajawal", serif;
        font-size: 1.85rem;
        margin: 0;
        color: #065a52;
      }
      .print-sheet .report-hero .meta {
        margin: 0;
        text-align: end;
      }
      .print-sheet .ai-report {
        margin-top: 22px;
        page-break-inside: avoid;
      }
      .print-sheet .ai-report__winner {
        background: linear-gradient(135deg, #065a52, #1aa896);
        color: #fff;
        padding: 22px 24px;
        border-radius: 16px;
        margin-bottom: 16px;
      }
      .print-sheet .ai-report__winner .k {
        display: block;
        font-size: 0.75rem;
        letter-spacing: 0.08em;
        font-weight: 800;
        opacity: 0.85;
      }
      .print-sheet .ai-report__winner strong {
        display: block;
        font-family: Fraunces, "Tajawal", serif;
        font-size: 1.8rem;
        margin-top: 4px;
      }
      .print-sheet .ai-report__winner p {
        margin: 8px 0 0;
      }
      .print-sheet .ai-report__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 14px 0;
      }
      .print-sheet .ai-report__grid article {
        border: 1px solid #d5cbb8;
        border-radius: 12px;
        padding: 12px 14px;
      }
      .print-sheet .ai-report__grid h4 {
        margin: 0 0 8px;
        color: #065a52;
      }
      .print-sheet .ai-report__rec {
        border: 1px dashed #0d7a6f;
        border-radius: 12px;
        padding: 14px 16px;
        background: #d4f5e8;
      }
      .print-sheet .ai-report__rec h4 {
        margin: 0 0 6px;
        color: #065a52;
      }
      .print-sheet .ai-report__summary {
        line-height: 1.6;
      }
      .print-sheet .ai-score {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #eee;
      }
      .print-sheet .ai-score .track {
        grid-column: 1 / -1;
        height: 8px;
        border-radius: 99px;
        background: #eee;
        overflow: hidden;
      }
      .print-sheet .ai-score .track i {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #065a52, #1aa896);
      }

      .btn-ai {
        flex: 1 1 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 16px;
        font-family: inherit;
        font-size: 1.05rem;
        font-weight: 800;
        color: #fff;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        background: linear-gradient(
          135deg,
          var(--accent-deep),
          var(--accent-glow)
        );
        box-shadow: 0 8px 20px var(--submit-shadow);
      }
      .btn-ai:hover:not(:disabled) {
        transform: translateY(-1px);
      }
      .btn-ai:disabled {
        opacity: 0.55;
        cursor: not-allowed;
      }
      .btn-ai .pro-chip {
        background: #e8c547;
        color: #1a1404;
      }
      .ai-compare {
        margin-top: 18px;
        padding: 16px;
        border-radius: 16px;
        border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
        background: color-mix(in srgb, var(--result-bg) 55%, var(--paper));
      }
      .ai-compare__head {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
      }
      .ai-compare__head h3 {
        margin: 0;
        font-family: Fraunces, "Tajawal", serif;
        font-size: 1.2rem;
      }
      .ai-compare__placeholder {
        margin: 0;
        color: var(--heading-muted);
        font-weight: 600;
        line-height: 1.5;
      }
      .ai-report__winner {
        padding: 16px 18px;
        border-radius: 14px;
        background: linear-gradient(
          135deg,
          var(--accent-deep),
          var(--accent-glow)
        );
        color: #fff;
        margin-bottom: 14px;
      }
      .ai-report__winner .k {
        display: block;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        opacity: 0.85;
      }
      .ai-report__winner strong {
        display: block;
        margin-top: 4px;
        font-family: Fraunces, "Tajawal", serif;
        font-size: 1.7rem;
        line-height: 1.15;
      }
      .ai-report__winner p {
        margin: 8px 0 0;
        font-size: 0.98rem;
        line-height: 1.45;
      }
      .ai-report__scores {
        display: grid;
        gap: 8px;
        margin-bottom: 14px;
      }
      .ai-score {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 10px;
        align-items: center;
      }
      .ai-score span {
        font-weight: 700;
      }
      .ai-score b {
        font-family: Fraunces, "Tajawal", serif;
        font-size: 1.15rem;
        color: var(--result);
      }
      .ai-score .track {
        grid-column: 1 / -1;
        height: 8px;
        border-radius: 99px;
        background: var(--mist);
        overflow: hidden;
      }
      .ai-score .track i {
        display: block;
        height: 100%;
        background: linear-gradient(
          90deg,
          var(--accent-deep),
          var(--accent-glow)
        );
      }
      .ai-report__summary {
        margin: 0 0 14px;
        line-height: 1.6;
        font-size: 1.02rem;
      }
      .ai-report__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
      }
      .ai-report__grid article {
        padding: 12px;
        border-radius: 12px;
        background: var(--paper);
        border: 1px solid var(--line);
      }
      .ai-report__grid h4 {
        margin: 0 0 8px;
        font-size: 0.92rem;
      }
      .ai-report__grid ul {
        margin: 0;
        padding-inline-start: 1.1em;
        line-height: 1.45;
      }
      .ai-report__rec {
        padding: 14px 16px;
        border-radius: 12px;
        background: var(--paper);
        border: 1px dashed var(--accent);
      }
      .ai-report__rec h4 {
        margin: 0 0 6px;
        color: var(--result);
      }
      .ai-report__rec p {
        margin: 0;
        line-height: 1.55;
      }

      @media (max-width: 720px) {
        .finder-cards,
        .map-tools,
        .pay-row {
          grid-template-columns: 1fr;
        }
        .ai-report__grid {
          grid-template-columns: 1fr;
        }
      }
