    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0f1117;
      --surface: #1a1d27;
      --surface2: #22263a;
      --border: #2e3350;
      --accent: #4f8ef7;
      --accent2: #f7914f;
      --purple: #a78bfa;
      --green: #3ecf8e;
      --red: #f76b6b;
      --text: #e8eaf0;
      --muted: #8b90a8;
      --label: #c4c8d8;
      --header: #f0f1f5;
      --radius: 10px;
      --nav-width: 210px;
    }

    body.light {
      --bg: #f0f2f5;
      --surface: #ffffff;
      --surface2: #f3f4f6;
      --border: #e5e7eb;
      --text: #111827;
      --muted: #9ca3af;
      --label: #374151;
      --header: #111827;
      --green: #30bd8e;
    }

    body.light .sidebar { border-right-color: #e5e7eb; }
    body.light .sidebar-logo { border-bottom-color: #e5e7eb; }
    body.light input[type="month"] { color-scheme: light !important; }
    body.light select.styled { background: #f3f4f6; color: #111827; border-color: #e5e7eb; }
    body.light .input-wrap { background: #f3f4f6; border-color: #e5e7eb; }
    body.light .input-wrap input { color: #111827; }
    body.light .btn { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
    body.light .btn.active { background: var(--accent); color: #fff; }
    body.light .tab.active { background: #f0f2f5; border-color: #e5e7eb; border-bottom-color: #f0f2f5; }
    body.light .year-row { background: rgba(79,142,247,0.07); }
    body.light .year-row td { color: var(--accent); }

    #theme-toggle {
      margin-left: auto;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 5px 12px;
      cursor: pointer;
      font-size: 12px;
      color: var(--label);
      font-weight: 500;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    #theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      font-size: 14px;
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
    }

    /* ── Sidebar ── */
    .sidebar {
      width: var(--nav-width);
      flex-shrink: 0;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 10;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: var(--border) transparent;
    }
    .sidebar::-webkit-scrollbar { width: 4px; }
    .sidebar::-webkit-scrollbar-track { background: transparent; }
    .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

    .sidebar-logo {
      padding: 20px 18px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .sidebar-logo svg { flex-shrink: 0; }
    .sidebar-logo span { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

    .nav-section { padding: 18px 10px 6px; }
    .nav-section-label {
      font-size: 10px;
      font-weight: 700;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 0 8px;
      margin-bottom: 4px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 7px;
      cursor: pointer;
      color: var(--label);
      font-size: 13px;
      font-weight: 500;
      transition: all 0.15s;
      text-decoration: none;
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
    }

    .nav-item:hover { color: var(--text); background: var(--surface2); }
    .nav-item.active { color: var(--accent); background: rgba(79,142,247,0.1); }
    .nav-item svg { flex-shrink: 0; }

    /* ── Main ── */
    .main {
      margin-left: var(--nav-width);
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .page { display: none; flex-direction: column; flex: 1; }
    .page.active { display: flex; }

    /* ── Shared header ── */
    .page-header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 0 24px;
      min-height: 72px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-header svg { color: var(--accent); }
    .page-header h1 { font-size: 17px; font-weight: 600; color: var(--header); }

    .tabs {
      display: flex;
      gap: 4px;
      padding: 14px 24px 0;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
    }

    .tab {
      padding: 7px 16px;
      border-radius: var(--radius) var(--radius) 0 0;
      cursor: pointer;
      color: var(--muted);
      font-weight: 500;
      font-size: 13px;
      transition: all 0.15s;
      border: 1px solid transparent;
      border-bottom: none;
      background: transparent;
    }

    .tab:hover { color: var(--text); }
    .tab.active { color: var(--accent); background: var(--bg); border-color: var(--border); border-bottom-color: var(--bg); }

    .view { display: none; padding: 20px 24px; }
    .view.active { display: block; }

    /* ── Shared layout ── */
    .layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }

    .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 11px; letter-spacing: 0.05em; color: var(--label); text-transform: uppercase; }
    .panel-body { padding: 16px; }

    /* ── Form elements ── */
    .field { margin-bottom: 14px; }
    .field label { display: block; font-size: 11px; font-weight: 600; color: var(--label); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }

    .input-wrap { display: flex; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: border-color 0.15s; }
    .input-wrap:focus-within { border-color: var(--accent); }

    .input-prefix, .input-suffix { padding: 8px 10px; color: var(--muted); font-size: 13px; background: var(--bg); user-select: none; }

    .input-wrap input {
      flex: 1; border: none; background: transparent; color: var(--text);
      font-size: 14px; padding: 8px 10px; outline: none; min-width: 0; width: 100%;
    }
    .input-wrap input[type="month"] { min-width: 0; }
    .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }

    .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .field-row > * { min-width: 0; }

    .section-label { font-size: 10px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: 0.07em; margin: 18px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }

    select.styled { width: 100%; height: 36px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 0 10px; font-size: 13px; outline: none; cursor: pointer; }

    /* ── Stats ── */
    .stat-grid { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .stat-row { display: grid; gap: 1px; background: var(--border); }
    .stat-row-2 { grid-template-columns: 1fr 1fr; }
    .stat-row-3 { grid-template-columns: 1fr 1fr 1fr; }
    .stat { padding: 14px 16px; background: var(--surface); }
    .stat-label { font-size: 10px; color: var(--label); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
    .stat-value { font-size: 20px; font-weight: 700; }
    .stat-value.accent { color: var(--accent); }
    .stat-value.green { color: var(--green); }
    .stat-value.red { color: var(--red); }
    .stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

    /* ── Donut chart ── */
    .chart-wrap { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
    .donut-svg { width: 110px; height: 110px; transform: rotate(-90deg); flex-shrink: 0; }
    .donut-bg { fill: none; stroke: var(--surface2); stroke-width: 18; }
    .donut-ring { fill: none; stroke-width: 18; stroke-linecap: round; }

    .legend { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
    .legend-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 7px; border-left: 3px solid transparent; }
    .legend-item.principal { border-left-color: var(--accent); }
    .legend-item.interest   { border-left-color: var(--red); }
    .legend-item.saved      { border-left-color: var(--green); }
    .legend-item.payoff     { border-left-color: var(--purple); }
    .legend-item-body { flex: 1; min-width: 0; }
    .legend-value { font-size: 16px; font-weight: 700; line-height: 1.2; }
    .legend-label { font-size: 10px; color: var(--muted); margin-top: 1px; text-transform: uppercase; letter-spacing: 0.04em; }
    .legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

    /* ── Balance chart ── */
    .balance-chart { width: 100%; height: 160px; margin-top: 16px; }

    /* ── Slider ── */
    .slider-block { margin-top: 18px; }
    .slider-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
    .slider-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
    .slider-value { font-size: 14px; font-weight: 700; }
    .slider-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; }

    input[type="range"] { width: 100%; cursor: pointer; }

    /* ── Amortization table ── */
    .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
    table { width: 100%; border-collapse: collapse; font-size: 13px; }
    thead th { background: var(--surface2); padding: 9px 12px; text-align: right; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; border-bottom: 1px solid var(--border); }
    thead th:first-child { text-align: left; }
    tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
    tbody tr:last-child { border-bottom: none; }
    tbody tr:hover { background: var(--surface2); }
    .year-row { background: rgba(79,142,247,0.05); }
    .year-row td { font-weight: 600; color: var(--accent); }
    tbody td { padding: 8px 12px; text-align: right; }
    tbody td:first-child { text-align: left; color: var(--muted); }
    .neg { color: var(--red); }

    .table-controls { display: flex; gap: 8px; margin-bottom: 12px; }
    .btn { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.15s; }
    .btn:hover { border-color: var(--accent); color: var(--accent); }
    .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
    .btn-add { width: 100%; margin-top: 4px; text-align: center; }

    /* ── Compare (shared) ── */
    .compare-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .scenario-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
    .badge-a { background: rgba(79,142,247,0.15); color: var(--accent); }
    .badge-b { background: rgba(247,145,79,0.15); color: var(--accent2); }
    .compare-stat-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
    .compare-stat { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--surface2); border-radius: 6px; border: 1px solid var(--border); }
    .compare-stat-label { font-size: 12px; color: var(--muted); }
    .compare-stat-val { font-weight: 700; font-size: 14px; }
    .winner { color: var(--green); }
    .loser  { color: var(--red); }
    .compare-diff { margin-top: 18px; padding: 16px; background: var(--surface2); border-radius: var(--radius); border: 1px solid var(--border); }
    .compare-diff h3 { font-size: 13px; margin-bottom: 10px; }
    .diff-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
    .diff-item:last-child { border-bottom: none; }
    .diff-item .label { color: var(--muted); }

    @media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .compare-layout { grid-template-columns: 1fr; } .two-col-grid { grid-template-columns: 1fr; } }

    /* Hide mobile-only elements on desktop */
    .mobile-tab-bar,
    .mobile-drawer-backdrop,
    .mobile-drawer { display: none; }

    /* ═══════════════════════════════════════════
       MOBILE  (≤ 768px)  — Bottom Tab Bar Layout
       ═══════════════════════════════════════════ */
    @media (max-width: 768px) {
      /* Hide desktop sidebar */
      .sidebar { display: none; }

      /* Main takes full width; leave room for tab bar */
      .main { margin-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

      /* Theme toggle: fixed top-right */
      #theme-toggle {
        position: fixed;
        top: 10px; right: 10px;
        z-index: 150;
        font-size: 11px;
        padding: 4px 10px;
      }

      /* Page header */
      .page-header { padding: 10px 14px 0; min-height: 56px; }
      .page-header h1 { font-size: 15px; }

      /* Tabs bar */
      .tabs { padding: 10px 12px 0; gap: 2px; overflow-x: auto; scrollbar-width: none; }
      .tabs::-webkit-scrollbar { display: none; }
      .tab { white-space: nowrap; padding: 6px 13px; font-size: 12px; }

      /* Content padding */
      .view { padding: 14px 12px; }

      /* Force single-column layouts */
      .layout { grid-template-columns: 1fr !important; }
      .compare-layout { grid-template-columns: 1fr !important; }

      /* Touch-friendly form elements */
      .input-wrap input { font-size: 16px; padding: 10px 12px; }
      .input-prefix, .input-suffix { padding: 10px 12px; }
      select.styled { height: 44px; font-size: 16px; }
      .btn { padding: 9px 16px; font-size: 13px; }

      /* ── Bottom Tab Bar ── */
      .mobile-tab-bar {
        display: flex;
        align-items: center;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        z-index: 200;
        min-height: 60px;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
      }
      .mobile-tab-btn {
        flex: 1;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--muted);
        font-size: 9px;
        font-weight: 600;
        letter-spacing: 0.02em;
        padding: 6px 2px 0;
        transition: color 0.15s;
        -webkit-tap-highlight-color: transparent;
        text-transform: uppercase;
      }
      .mobile-tab-btn.active { color: var(--accent); }
      .mobile-tab-btn svg { flex-shrink: 0; }

      /* ── Drawer backdrop ── */
      .mobile-drawer-backdrop {
        display: none; /* shown only via .open */
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 300;
        backdrop-filter: blur(2px);
      }
      .mobile-drawer-backdrop.open { display: block; }

      /* ── Bottom drawer sheet ── */
      .mobile-drawer {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--surface);
        border-radius: 16px 16px 0 0;
        border-top: 1px solid var(--border);
        z-index: 301;
        transform: translateY(100%);
        transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        max-height: 80vh;
        overflow-y: auto;
        pointer-events: none;
      }
      .mobile-drawer.open { transform: translateY(0); pointer-events: auto; }
      .mobile-drawer-handle {
        width: 36px; height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 12px auto 0;
      }
      .mobile-drawer-title {
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.07em;
        padding: 10px 20px 6px;
      }
      .mobile-drawer-items {
        padding: 4px 10px 20px;
        display: flex;
        flex-direction: column;
        gap: 2px;
      }
      .mobile-drawer-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 13px 14px;
        border-radius: 9px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--label);
        font-size: 15px;
        font-weight: 500;
        width: 100%;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.1s;
      }
      .mobile-drawer-item:active { background: var(--surface2); }
      .mobile-drawer-item.active { color: var(--accent); background: rgba(79,142,247,0.1); }
    }

/* ═══════════════════════════════════════════════════════
   STANDALONE PAGE LAYOUT  (individual calculator pages)
   ═══════════════════════════════════════════════════════ */

body.standalone {
  display: flex;
  min-height: 100vh;
}

/* On standalone pages .main doesn't need to be a flex column —
   block layout stacks children naturally and avoids flex edge cases */
body.standalone .main {
  display: block;
}

/* ── Site Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.site-logo img { width: 26px; height: 26px; object-fit: contain; }

.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.site-nav a {
  padding: 5px 11px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface2); }
.site-nav a.active { color: var(--accent); background: rgba(79,142,247,0.1); }

.site-header #theme-toggle { margin-left: auto; position: static; }

/* ── Standalone: page-header text group ── */
.page-header-text {
  flex: 1;
  min-width: 0;
}
.page-header-text h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--header);
  line-height: 1.2;
}
.calc-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Standalone: seo/related content padding ── */
.seo-wrap {
  padding: 0 24px 60px;
}
/* Fallback: seo-content/related-calcs directly in .main also get padding */
.main > .seo-content,
.main > .related-calcs {
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 40px;
}

/* Standalone views: active = visible, inactive = hidden */
body.standalone .view.active { display: block; }
/* Pages with only one view (no tabs): show the single view */
body.standalone .view:only-of-type { display: block; }

/* ── Ad unit placeholders ── */
.ad-leaderboard {
  width: 100%;
  min-height: 90px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
}
.ad-rectangle {
  width: 100%;
  min-height: 250px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 20px;
}

/* ── SEO content section ── */
.seo-content {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.seo-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--header);
  margin: 28px 0 10px;
}
.seo-content h2:first-child { margin-top: 0; }
.seo-content p {
  color: var(--label);
  line-height: 1.7;
  font-size: 14px;
  max-width: 780px;
  margin-bottom: 12px;
}
.seo-content ul, .seo-content ol {
  color: var(--label);
  font-size: 14px;
  line-height: 1.7;
  padding-left: 22px;
  max-width: 780px;
  margin-bottom: 14px;
}
.seo-content li { margin-bottom: 4px; }

