/* =====================================================================
   STR Cash Flow Calculator — styles.css
   Locked visual direction: polished one-page financial-summary feel
   (NOT a dashboard). Calm, professional, trustworthy. Generous
   whitespace. Numbers are the hero. Slim branded header.
   Single-column grouped inputs. Headline cash-flow number LARGEST,
   supporting metrics in a scannable list. Red/green ONLY where the
   calc-engine flags say colored, in brand colors.
   Brand: navy #0c2d4a / mid-blue #1e4d7b / orange #ff6b35 / cream #f8f6f1.
   Playfair Display headings + big numbers, Inter body/labels.
   Phone-first, also desktop. Print reflows to ONE branded leave-behind.
   ===================================================================== */

:root {
  --navy:   #0c2d4a;
  --navy-2: #103a5e;
  --blue:   #1e4d7b;
  --orange: #ff6b35;
  --orange-d: #e85420;
  --cream:  #f8f6f1;
  --cream-2:#f1ede3;
  --ink:    #1a2733;
  --muted:  #61707e;
  --faint:  #8a96a2;
  --line:   #e3ddd0;
  --line-2: #d5cfc0;
  --green:  #1f8a4c;
  --green-bg:#eaf5ee;
  --red:    #c0392b;
  --red-bg: #fbecea;
  --white:  #ffffff;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 16px;
  --sp-4: 22px;
  --sp-5: 30px;
  --sp-6: 44px;

  --shadow-sm: 0 1px 2px rgba(12,45,74,.05);
  --shadow:    0 2px 6px rgba(12,45,74,.06), 0 12px 32px rgba(12,45,74,.07);
  --shadow-lg: 0 4px 14px rgba(12,45,74,.08), 0 24px 56px rgba(12,45,74,.10);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 520px at 50% -180px, #fbfaf6 0%, var(--cream) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }

a { color: var(--blue); }

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 64px) 20px 76px;
}
/* Lift the input/results cards up over the hero's lower edge */
.layout { position: relative; }

/* ---------- Slim branded header ---------- */
.brand-header {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  border-bottom: 3px solid var(--orange);
}
.brand-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-plate {
  background: var(--white);
  border-radius: 9px;
  padding: 7px 11px;
  display: inline-flex;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.brand-header .logo { height: 26px; width: auto; display: block; }
.brand-header .headshot {
  height: 46px;
  width: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.55);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  flex: 0 0 auto;
}
.brand-header .brand-text { line-height: 1.3; min-width: 0; }
.brand-header .brand-text .name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
}
.brand-header .brand-text .name .reg {
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(255,255,255,.78);
}
.brand-header .brand-text .sub {
  font-size: .76rem;
  letter-spacing: .03em;
  color: rgba(255,255,255,.7);
}
.brand-header .contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: .8rem;
  text-align: right;
  color: rgba(255,255,255,.85);
  flex: 0 0 auto;
}
.brand-header .contact a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.brand-header .contact a:hover { color: #fff; text-decoration: underline; }

/* ---------- Coastal hero band ----------
   CSS Gulf treatment by default. Drop assets/hero.jpg to layer a
   licensed photo UNDER the navy overlay (gradient is graceful
   fallback when the file is absent). */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 4px solid var(--orange);
  background-color: var(--navy);
}
/* Photo layer — its OWN layer (NOT the element background, which
   would paint behind the negative-z-index children and be hidden).
   Sits ABOVE the .hero-water gradient (-3) and BELOW the navy
   .hero-overlay (-1). If assets/hero.jpg is absent the url() paints
   nothing and the .hero-water gradient shows through (graceful
   fallback preserved). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("../assets/hero.jpg");
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
}
/* Procedural Gulf — navy → deep teal with a soft horizon + wave.
   Sits behind the photo when present (photo paints over it), and
   IS the visual when no photo is supplied. */
