  /* Page-specific styles — all colours and fonts come from the site's tokens in style.css */

  /* ---------- Page hero ---------- */
  .page-hero {
    position: relative; color: var(--white);
    padding: 4.5rem 0 4.5rem;
    background:
      linear-gradient(180deg, rgba(8,20,32,0.82) 0%, rgba(8,20,32,0.7) 60%, rgba(8,20,32,0.9) 100%),
      url("https://images.unsplash.com/photo-1622725859789-8e9ccf920693?q=80&w=1920&auto=format&fit=crop") center / cover;
  }
  .crumbs { font-size: 0.88rem; color: rgba(255,255,255,0.6); margin-bottom: 1.2rem; }
  .crumbs a { color: var(--gold-light); }
  .crumbs a:hover { text-decoration: underline; }
  .page-hero h1 {
    color: var(--white); font-size: clamp(2.3rem, 5vw, 3.7rem);
    line-height: 1.06; letter-spacing: -0.015em; max-width: 18ch;
  }
  .page-hero .hero-rule { margin: 1.5rem 0 1.3rem; }
  .page-hero p { max-width: 52ch; font-size: 1.1rem; color: rgba(255,255,255,0.84); }

  /* ---------- Calculator ---------- */
  .calc-section { background: var(--stone); padding: clamp(3rem, 6vw, 5rem) 0; }
  .calc-card {
    display: grid; grid-template-columns: 1.15fr 1fr;
    background: var(--white); border: 1px solid var(--border);
  }
  .calc-inputs { padding: clamp(1.8rem, 3.5vw, 2.8rem); }
  .calc-card h2 { font-size: 1.55rem; margin-bottom: 1.8rem; }

  .calc-field { margin-bottom: 2rem; }
  .calc-field-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
  .calc-field label { display: block; font-size: 0.92rem; font-weight: 600; color: var(--navy); }
  .calc-field .hint { font-size: 0.84rem; color: var(--gold); font-weight: 600; margin-top: 2px; min-height: 1.3em; }

  .num-box {
    display: flex; align-items: center; min-width: 180px;
    border: 1px solid var(--border); background: var(--white); padding: 0 0.9rem;
    transition: border-color 0.2s ease;
  }
  .num-box:focus-within { border-color: var(--gold); outline: 2px solid var(--gold); outline-offset: 2px; }
  .num-box .affix { color: var(--muted); font-weight: 600; }
  .num-box input {
    border: 0; outline: 0; background: transparent; width: 100%; text-align: right;
    font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--navy); padding: 0.6rem 0.4rem;
  }

  input[type=range] {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px;
    background: linear-gradient(to right, var(--navy) var(--fill, 0%), var(--stone-deep) var(--fill, 0%));
    outline: none; cursor: pointer; margin: 1rem 0 0.2rem;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; background: var(--gold);
    border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--navy), 0 2px 6px rgba(8,20,32,0.3);
  }
  input[type=range]::-moz-range-thumb { width: 16px; height: 16px; background: var(--gold); border: 3px solid var(--white); border-radius: 0; box-shadow: 0 0 0 1px var(--navy); }
  input[type=range]:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
  .range-ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }

  .seg { display: inline-flex; border: 1px solid var(--navy); }
  .seg button { background: var(--white); border: 0; padding: 0.55rem 1.1rem; font-size: 0.88rem; font-weight: 600; color: var(--navy); }
  .seg button + button { border-left: 1px solid var(--navy); }
  .seg button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

  /* Results panel */
  .calc-results {
    background: var(--navy); color: var(--white);
    padding: clamp(1.8rem, 3.5vw, 2.8rem); display: flex; flex-direction: column;
  }
  .calc-results h2 { color: var(--white); }
  .emi-label { font-size: 0.9rem; color: rgba(255,255,255,0.65); }
  .emi-value { font-family: var(--serif); font-size: clamp(2.4rem, 4.4vw, 3.3rem); font-weight: 600; line-height: 1.1; color: var(--gold-light); margin: 0.2rem 0; }
  .emi-sub { font-size: 0.86rem; color: rgba(255,255,255,0.55); margin-bottom: 1.8rem; }

  .donut-row { display: flex; align-items: center; gap: 1.8rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
  .donut { width: 160px; height: 160px; flex: none; }
  .donut circle { fill: none; stroke-width: 20; }
  .donut .t-interest { stroke: var(--gold); }
  .donut .t-principal { stroke: var(--white); transition: stroke-dasharray 0.4s ease; }
  .donut text { fill: var(--white); font-family: var(--sans); }
  .donut .pct { font-family: var(--serif); }

  .legend { display: grid; gap: 1.1rem; flex: 1; min-width: 180px; }
  .legend li { display: grid; grid-template-columns: 12px 1fr; column-gap: 0.7rem; }
  .legend .dot { width: 12px; height: 12px; margin-top: 6px; }
  .legend .l-name { font-size: 0.84rem; color: rgba(255,255,255,0.6); }
  .legend .l-val { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }

  .total-row {
    margin-top: auto; padding-top: 1.2rem; border-top: 1px solid var(--border-dark);
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  }
  .total-row .t-name { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
  .total-row .t-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
  .calc-results .btn { margin-top: 1.6rem; justify-content: center; }

  /* ---------- Schedule ---------- */
  .sched-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
  .sched-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.12; }
  .sched-head p { margin-top: 0.6rem; color: var(--muted); }
  .table-wrap { border: 1px solid var(--border); overflow: auto; max-height: 520px; background: var(--white); }
  table { width: 100%; border-collapse: collapse; min-width: 560px; }
  th, td { padding: 0.85rem 1.2rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
  th:first-child, td:first-child { text-align: left; }
  thead th { position: sticky; top: 0; background: var(--navy); color: var(--white); font-weight: 600; font-size: 0.86rem; z-index: 1; }
  tbody tr { border-bottom: 1px solid var(--border); }
  tbody tr:nth-child(even) { background: var(--stone); }
  tbody tr:hover { background: var(--gold-pale); }
  .notes { margin-top: 1.2rem; font-size: 0.86rem; color: var(--muted); max-width: 80ch; }

  /* ---------- CTA band ---------- */
  .cta-band { background: var(--navy-deep); color: var(--white); }
  .cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
  .cta-inner h2 { color: var(--white); font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; max-width: 22ch; }
  .cta-inner p { margin-top: 0.9rem; color: rgba(255,255,255,0.7); max-width: 54ch; }

  @media (max-width: 880px) {
    .calc-card { grid-template-columns: 1fr; }
  }
  @media (max-width: 520px) {
    .calc-field-top { flex-direction: column; align-items: stretch; }
    .num-box { min-width: 0; width: 100%; }
    .page-hero { padding-top: 3.5rem; }
  }

/* ---------- Appreciation calculator extras ---------- */
.calc-field[hidden] { display: none; }
.mode-row { margin-bottom: 2rem; }
.mode-row .seg { display: flex; width: 100%; }
.mode-row .seg button { flex: 1; padding: 0.7rem 0.6rem; }

.stats { display: grid; gap: 0; margin-bottom: 1.6rem; }
.stats li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.85rem 0; border-top: 1px solid var(--border-dark);
}
.stats .s-name { font-size: 0.9rem; color: rgba(255,255,255,0.65); }
.stats .s-val { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; text-align: right; }
.stats .s-val.gain { color: var(--gold-light); }

.chart-box { background: var(--white); border: 1px solid var(--border); padding: 1.4rem 1.2rem 0.6rem; }
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-box .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-box .axis-label { fill: var(--muted); font-family: var(--sans); font-size: 11px; }
.chart-box .area { fill: var(--gold-pale); opacity: 0.8; }
.chart-box .line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; }
.chart-box .base-line { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-box .end-dot { fill: var(--navy); stroke: var(--white); stroke-width: 2; }
.chart-key { display: flex; gap: 1.6rem; flex-wrap: wrap; padding: 0.4rem 0.4rem 0.8rem; font-size: 0.85rem; color: var(--muted); }
.chart-key span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 0.5rem; vertical-align: middle; background: var(--gold); }
.chart-key span.k-base::before { background: var(--navy); }
.tools-gap { margin-top: clamp(2rem, 4vw, 3rem); }

