:root{--navy:#011F5B;--red:#990000;--gold:#C9A227;--ink:#18202f;--muted:#4f586b;--line:#dfe3ea;--soft:#f6f7fa}
[hidden]{display:none!important}
*{box-sizing:border-box}
body{margin:0;font:16px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink)}
.wrap{max-width:1180px;margin:0 auto;padding:0 20px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:8px;background:var(--navy);color:#fff;padding:8px 14px;border-radius:8px}.skip:focus{left:12px}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
a{color:var(--navy)}h1,h2{color:var(--navy);line-height:1.2}
.top{border-bottom:1px solid var(--line);background:#fff}
.top-in{display:flex;justify-content:space-between;align-items:center;min-height:58px;gap:12px;flex-wrap:wrap}
.brand{display:flex;gap:10px;align-items:center;font-weight:800;color:var(--navy);font-size:1.15rem}
.model{font-size:.85rem;font-weight:700;padding:4px 10px;border-radius:20px;background:var(--soft);color:var(--muted)}
.model.busy{background:#fff8e1;color:#7a5b00}.model.ok{background:#e9eef8;color:var(--navy)}.model.bad{background:#fbeaea;color:var(--red)}
.hero{display:grid;grid-template-columns:1.4fr 1fr;gap:36px;padding:40px 0 30px;align-items:center}
.hero h1{font-size:clamp(1.7rem,3.6vw,2.5rem);margin:0 0 12px}
.lede{color:var(--muted);font-size:1.05rem;margin:0 0 18px}
.cta{display:flex;gap:10px;flex-wrap:wrap}
.btn{font:inherit;font-weight:800;border:2px solid var(--red);background:var(--red);color:#fff;border-radius:10px;padding:10px 18px;cursor:pointer;display:inline-block}
.btn.ghost{background:#fff;color:var(--navy);border-color:var(--navy)}
.btn.small{padding:6px 12px;font-size:.9rem;background:var(--navy);border-color:var(--navy)}.btn.small.ghost{background:#fff}
input[type=file]:focus-visible+*{outline:3px solid var(--gold)}
.fine{color:var(--muted);font-size:.88rem;margin-top:14px}
.how{list-style:none;counter-reset:s;margin:0;padding:22px;border:2px solid var(--navy);border-radius:16px;display:grid;gap:12px}
.how li{counter-increment:s;display:grid;grid-template-columns:34px 1fr;gap:2px 10px;color:var(--muted);font-size:.95rem}
.how li::before{content:counter(s);grid-row:1/3;width:30px;height:30px;border-radius:50%;background:var(--navy);color:#fff;font-weight:800;display:grid;place-items:center}
.how b{color:var(--navy)}
.bar{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:10px 0 16px}
.stat{background:var(--soft);border-radius:12px;padding:10px 14px}
.stat span{display:block;font-size:.8rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.stat b{font-size:1.6rem;color:var(--navy);font-variant-numeric:tabular-nums}.stat b.red{color:var(--red)}
.layout{display:grid;grid-template-columns:1.6fr 1fr;gap:22px;align-items:start}
.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.chip{font:inherit;font-weight:700;font-size:.9rem;border:2px solid var(--line);background:#fff;border-radius:20px;padding:5px 12px;cursor:pointer;color:var(--ink)}
.chip.on{border-color:var(--navy);background:var(--navy);color:#fff}
table{width:100%;border-collapse:collapse}
.tx th{font-size:.8rem;text-align:left;color:var(--muted);padding:6px;border-bottom:2px solid var(--line)}
.tx td:first-child{white-space:nowrap}.tx td{padding:6px;border-bottom:1px solid var(--line);font-size:.93rem;vertical-align:middle}
.tx tr.flag td:first-child{box-shadow:inset 4px 0 var(--red)}
.tx tr.dim td{color:var(--muted)}
.r{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.tx select{font:inherit;font-size:.88rem;border:1.5px solid #c4cad6;border-radius:8px;padding:5px 6px;max-width:250px;background:#fff}
.tag{font-size:.72rem;font-weight:800;color:var(--red);border:1.5px solid var(--red);border-radius:10px;padding:0 6px;margin-left:4px;text-transform:uppercase}
.tag.you{color:var(--navy);border-color:var(--navy)}
.loading{color:var(--muted);padding:20px!important;text-align:center}
.sum{position:sticky;top:12px;border:2px solid var(--navy);border-radius:16px;padding:16px 18px}
.sum h2{margin:0 0 8px;font-size:1.15rem}
.sum th{text-align:left;font-weight:500;font-size:.9rem;padding:5px 0;border-bottom:1px solid var(--line)}
.sum th small{color:var(--muted)}
.sum td{padding:5px 0 5px 8px;border-bottom:1px solid var(--line);font-size:.9rem}
.sum thead th{font-size:.78rem;color:var(--muted);font-weight:700}
.sum tfoot th,.sum tfoot td{font-weight:800;color:var(--navy);border-top:2px solid var(--navy);border-bottom:0}
.sum tr.dim{color:var(--muted)}
.note{font-size:.86rem;color:var(--muted);border-left:3px solid var(--gold);padding-left:10px}
.dl{display:flex;gap:8px;flex-wrap:wrap}
.more{border-top:1px solid var(--line);margin-top:28px;padding:12px 0}
.more summary{font-weight:800;color:var(--navy);cursor:pointer}.mbody{color:var(--muted);max-width:900px}
.foot{margin-top:30px;border-top:1px solid var(--line);padding:18px 0;color:var(--muted);font-size:.9rem}
.tools{display:flex;gap:10px 14px;align-items:center;flex-wrap:wrap;margin:0 0 12px;font-size:.92rem}
.signnote{margin:0;color:var(--ink)}.gst{display:flex;gap:6px;align-items:center;font-weight:600}.gst input{width:18px;height:18px;accent-color:var(--navy)}
.linkbtn{font:inherit;font-size:.88rem;background:none;border:0;color:var(--navy);text-decoration:underline;cursor:pointer;padding:4px}
.undo{background:var(--navy);color:#fff;border-radius:12px;padding:8px 14px;margin:0 0 12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.undo .btn.small{background:#fff;color:var(--navy);border-color:#fff}
.warn{font-size:.86rem;color:var(--ink);background:#fff6f6;border-left:3px solid var(--red);padding:6px 10px;margin:10px 0}
.pct{width:64px;font:inherit;font-size:.85rem;border:1.5px solid #c4cad6;border-radius:6px;padding:2px 4px;text-align:right}
.sum .need{color:var(--red);font-weight:700;font-size:.82rem}
.txwrap{min-width:0}
@media(max-width:880px){.txwrap{overflow-x:auto}.hero,.layout{grid-template-columns:1fr}.bar{grid-template-columns:1fr 1fr}.sum{position:static}}
@media(max-width:600px){.tx td,.tx th{font-size:.82rem;padding:5px 4px}.tx select{max-width:150px;font-size:.8rem}.tx td:first-child,.tx th:first-child{display:none}.tx td:nth-child(2){word-break:break-word}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* ---------- Collegiate theme (shared across Cash to Close, Doc Quest, Receipt Window, Shoebox) ---------- */

:root{
  color-scheme:light;

  /* Brand */
  --navy:#011F5B;        /* 15.6:1 on white */
  --navy-600:#2A4580;    /* hover text/borders, 9.3:1 */
  --navy-300:#9AA8C4;    /* decorative only */
  --navy-100:#DDE3EF;
  --navy-050:#EEF1F8;    /* selected fill; navy text on it 13.8:1 */
  --red:#990000;         /* 8.9:1 on white, white text on it 8.9:1 */
  --red-700:#7A0000;     /* primary hover */
  --red-100:#F3D6D2;
  --red-050:#FBEEEC;     /* red text on it 7.9:1 */
  --gold:#C9A227;        /* DECORATIVE ONLY: 2.4:1 on white. Rules, hairlines */
  --gold-deep:#8A6A14;   /* antique gold: focus ring, icons; 5.1 white / 4.8 ivory */
  --gold-text:#7A5C0F;   /* gold text: 6.2 white / 5.9 ivory */
  --gold-050:#FAF3DE;

  /* Neutrals (warm, to sit with ivory) */
  --ivory:#FBF8F1;
  --ivory-2:#F4EEE1;
  --ink:#1A2133;         /* 16:1 white, 15.1 ivory */
  --muted:#4F586B;       /* 7.1 white, 6.7 ivory, 6.2 ivory-2 */
  --line:#DDD5C4;        /* dividers, panel borders */
  --line-soft:#ECE6D8;   /* table rows */
  --line-strong:#B9AE96; /* unselected choice borders */
  --field:#7C879E;       /* input borders: 3.6:1 white (meets 1.4.11) */
  --bg:#fff;
  --soft:var(--ivory);   /* remaps every existing var(--soft) to ivory */

  /* Type */
  --serif:Georgia,"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua","Times New Roman",serif;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --fs-xs:.75rem;      /* 12 eyebrow labels, uppercase tracked */
  --fs-sm:.875rem;     /* 14 help text, table cells */
  --fs-base:1rem;      /* 16 body */
  --fs-md:1.125rem;    /* 18 lede */
  --fs-h3:1.125rem;    /* 18 serif */
  --fs-h2:clamp(1.3rem,1.1rem + .8vw,1.6rem);
  --fs-h1:clamp(1.875rem,1.2rem + 2.4vw,2.75rem);
  --fs-display:clamp(2.125rem,1.2rem + 3.6vw,3.25rem);
  --lh-tight:1.15;
  --lh-body:1.6;
  --track-eyebrow:.08em;

  /* Space (4px base) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px; --s7:48px; --s8:64px;

  /* Shape */
  --r-sm:4px;    /* buttons, inputs */
  --r:6px;       /* panels, cards */
  --r-lg:10px;   /* large feature panels only */
  --r-pill:999px;

  /* Elevation: navy-tinted, never grey-black */
  --sh-1:0 1px 2px rgba(1,31,91,.06),0 1px 1px rgba(1,31,91,.04);
  --sh-2:0 2px 4px rgba(1,31,91,.05),0 10px 24px -10px rgba(1,31,91,.18);
  --ring:0 0 0 3px var(--gold-deep);
}

/* ---------- Base ---------- */
body{font-family:var(--sans);color:var(--ink);background:var(--bg)}
h1,h2,h3,legend,.brand{font-family:var(--serif);font-weight:700;color:var(--navy);letter-spacing:0}
h1,h2,h3{line-height:var(--lh-tight);text-wrap:balance}
h3{font-size:var(--fs-h3)}
a{color:var(--navy);text-decoration-thickness:1px;text-underline-offset:.18em}
a:hover{color:var(--red)}
.lede{color:var(--muted);font-size:var(--fs-md);line-height:var(--lh-body);max-width:62ch}

/* Hero H1 with the cover's thin red rule */
.hero h1,.intro h1{font-size:var(--fs-h1);letter-spacing:-.005em;line-height:1.12}
.hero h1::after,.intro h1::after,.plan-head h1::after{
  content:"";display:block;width:64px;height:3px;margin-top:var(--s4);
  background:var(--red);border-radius:0}

/* ---------- Header: ivory, red rule, gold hairline ---------- */
.top{
  color:var(--ink);border:0;box-shadow:none;padding-bottom:5px;
  background:
    linear-gradient(var(--red),var(--red)) 0 calc(100% - 3px)/100% 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) 0 100%/100% 1px no-repeat,
    var(--ivory);
}
.top-in{min-height:64px}
.brand{font-size:1.2rem;color:var(--navy)}
legend small{font-family:var(--sans);font-weight:400}
.brand img{background:none;padding:0;border-radius:0}
.top-tag,.yr{font-size:var(--fs-xs);font-weight:600;letter-spacing:var(--track-eyebrow);
  text-transform:uppercase;color:var(--muted);opacity:1}

/* ---------- Focus ring (antique gold, 3:1+ on white and ivory) ---------- */
:focus-visible,
.seg input:focus-visible+label,
.opts input:focus-visible+span,
.stage:focus-visible,
input[type=file]:focus-visible+*{outline:3px solid var(--gold-deep);outline-offset:2px}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);
  min-height:44px;padding:10px 20px;
  font:600 var(--fs-base)/1.2 var(--sans);letter-spacing:.01em;text-decoration:none;
  color:#fff;background:var(--red);border:1px solid var(--red);border-radius:var(--r-sm);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.22),var(--sh-1);
  cursor:pointer;filter:none;transition:background-color .15s,border-color .15s,box-shadow .15s}
.btn:hover{background:var(--red-700);border-color:var(--red-700);filter:none}
.btn:active{box-shadow:inset 0 2px 0 rgba(0,0,0,.22)}
.btn.big{min-height:52px;padding:13px 28px;font-size:var(--fs-md);background:var(--red);border-color:var(--red)}
.btn.small{min-height:36px;padding:6px 14px;font-size:.9rem;color:#fff;background:var(--red);border-color:var(--red)}

/* Secondary: white, navy text, navy hairline; gold underline on hover */
.btn-ghost,.btn.ghost,.btn.small.ghost{
  color:var(--navy);background:#fff;border-color:var(--navy);box-shadow:var(--sh-1)}
.btn-ghost:hover,.btn.ghost:hover,.btn.small.ghost:hover{
  color:var(--navy);background:var(--navy-050);border-color:var(--navy);
  box-shadow:inset 0 -2px 0 var(--gold),var(--sh-1)}

/* Text buttons */
.link,.linkbtn{color:var(--navy);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.18em}
.link:hover,.linkbtn:hover{color:var(--red)}

/* ---------- Inputs ---------- */
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range])),select,
.edit input,.tx select,.pct{
  font:inherit;color:var(--ink);background:#fff;
  border:1px solid var(--field);border-radius:var(--r-sm);
  transition:border-color .15s,box-shadow .15s}
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range])),select{min-height:44px;padding:9px 12px}
.edit input{min-height:36px;padding:6px 10px}
.tx select,.pct{min-height:32px;padding:4px 8px}
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range])):hover,select:hover,
.edit input:hover,.tx select:hover,.pct:hover{border-color:var(--navy-600)}
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range])):focus,select:focus,
.edit input:focus,.tx select:focus,.pct:focus{border-color:var(--navy);outline:3px solid var(--gold-deep);outline-offset:2px}
input[type=checkbox],input[type=radio]{accent-color:var(--navy)}

/* ---------- Choice controls: segmented, option pills, filter chips ---------- */
.seg label,.opts span,.chip{
  background:#fff;color:var(--ink);font-weight:600;
  border:1px solid var(--line-strong);border-radius:var(--r-sm);
  transition:background-color .15s,border-color .15s,box-shadow .15s}
.chip{border-radius:var(--r-pill);padding:6px 14px}
.seg label:hover,.opts span:hover,.chip:hover{border-color:var(--navy-600);background:var(--ivory)}
/* Selected = navy tint + navy edge + gold underline. Never a flat navy fill. */
.seg input:checked+label,.opts input:checked+span{
  color:var(--navy);background:var(--navy-050);border-color:var(--navy);font-weight:700;
  box-shadow:inset 0 0 0 1px var(--navy),inset 0 -4px 0 var(--gold)}
.chip.on{color:var(--navy);background:var(--navy-050);border-color:var(--navy);font-weight:700;
  box-shadow:inset 0 0 0 1px var(--navy)}
.chip.on::before{content:"\2713\00a0"}

/* ---------- Panels and cards ---------- */
/* Standard: white, warm hairline, soft navy shadow */
.panel,.card,.gap-card,.stage-panel,.items,.toggles fieldset{
  background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh-1)}
/* Feature (replaces every 2px navy outline): ivory, red top rule, gold hairline */
.reveal,.result,.after,.how,.done-all,aside.sum{
  background:var(--ivory);border:1px solid var(--line);border-top:2px solid var(--red);
  border-radius:var(--r);box-shadow:inset 0 1px 0 var(--gold),var(--sh-1)}
/* Left accent stripes: thin, never thick slabs */
.card{border-left:3px solid var(--navy)}
.card.slow{border-left-color:var(--red)}
.stage-panel{border-left:3px solid var(--navy)}

/* Stat tiles: ivory, gold eyebrow, navy tabular figures */
.big>div,.stat{background:var(--ivory);border:1px solid var(--line-soft);border-radius:var(--r)}
.big .k,.stat span,.compare figcaption{
  font:700 var(--fs-xs)/1.3 var(--sans);letter-spacing:var(--track-eyebrow);
  text-transform:uppercase;color:var(--gold-text)}
.big b,.stat b{font-family:var(--sans);font-weight:700;color:var(--navy);font-variant-numeric:tabular-nums}
.big b.red,.stat b.red{color:var(--red)}

/* Numbered steps: navy disc, white numeral, gold ring */
.step,.mini .n,.card .n,.qn,.how li::before{
  width:28px;height:28px;border-radius:50%;
  background:var(--navy);color:#fff;font:700 .875rem/1 var(--sans);
  display:inline-grid;place-items:center;
  box-shadow:0 0 0 2px #fff,0 0 0 3px var(--gold)}

/* ---------- Tables: ledger style ---------- */
.rc th,.tx th,.sum thead th,.byp thead th{
  font:700 var(--fs-xs)/1.3 var(--sans);letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);text-align:left;border-bottom:1px solid var(--navy)}
.rc td,.tx td,.sum th,.sum td,.byp td{border-bottom:1px solid var(--line-soft)}
.tx tbody tr:hover td{background:var(--ivory)}
.r,.sum td,.byp td{font-variant-numeric:tabular-nums}
/* Totals: accounting double rule */
.sum tfoot th,.sum tfoot td,.sum tr.t th,.sum tr.t td{
  color:var(--navy);font-weight:800;border-top:3px double var(--navy);border-bottom:0}

/* ---------- Tags, badges ---------- */
.tag,.badge{
  display:inline-flex;align-items:center;gap:4px;
  font:700 var(--fs-xs)/1.4 var(--sans);letter-spacing:.02em;
  padding:2px 9px;border-radius:var(--r-pill);
  color:var(--red);background:var(--red-050);border:1px solid var(--red-100)}
.tag-loan,.tag.you,.badge.quick{color:var(--navy);background:var(--navy-050);border-color:var(--navy-100)}
.tag-down{color:var(--gold-text);background:var(--gold-050);border-color:var(--gold)}

/* ---------- Callouts, disclosure, footer ---------- */
.note,.fine,.exnote,.partner-note{border-left:2px solid var(--gold);padding-left:var(--s3)}
.exnote,.partner-note{background:var(--ivory);padding:10px 14px;border-radius:0 var(--r-sm) var(--r-sm) 0}
.more summary{font-family:var(--serif);font-weight:700;color:var(--navy)}
.more summary::marker{color:var(--gold-deep)}
.foot{border-top:1px solid var(--gold);color:var(--muted);font-size:var(--fs-sm)}

@media print{.top{background:none}.reveal,.result,.after,.how,.done-all,aside.sum{box-shadow:none}}

/* ---------- Shoebox ---------- */
/* 1. Undo toast: ivory card with red rule, not a navy bar */
.undo{background:var(--ivory);color:var(--ink);border:1px solid var(--line);
  border-left:3px solid var(--red);border-radius:var(--r);box-shadow:var(--sh-2)}
.undo .btn.small{color:#fff;background:var(--red);border-color:var(--red)}

/* 2. Model status pill reads on the ivory header; 'ready' gets a gold dot */
.model{background:#fff;border:1px solid var(--line);font-weight:600}
.model.ok{background:var(--navy-050);border-color:var(--navy-100)}
.model.ok::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;
  background:var(--gold-deep);margin-right:6px;vertical-align:1px}
.model.busy{background:var(--gold-050);color:var(--gold-text);border-color:var(--gold)}

/* 3. Mobile hides the first column, which also hid the red "needs a look"
      marker. Move it to the description cell. */
@media (max-width:600px){
  .tx tr.flag td:nth-child(2){box-shadow:inset 4px 0 var(--red);padding-left:10px}
  .top-in{min-height:0;padding:10px 0;row-gap:6px}
  .model{font-size:.75rem}
}

/* ---------- Collegiate theme, round 2 ---------- */
.reveal,.result,.after,.how,.done-all,aside.sum{border-radius:0 0 var(--r) var(--r)}
@media (hover:none){
  .btn-ghost:hover,.btn.ghost:hover,.btn.small.ghost:hover{background:#fff;box-shadow:var(--sh-1)}
  .btn:not(.ghost):not(.btn-ghost):hover{background:var(--red);border-color:var(--red)}
  .chip:not(.on):hover,
  .seg input:not(:checked)+label:hover,
  .opts input:not(:checked)+span:hover{background:#fff;border-color:var(--line-strong)}
}
.hero,.intro{padding-top:40px}
@media (max-width:600px){.hero,.intro{padding-top:24px}}
@media (max-width:520px){
  .top-in{flex-wrap:nowrap}
  .yr,.top-tag{font-size:.6875rem;letter-spacing:.04em;text-align:right;max-width:11em;line-height:1.3}
}