.hero-water {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg,
      #0a2942 0%,
      #0c2d4a 26%,
      #0f3d5c 52%,
      #14566b 74%,
      #1c7585 100%);
}
.hero-water::before {
  /* subtle layered horizon/wave band */
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 46%;
  background:
    radial-gradient(70% 120% at 50% 130%, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, rgba(28,117,133,0) 0%, rgba(36,140,150,.55) 100%);
  filter: blur(2px);
}
.hero-water::after {
  /* faint surf line for a coastal read */
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 14%;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.28) 50%,
    rgba(255,255,255,0) 100%);
}
/* Navy overlay — keeps the title legible over photo OR gradient */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(8,28,46,.62) 0%,
      rgba(10,33,54,.50) 45%,
      rgba(12,45,74,.66) 100%);
}
.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(54px, 11vw, 104px) 24px clamp(50px, 9vw, 92px);
  text-align: center;
  color: var(--white);
}
.hero-eyebrow {
  margin: 0 0 16px;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: .74rem;
  font-weight: 700;
  color: rgba(255,255,255,.78);
}
.hero-title {
  margin: 0;
  font-size: clamp(2.3rem, 6.4vw, 4rem);
  line-height: 1.05;
  color: var(--white);
  text-shadow: 0 2px 18px rgba(6,20,34,.45);
}
.hero-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
  margin: 22px auto 0;
}
.hero-tagline {
  margin: 22px auto 0;
  max-width: 600px;
  font-size: clamp(1rem, 2.1vw, 1.12rem);
  line-height: 1.62;
  color: rgba(255,255,255,.86);
}

/* The old centered title block is now carried by the hero on screen.
   Kept in the DOM (print stylesheet still hides it); hidden on screen
   to avoid a duplicate heading. */
.title-block.screen-only { display: none; }

/* ---------- Title block (print fallback / legacy) ---------- */
.title-block {
  text-align: center;
  margin: var(--sp-6) auto var(--sp-5);
  max-width: 680px;
}
.tool-title {
  font-size: clamp(2rem, 5vw, 2.85rem);
  margin: 0 0 12px;
  color: var(--navy);
  line-height: 1.08;
}
.tool-title::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
  margin: 16px auto 0;
}
.tool-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  align-items: start;
}

/* ---------- Sections ---------- */
.section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 4vw, 40px);
}
.section-inputs { border-top: 3px solid var(--orange); }
.section-head { margin-bottom: var(--sp-5); }
.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: var(--navy);
}
.section-hint {
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Input groups ---------- */
.group { margin-bottom: var(--sp-5); }
.group:last-child { margin-bottom: 0; }
.group-label {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 var(--sp-3);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.group-label-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: .76rem;
  color: var(--faint);
}

/* ---------- Fields ---------- */
.field { margin-bottom: var(--sp-3); }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
  letter-spacing: .005em;
}
.field .hint {
  font-weight: 400;
  color: var(--faint);
  font-size: .76rem;
}
.field .hint::before { content: "· "; color: var(--line-2); }

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: .98rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: #aab3bc; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2361707e' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.field input:hover,
.field select:hover { border-color: #c0b9a6; }
.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,77,123,.14);
  background: #fdfdfb;
}
.field input.warn,
.field select.warn {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,53,.14);
}
.soft-warning {
  margin-top: 7px;
  font-size: .77rem;
  color: var(--orange-d);
  font-weight: 500;
}
.verify-flag {
  margin-top: 7px;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.45;
}
.verify-flag:empty { display: none; }

/* $ / % / unit affixes */
.input-affix { position: relative; display: flex; align-items: stretch; }
.input-affix input { width: 100%; }
.input-affix .affix-pre,
.input-affix .affix-post {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: .92rem;
  font-weight: 600;
  color: var(--faint);
  pointer-events: none;
}
.input-affix .affix-pre { left: 14px; }
.input-affix .affix-pre ~ input { padding-left: 26px; }
.input-affix .affix-post { right: 14px; }
.input-affix:has(.affix-post) input { padding-right: 44px; }