.faq-list { list-style: none; padding: 0; max-width: 780px; }
.faq-item { margin-bottom: 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-q { font-weight: 700; color: var(--header); font-size: 14px; margin-bottom: 6px; }
.faq-a { color: var(--label); font-size: 13px; line-height: 1.65; }

/* ── Related calculators ── */
.related-calcs {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.related-calcs h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--header);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: var(--muted);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.related-card {
  display: block;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--label);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.related-card:hover { border-color: var(--accent); color: var(--accent); }
.related-card-cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ── Site footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Two-column grid used in compare views (stacks on mobile) ── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Standalone mobile (sidebar already hidden by main mobile block above) ── */
@media (max-width: 768px) {
  .seo-wrap { padding: 0 12px 40px; }
  .related-grid { grid-template-columns: 1fr 1fr; }

  /* Prevent panels from causing horizontal scroll */
  body.standalone .main { overflow-x: hidden; }
  .panel { max-width: 100%; min-width: 0; }
  .view { overflow-x: hidden; }

  /* Grid children must opt-in to shrinking below content size */
  .layout > * { min-width: 0; max-width: 100%; }
  .layout { overflow: hidden; }

  /* Stat grids: 3-col → 1-col on mobile to prevent overflow */
  .stat-row-3 { grid-template-columns: 1fr !important; }
  .stat-row-2 { grid-template-columns: 1fr 1fr !important; }

  /* Stat cells: allow shrinking, clip long text */
  .stat { min-width: 0; }
  .stat-value { font-size: 17px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

  /* Loan period date row: stack vertically on mobile */
  .stat-date-row { flex-direction: column !important; align-items: flex-start !important; gap: 2px !important; }
  .stat-date-row > div { font-size: 15px !important; }

  /* Field rows: stack on mobile */
  .field-row { grid-template-columns: 1fr !important; }

  /* Chart wrap: stack donut + legend vertically */
  .chart-wrap { flex-direction: column; align-items: stretch; }
  .donut-svg { width: 90px; height: 90px; align-self: center; }
  .legend { grid-template-columns: 1fr 1fr; }

  /* Compare input grids: stack on mobile */
  .two-col-grid { grid-template-columns: 1fr !important; }

  /* Gas vs electric results grid */
  .ev-results-grid { grid-template-columns: 1fr !important; }
}
