/* ==========================================================================
   loancalc.qtool.io — shared stylesheet
   Light bg #f4f6f8 / dark bg #0b1220 (kept consistent with the other sites)
   ========================================================================== */

:root {
  --bg: #f4f6f8;
  --bg-soft: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #16202e;
  --text-strong: #0b1523;
  --muted: #5b6675;
  --border: #e4e9f0;
  --border-strong: #d2dae5;
  --brand: #1256c9;
  --brand-dark: #0d429e;
  --brand-soft: #e9f0fd;
  --good: #0b8f61;
  --good-soft: #e4f4ec;
  --warn: #c2740a;
  --bad: #cf3f45;
  --ring: rgba(18, 86, 201, .38);
  --shadow: 0 1px 2px rgba(13, 26, 48, .05), 0 10px 28px -14px rgba(13, 26, 48, .22);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --panel: #121b2c;
    --panel-2: #1a2438;
    --text: #dbe3ee;
    --text-strong: #f2f6fb;
    --muted: #93a1b8;
    --border: #24314a;
    --border-strong: #33415a;
    --brand: #5b9bf5;
    --brand-dark: #86b7ff;
    --brand-soft: #16233d;
    --good: #34c88f;
    --good-soft: #10291e;
    --warn: #e0a23c;
    --bad: #ef6b70;
    --ring: rgba(91, 155, 245, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px -14px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* keyboard focus + text selection pick up the brand hue */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--brand); color: #fff; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--text-strong); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--text-strong);
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  flex: 0 0 auto;
  display: block;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text-strong); background: var(--bg-soft); text-decoration: none; }

.country-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--muted);
}
.country-picker select {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}