/* stepper */
.stepper {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.stepper:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,77,123,.14);
}
.stepper button {
  width: 48px;
  border: 0;
  background: var(--cream);
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s;
}
.stepper button:hover { background: var(--orange); color: var(--white); }
.stepper button:active { background: var(--orange-d); }
.stepper input {
  flex: 1 1 auto;
  text-align: center;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stepper input:focus { box-shadow: none !important; }

/* slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 16px;
}
.slider-row input[type="range"] {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--orange) 0 var(--fill,20%), var(--line-2) var(--fill,20%) 100%);
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--orange);
  box-shadow: 0 1px 4px rgba(12,45,74,.25);
  cursor: pointer;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--orange);
  box-shadow: 0 1px 4px rgba(12,45,74,.25);
  cursor: pointer;
}
.slider-row .slider-val {
  flex: 0 0 auto;
  min-width: 56px;
  text-align: right;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* toggle */
.toggle-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px 18px;
  margin-bottom: var(--sp-3);
}
.toggle-card:last-child { margin-bottom: 0; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row .toggle-label { font-size: .92rem; font-weight: 600; color: var(--ink); }
.switch { position: relative; width: 48px; height: 27px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: #cdd4da;
  border-radius: 999px;
  transition: background .18s;
  cursor: pointer;
}
.switch .track::before {
  content: "";
  position: absolute;
  height: 21px; width: 21px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(12,45,74,.3);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::before { transform: translateX(21px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(255,107,53,.3); }

/* two-up on wider screens */
@media (min-width: 560px) {
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
}

/* ---------- Results ---------- */
.section-results { position: relative; }

.results-headline {
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 46px) 24px;
  margin-bottom: var(--sp-4);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(12,45,74,.22);
}
.results-headline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--orange);
}
.results-headline .label {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .76rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  font-family: var(--sans);
}
.results-headline .label-period {
  letter-spacing: .08em;
  color: rgba(255,255,255,.5);
}
.results-headline .headline-number {
  font-family: var(--serif);
  font-size: clamp(3rem, 12vw, 5.2rem);
  font-weight: 800;
  line-height: 1.04;
  margin: 12px 0 8px;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
}
.results-headline .headline-number.green { color: #4fd98a; }
.results-headline .headline-number.red   { color: #ff8a7a; }
.results-headline .headline-sub {
  font-size: .86rem;
  color: rgba(255,255,255,.62);
  max-width: 380px;
  margin: 0 auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.metric {
  background: var(--white);
  padding: 20px 18px;
  text-align: center;
}
.metric .metric-label {
  font-family: var(--sans);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 9px;
}
.metric .metric-value {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.metric .metric-value.green {
  color: var(--green);
  background: var(--green-bg);
}
.metric .metric-value.red {
  color: var(--red);
  background: var(--red-bg);
}
.metric .metric-value.green,
.metric .metric-value.red {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 1.45rem;
}

/* ---------- Refine expander ---------- */
.refine { margin-top: var(--sp-4); }
.refine > summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-weight: 700;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  padding-right: 50px;
  transition: background .15s;
}
.refine > summary:hover { background: var(--cream-2); }
.refine > summary::-webkit-details-marker { display: none; }
.refine > summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 10px; height: 10px;
  border-right: 2.5px solid var(--orange);
  border-bottom: 2.5px solid var(--orange);
  transform: translateY(-65%) rotate(45deg);
  transition: transform .18s;
}
.refine[open] > summary::after { transform: translateY(-35%) rotate(225deg); }
.refine-summary-text { font-size: 1rem; }
.refine-summary-hint {
  font-size: .78rem;
  font-weight: 400;
  color: var(--muted);
}
.refine[open] > summary {
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 0;
}
.refine .refine-body {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 10px 24px 18px;
  background: var(--white);
}
.line-override {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.line-override:last-child { border-bottom: 0; }
.line-override .lo-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}
.line-override .lo-label .lo-sub {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: var(--faint);
  margin-top: 2px;
}
.line-override input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .92rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.line-override input[type="number"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,77,123,.14);
}
.line-override input::placeholder { color: #b4bcc4; font-style: italic; }
.line-override.with-toggle { grid-template-columns: 1fr auto 150px; }
.line-override .switch { width: 44px; height: 25px; }
.line-override .switch .track::before { height: 19px; width: 19px; }
.line-override .switch input:checked + .track::before { transform: translateX(19px); }

.actions {
  margin-top: var(--sp-5);
  display: flex;
  justify-content: center;
}
.btn {
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  padding: 15px 34px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn svg { display: block; }
.btn-print {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(255,107,53,.32);
}
.btn-print:hover {
  background: var(--orange-d);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255,107,53,.38);
}
.btn-print:active { transform: translateY(0); }

.disclaimer {
  margin-top: var(--sp-5);
  padding: 18px 20px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.6;
}
.disclaimer strong { color: var(--ink); font-weight: 700; }

/* ---------- Desktop two-column layout ---------- */
@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--sp-5);
  }
  .section-results {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* tame the scrollbar so the sticky card stays clean */
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .section-results::-webkit-scrollbar { width: 8px; }
  .section-results::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 999px;
  }
}