/* ---------- Tools engine extras ---------- */
.calc-group[hidden], .calc-field[hidden] { display: none; }
.calc-group {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--navy);
  padding-top: 0.4rem; margin: 2.2rem 0 1.4rem; border-top: 1px solid var(--border);
}
.calc-group:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.calc-label { display: block; font-size: 0.92rem; font-weight: 600; color: var(--navy); margin-bottom: 0.6rem; }
.calc-select {
  display: block; width: 100%; margin-top: 0.55rem; padding: 0.75rem 0.9rem; background: var(--white);
  border: 1px solid var(--border); color: var(--ink); font-size: 0.98rem; font-family: var(--sans);
}
.calc-select:focus { outline: 2px solid var(--gold); outline-offset: 2px; border-color: var(--gold); }
.calc-field > label { display: block; font-size: 0.92rem; font-weight: 600; color: var(--navy); }
.seg.wide { display: flex; width: 100%; flex-wrap: wrap; }
.seg.wide button { flex: 1; padding: 0.7rem 0.6rem; }
.calc-field .hint:empty { display: none; }
.stack { display: flex; height: 16px; background: var(--stone-deep); margin: 0 0 1rem; }
.stack span { display: block; height: 100%; }
.stack-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.6rem 1.5rem; margin-bottom: 2rem; }
.stack-key li { font-size: 0.93rem; color: var(--ink); display: flex; align-items: center; gap: 0.6rem; }
.stack-key i { width: 12px; height: 12px; flex: none; }
.stack-key b { margin-left: auto; font-weight: 600; color: var(--navy); }
.tools-extra .section-head-sm h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.12; }

/* ---------- Tools hub cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.tool-card {
  display: flex; flex-direction: column; background: var(--stone); border-top: 3px solid var(--gold);
  padding: 2rem 1.7rem; transition: background 0.25s ease;
}
.tool-card h3 { font-size: 1.25rem; }
.tool-card p { margin-top: 0.7rem; color: var(--muted); font-size: 0.95rem; flex: 1; }
.tool-card .go { margin-top: 1.4rem; font-weight: 600; font-size: 0.92rem; color: var(--navy); }
.tool-card:hover { background: var(--navy); }
.tool-card:hover h3, .tool-card:hover .go { color: var(--white); }
.tool-card:hover p { color: rgba(255,255,255,0.78); }
.tool-group { margin-bottom: 3rem; }
.tool-group h2 { font-size: 1.5rem; margin-bottom: 1.4rem; }
@media (max-width: 980px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tool-grid { grid-template-columns: 1fr; } }

.swap-row { margin: -0.6rem 0 1.4rem; }
.swap-btn {
  background: var(--white); border: 1px solid var(--navy); color: var(--navy);
  padding: 0.6rem 1.2rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: var(--sans);
  transition: background 0.2s ease, color 0.2s ease;
}
.swap-btn:hover { background: var(--navy); color: var(--white); }
.swap-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