/* ---------- language switcher (inline, in the footer) ---------- */
.footer-right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.lang-switch { position: relative; display: inline-flex; align-items: center; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-globe { width: 13px; height: 13px; flex: 0 0 auto; }
.lang-panel {
  position: absolute; right: 0; bottom: calc(100% + 8px); display: none; text-align: left;
  min-width: 172px; max-height: 280px; overflow-y: auto; padding: 5px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.lang-panel.show { display: block; }
.lang-panel::-webkit-scrollbar { width: 6px; }
.lang-panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.lang-panel::-webkit-scrollbar-track { background: transparent; }
.lang-opt {
  display: flex; width: 100%; justify-content: space-between; gap: 10px;
  font: inherit; font-size: .86rem; color: var(--text); text-align: left; cursor: pointer;
  background: none; border: 0; border-radius: 6px; padding: 7px 10px;
}
.lang-opt:hover { background: var(--bg-soft); }
.lang-opt.is-on { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.lang-opt[disabled] { color: var(--muted); opacity: .55; cursor: not-allowed; background: none; }
.lang-soon { font-size: .68rem; color: var(--muted); align-self: center; }
@media print { .lang-switch { display: none !important; } }

.cc { position: relative; }
.cc-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: .88rem; color: var(--text); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 5px 10px;
}
.cc-btn:hover { border-color: var(--brand); }
.cc-caret { width: 11px; height: 11px; flex: 0 0 auto; opacity: .55; }
.cc-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 90;
  min-width: 250px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 4px;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.cc-panel.show { display: block; }
.cc-panel::-webkit-scrollbar { width: 6px; }
.cc-panel::-webkit-scrollbar-track { background: transparent; }
.cc-panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.cc-panel::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.cc-opt {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  font: inherit; font-size: .88rem; color: var(--text); cursor: pointer;
  background: none; border: 0; border-radius: 6px; padding: 7px 9px;
}
.cc-opt:hover { background: var(--bg-soft); }
.cc-opt.is-on { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.cc-group {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 9px 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--panel);
}
.cc-group:first-child { padding-top: 5px; }

/* ---------- layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.hero { padding: 34px 0 6px; }
.hero h1 { font-size: 2.25rem; }
.hero .lede { font-size: 1.12rem; }

/* ---------- tool grid (home) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 22px 0 10px;
  padding: 0;
  list-style: none;
}

/* category strip + related block */
.cat-strip { font-size: .92rem; color: var(--muted); margin: 6px 0 0; }
.cat-strip a { font-weight: 600; }
.prose.related { margin-top: 34px; max-width: none; }
.prose.sources { margin-top: 30px; max-width: 76ch; }
.prose.sources h2 { font-size: 1.1rem; }
.prose.sources ul { font-size: .92rem; }
.prose.sources p { font-size: .85rem; color: var(--muted); }
.example-box {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem;
}
.example-box b { color: var(--text-strong); }
.prose.related h2 { border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.prose.related .grid { margin-top: 16px; }
.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  transition: transform .12s ease, border-color .12s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.tool-card .tc-title { font-weight: 700; color: var(--text-strong); font-size: 1.02rem; }
.tool-card .tc-head { display: flex; align-items: center; gap: 9px; }
.tool-card .tc-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.tool-card .tc-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-cat { margin-top: 26px; }
.home-cat h2 { font-size: 1.2rem; margin: 0 0 2px; }
.home-cat h2 a { color: var(--text-strong); }
.home-cat h2 a:hover { color: var(--brand); text-decoration: none; }
.home-cat .grid { margin-top: 12px; }
[id] { scroll-margin-top: 84px; }
.tool-card .tc-desc { color: var(--muted); font-size: .92rem; }
.tool-card .tc-tag {
  align-self: flex-start;
  margin-top: auto;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ---------- calculator layout ---------- */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}
@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: var(--text-strong); }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.input-wrap { display: flex; align-items: stretch; }
.input-wrap .prefix, .input-wrap .suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: .9rem;
}
.input-wrap .prefix { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-wrap .suffix { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-wrap input, .field input[type="number"], .field input[type="text"], .field select {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}
.input-wrap input { border-radius: 0; }
.input-wrap input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-wrap input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-wrap input:only-child { border-radius: var(--radius-sm); }
.field input:focus, .field select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-row .range-val { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- results ---------- */
.result-sticky { position: sticky; top: 78px; }
.result-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.result-hero {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--good);
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
}
.result-hero .rh-label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-bottom: 2px; }
.result-rows { margin: 14px 0 0; border-top: 1px solid var(--border); padding-top: 12px; }
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: .95rem;
}
.result-row .rr-label { color: var(--muted); }
.result-row .rr-val { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.result-row.is-total { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px; font-size: 1.02rem; }

.badge-good { color: var(--good); }
.badge-bad { color: var(--bad); }
.pill { display:inline-block; font-size:.76rem; font-weight:700; padding:2px 9px; border-radius:999px; }
.pill-good { color: var(--good); background: var(--good-soft); }
.pill-bad { color: var(--bad); background: #fdeaea; }

.bar-track { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 10px; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--good)); }

.note {
  margin-top: 14px;
  font-size: .84rem;
  color: var(--muted);
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  padding: 9px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- content / prose ---------- */
.prose { margin-top: 30px; max-width: 76ch; }
/* two-end (justified) body copy — hyphenation keeps the river gaps away */
.lede, .prose p, .prose li { text-align: justify; text-justify: inter-word; hyphens: auto; }
/* tables inside article prose: wrap cells so they never overflow the column */
.prose table { width: 100%; }
.prose table th, .prose table td { white-space: normal; overflow-wrap: anywhere; text-align: left; vertical-align: top; }
.prose h2 { border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
}
details.faq {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
details.faq summary { font-weight: 600; cursor: pointer; color: var(--text-strong); }
details.faq[open] summary { margin-bottom: 8px; }
details.faq p:last-child { margin-bottom: 0; }

.privacy-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 10px;
}
.privacy-line::before { content: "\2714"; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--text-strong); }
.checkbox-line input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------- English date / month pickers ---------- */
.date-fields { display: flex; gap: 6px; flex-wrap: wrap; }
.date-fields select {
  font: inherit; font-size: .9rem; padding: 7px 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text);
}
.date-fields .df-day { flex: 0 0 74px; }
.date-fields .df-month { flex: 0 0 96px; }
.date-fields .df-year { flex: 0 0 96px; }
.date-fields select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.disclaimer {
  margin-top: 30px;
  font-size: .84rem;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px;
  color: var(--muted);
  font-size: .9rem;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-cols h4 { color: var(--text-strong); font-size: .9rem; margin: 0 0 8px; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin: 5px 0; }
.footer-bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .84rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- charts (LCChart) ---------- */
.chart-card { margin-top: 16px; }
.chart-card h4 { margin: 0 0 10px; font-size: .92rem; color: var(--text-strong); }
.chart-empty { color: var(--muted); font-size: .85rem; margin: 6px 0; }

.lc-chart-wrap { display: flex; gap: 14px; align-items: center; }
.lc-canvas-box { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; }
.lc-canvas-box canvas { display: block; max-width: 100%; }
.lc-chart-wrap.is-donut .lc-canvas-box { flex: 0 0 148px; width: 148px; }
.lc-chart-wrap:not(.is-donut) .lc-canvas-box.has-legend { flex: 0 0 58%; }
.lc-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.lc-donut-center b { font-size: 1.02rem; color: var(--text-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.lc-donut-center span { font-size: .7rem; color: var(--muted); }
.lc-spark { height: 46px; }
@media (max-width: 520px) {
  .lc-chart-wrap { flex-direction: column; align-items: stretch; }
  .lc-chart-wrap.is-donut .lc-canvas-box { width: 150px; flex-basis: 150px; margin: 0 auto; }
  .lc-chart-wrap:not(.is-donut) .lc-canvas-box.has-legend { flex: 1 1 auto; }
}

.lc-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.lc-legend li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
  padding: 4px 0; font-size: .86rem;
  border-bottom: 1px solid var(--border);
}
.lc-legend li:last-child { border-bottom: 0; }
.lc-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.lc-lg-label { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.lc-lg-val { margin-left: auto; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* result hero pill row */
.hero-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* ---------- visual polish ---------- */
.card { background: linear-gradient(180deg, var(--panel), var(--panel-2)); }

.tool-card { background: linear-gradient(180deg, var(--panel), var(--panel-2)); position: relative; overflow: hidden; }
.tool-card::before {
  content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--good));
  opacity: 0; transition: opacity .16s ease;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover { box-shadow: 0 12px 30px rgba(16, 30, 54, .14); border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .tool-card:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, .5); } }

.result-card { position: relative; overflow: hidden; }
.result-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--good));
}
.result-hero { transition: color .2s ease; }
.num-pop { animation: numpop .45s ease; }
@keyframes numpop {
  0% { transform: translateY(3px); opacity: .45; }
  100% { transform: none; opacity: 1; }
}