/* print-only one-pager scaffold (hidden on screen) */
.print-only { display: none; }

/* ===================================================================
   PRINT — reflow to ONE branded leave-behind page. No JS raster lib.
   Logo + headshot + contact, property, key numbers, assumptions
   shown, disclaimer at bottom.
   =================================================================== */
@media print {
  @page { margin: 12mm; size: letter portrait; }

  body {
    background: var(--white) !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page { max-width: none; padding: 0; }
  .layout { display: block; gap: 0; }

  .screen-only,
  .brand-header,
  .title-block,
  #inputs-section,
  .refine,
  .actions,
  .section-head { display: none !important; }

  .section-results,
  #results-section {
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: none;
    position: static;
  }

  .print-only { display: block; }

  .print-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid var(--navy);
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  .print-header img.logo { height: 30px; width: auto; }
  .print-header .print-id { line-height: 1.3; }
  .print-header .pa-name {
    font-family: var(--serif);
    font-size: 13pt;
    font-weight: 700;
    color: var(--navy);
  }
  .print-header .pa-sub { font-size: 8.5pt; color: var(--muted); }
  .print-header img.headshot {
    height: 50px; width: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: auto;
  }
  .print-header .pa-contact {
    text-align: right;
    font-size: 8.5pt;
    color: var(--ink);
    line-height: 1.5;
  }

  .print-title {
    font-family: var(--serif);
    font-size: 16pt;
    color: var(--navy);
    margin: 0 0 3px;
  }
  .print-property {
    font-size: 9pt;
    color: var(--muted);
    margin: 0 0 14px;
  }

  .results-headline {
    background: var(--cream) !important;
    color: var(--navy) !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 0 16px;
    margin-bottom: 14px;
  }
  .results-headline::after { display: none; }
  .results-headline .label { color: var(--muted) !important; }
  .results-headline .label-period { color: var(--faint) !important; }
  .results-headline .headline-number {
    font-size: 30pt;
    color: var(--navy) !important;
    margin: 6px 0 4px;
  }
  .results-headline .headline-number.green { color: var(--green) !important; }
  .results-headline .headline-number.red   { color: var(--red) !important; }
  .results-headline .headline-sub { color: var(--muted) !important; }

  .metrics-grid {
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  .metric { padding: 9px 6px; }
  .metric .metric-label { font-size: 7pt; margin-bottom: 4px; }
  .metric .metric-value { font-size: 13pt; }
  .metric .metric-value.green,
  .metric .metric-value.red {
    padding: 1px 8px;
    font-size: 12pt;
  }
  .metric .metric-value.green { color: var(--green) !important; background: var(--green-bg) !important; }
  .metric .metric-value.red   { color: var(--red) !important;  background: var(--red-bg) !important; }

  .print-assumptions {
    margin-top: 16px;
    page-break-inside: avoid;
  }
  .print-assumptions h3 {
    font-family: var(--serif);
    font-size: 11pt;
    color: var(--navy);
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 4px;
    margin: 0 0 7px;
  }
  .print-assumptions table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
  }
  .print-assumptions td {
    padding: 3px 6px;
    border-bottom: 1px solid #eee;
  }
  .print-assumptions td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }

  .disclaimer {
    margin-top: 18px;
    background: none !important;
    border: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 0;
    font-size: 7.5pt;
    padding: 9px 0 0;
    page-break-inside: avoid;
  }
}