/* ---------- hero (home) ---------- */
.hero-2col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; }
@media (max-width: 880px) { .hero-2col { grid-template-columns: 1fr; gap: 22px; } }
.stat-band { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; margin: 20px 0 0; padding: 0; }
.stat-band li { display: flex; flex-direction: column; }
.stat-band b { font-size: 1.5rem; color: var(--text-strong); letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-band span { font-size: .8rem; color: var(--muted); }

.preview-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(16, 30, 54, .12); padding: 18px;
}
@media (prefers-color-scheme: dark) { .preview-card { box-shadow: 0 12px 36px rgba(0, 0, 0, .5); } }
.preview-card .pc-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.preview-card .pc-hero { font-size: 1.9rem; font-weight: 800; color: var(--good); letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.preview-card .pc-sub { font-size: .85rem; color: var(--muted); }
.preview-card .pc-chart { margin: 12px 0 2px; }
.preview-card .pc-rows { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.preview-card .pc-rows div { display: flex; justify-content: space-between; font-size: .85rem; padding: 3px 0; }
.preview-card .pc-rows b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.preview-card .pc-select { display: flex; gap: 6px; margin-top: 4px; }
.preview-card .pc-select button {
  flex: 1; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  padding: 5px 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--muted);
}
.preview-card .pc-select button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- detail block: prose left, charts right (top-aligned) ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 26px 34px;
  align-items: start;
  margin-top: 26px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; gap: 18px; } }

.detail-main .prose { max-width: none; margin-top: 0; }
.detail-main .prose + .prose { margin-top: 28px; }

.detail-side .chart-card { margin-top: 0; }
.detail-side .chart-card + .chart-card { margin-top: 16px; }

/* ---------- amortisation schedule ---------- */
.sched-card { margin-top: 26px; }
.sched-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sched-head h4 { margin: 0; font-size: .95rem; color: var(--text-strong); }
.btn-ghost {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.sched-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.sched-scroll { max-height: 440px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.sched { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
table.sched th, table.sched td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.sched th:first-child, table.sched td:first-child,
table.sched th:nth-child(2), table.sched td:nth-child(2) { text-align: left; }
table.sched thead th { position: sticky; top: 0; background: var(--panel-2); color: var(--text-strong); z-index: 1; }
table.sched tbody tr:nth-child(even) { background: var(--bg-soft); }
table.sched tbody tr:last-child td { border-bottom: 0; font-weight: 700; }

/* ---------- consent banner ---------- */
.btn-primary {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: 6px 14px; border: 1px solid var(--brand); border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--panel); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(16, 30, 54, .10);
  transform: translateY(110%); transition: transform .25s ease;
}
.cookie-bar.show { transform: none; }
.cookie-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: .86rem; color: var(--muted); max-width: 72ch; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- action row (share / copy / print) ---------- */
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- generic data / comparison table ---------- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.cmp-table th, .cmp-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; color: var(--muted); white-space: normal; }
.cmp-table thead th { color: var(--text-strong); }
.cmp-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.cmp-table tbody tr.is-best td { color: var(--good); font-weight: 700; }

.rate-tag { display: block; font-size: .7rem; color: var(--muted); font-weight: 400; }

/* inline notice banner */
.notice-warn {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn);
  background: #fff7ea;
  color: #7a4b06;
  font-size: .88rem;
}
@media (prefers-color-scheme: dark) { .notice-warn { background: #2a2113; color: #f0c078; border-color: #6b4d1c; } }

/* ---------- sticky-rail layout (tool pages) ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
.layout-side { position: sticky; top: 84px; align-self: start; }
.layout-side > * + * { margin-top: 16px; }
.layout-side.rail-static { position: static; }
@media (max-width: 900px) { .layout-side { position: static; } }
.layout-main { min-width: 0; }
.layout-main > * + * { margin-top: 20px; }
.layout-main > .prose { margin-top: 24px; }
.layout-side .result-card { margin: 0; }

.layout-main .chart-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}
.layout-main .chart-band .chart-card { margin-top: 0; }

/* ---------- comparison grid ---------- */
.cmp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-col { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--panel-2); }
.cmp-col h4 { margin: 0 0 10px; font-size: .9rem; color: var(--text-strong); }
.cmp-col .field { margin-bottom: 10px; }

/* ---------- article list ---------- */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.article-list li:last-child { border-bottom: 0; }
.article-list a { font-weight: 700; font-size: 1.05rem; color: var(--text-strong); display: block; margin-bottom: 4px; }
.article-list a:hover { color: var(--brand); text-decoration: none; }
.article-list span { color: var(--muted); font-size: .92rem; }

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .cookie-bar, .privacy-line, .detail-side,
  .btn-ghost, .btn-primary, .actions-row, .chart-card { display: none !important; }
  .sched-scroll { max-height: none; overflow: visible; border: 0; }
  html, body { background: #fff; }
  .container { padding: 0; }
  .calc { grid-template-columns: 1fr; }
  .result-sticky { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
}




