/* ==========================================================================
   Locorp Interest Engine. The colors are tokens with a light set on :root and a
   dark set on :root[data-theme="dark"], which index.html sets before anything is
   drawn. Charts use the same tokens, so they follow the theme without redrawing.
   ========================================================================== */
:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 16px; --radius-sm: 10px;
  --page-bg: #f3f6f5; --page-glow: rgba(15,118,110,.08);
  --surface: #ffffff; --surface-2: #f5f8f7; --surface-3: #ebf1ef; --input-bg: #ffffff;
  --border: #e2e9e7; --border-strong: #cad6d3;
  --ink: #1b2a28; --ink-2: #455653; --muted: #5f706c;
  --accent: #0f766e; --accent-hover: #0b625b; --accent-text: #0f766e; --on-accent: #ffffff;
  --accent-soft: #e3f2ef; --accent-soft-ink: #0d5c55; --accent-line: #a9d8d0; --focus-ring: rgba(15,118,110,.16);
  --sidebar-bg: linear-gradient(180deg, #17403b 0%, #10302c 100%);
  --sidebar-ink: #e7f3f0; --sidebar-muted: rgba(231,243,240,.68); --sidebar-line: rgba(255,255,255,.10);
  --sidebar-hover: rgba(255,255,255,.07); --sidebar-active-bg: #dff2ee; --sidebar-active-ink: #0c4943; --sidebar-chip: rgba(255,255,255,.10);
  --shadow-sm: 0 1px 2px rgba(16,42,38,.06);
  --shadow: 0 1px 2px rgba(16,42,38,.04), 0 6px 18px -6px rgba(16,42,38,.10);
  --shadow-lg: 0 14px 34px -10px rgba(16,42,38,.26);
  --warn-bg: #fff6e5; --warn-border: #f0cd85; --warn-ink: #7f5300;
  --danger-bg: #fdeeee; --danger-border: #eeb0b0; --danger-ink: #9f2a2a;
  --ok-ink: #0f6b45; --ok-dot: #1a9b6c;
  --note-bg: #fffbea; --note-border: #f0dc8c; --note-edge: #e2b616; --note-ink: #5c4a00; --note-strong: #3f3300;
  --skel-a: #edf2f0; --skel-b: #f9fbfa;
  --grid: #edf2f0; --axis: #cad6d3;
  --chart-accent: #0f766e; --band-outer: .12; --band-inner: .24; --band-cases: .17;
  --chart-ink: #31403d; --chart-muted: #a2b0ad; --chart-put: #6b7c79;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --t-mint-bg: #dcf2ed; --t-mint: #0f766e; --t-sky-bg: #e2ecfa; --t-sky: #2a62b0;
  --t-lav-bg: #ebe7fa; --t-lav: #5845c0; --t-peach-bg: #fbeadf; --t-peach: #b0521c; --t-gray-bg: #edf1f0; --t-gray: #546562;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0e1514; --page-glow: rgba(45,212,191,.06);
  --surface: #151e1d; --surface-2: #1a2524; --surface-3: #22302e; --input-bg: #111918;
  --border: #243230; --border-strong: #34453f;
  --ink: #e4eeec; --ink-2: #b4c4c1; --muted: #869894;
  --accent: #14b8a6; --accent-hover: #2dd4bf; --accent-text: #5eead4; --on-accent: #042321;
  --accent-soft: #15332f; --accent-soft-ink: #99f0e2; --accent-line: #1f5a53; --focus-ring: rgba(45,212,191,.22);
  --sidebar-bg: linear-gradient(180deg, #0c1413 0%, #0a1110 100%);
  --sidebar-ink: #e4eeec; --sidebar-muted: rgba(228,238,236,.62); --sidebar-line: rgba(255,255,255,.07);
  --sidebar-hover: rgba(255,255,255,.05); --sidebar-active-bg: rgba(45,212,191,.15); --sidebar-active-ink: #a7f3e6; --sidebar-chip: rgba(255,255,255,.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 1px 2px rgba(0,0,0,.30), 0 8px 22px -8px rgba(0,0,0,.50);
  --shadow-lg: 0 14px 36px -8px rgba(0,0,0,.60);
  --warn-bg: #2b2412; --warn-border: #6a5420; --warn-ink: #f3d58e;
  --danger-bg: #301a1b; --danger-border: #763636; --danger-ink: #f5b8b8;
  --ok-ink: #6ee7b7; --ok-dot: #34d399;
  --note-bg: #29250f; --note-border: #5a5020; --note-edge: #d4a514; --note-ink: #ecdc98; --note-strong: #fff2bf;
  --skel-a: #1a2524; --skel-b: #24322f;
  --grid: #1f2b29; --axis: #34453f;
  --chart-accent: #2dd4bf; --band-outer: .13; --band-inner: .26; --band-cases: .19;
  --chart-ink: #d6e3e0; --chart-muted: #5b736e; --chart-put: #98aaa6;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --t-mint-bg: rgba(45,212,191,.14); --t-mint: #5eead4; --t-sky-bg: rgba(96,165,250,.15); --t-sky: #93c5fd;
  --t-lav-bg: rgba(167,139,250,.16); --t-lav: #c4b5fd; --t-peach-bg: rgba(251,146,60,.15); --t-peach: #fdba74; --t-gray-bg: rgba(255,255,255,.07); --t-gray: #b4c4c1;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--page-bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
button { font: inherit; color: inherit; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
/* ======================================================================
   The app
   ====================================================================== */
.app { display: flex; min-height: 100vh; background: var(--page-bg); color: var(--ink); position: relative; transition: background-color .25s, color .25s; }
.app a { color: var(--accent-text); }

/* Sidebar: the height of the window and in view the whole time, however long the page; it scrolls on its own only when
   the window is too short for all of it. */
.sidebar { flex: 0 0 268px; position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--sidebar-bg); color: var(--sidebar-ink); display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 24px 20px 18px; text-decoration: none; color: inherit; cursor: pointer; }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand strong { display: block; font-size: 15px; color: #fff; font-weight: 650; line-height: 1.2; }
.brand small { display: block; font-size: 12px; color: var(--sidebar-muted); margin-top: 3px; }
.nav { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.app .nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--sidebar-muted); text-decoration: none; font-size: 14px; cursor: pointer; transition: background-color .15s, color .15s; }
.app .nav a:hover { background: var(--sidebar-hover); color: #fff; }
.app .nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-ink); font-weight: 600; }
.app .nav a.folder.parent { color: var(--sidebar-ink); }
.nav .folder .chev { margin-left: auto; opacity: .55; width: 12px; height: 12px; }
.nav .indent { display: flex; flex-direction: column; gap: 2px; margin: 1px 0 4px 21px; padding-left: 9px; border-left: 1px solid var(--sidebar-line); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .ext { margin-left: auto; opacity: .55; width: 13px; height: 13px; }
.sidebar-foot { margin-top: auto; padding: 8px 12px 0; }
.foot-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; font-size: 13.5px; color: var(--sidebar-ink); }
.foot-row > svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.theme-row { cursor: pointer; user-select: none; transition: background-color .15s; }
.theme-row:hover { background: var(--sidebar-hover); }
.tswitch { margin-left: auto; width: 36px; height: 21px; border-radius: 999px; background: rgba(255,255,255,.2); position: relative; flex: none; transition: background-color .2s; }
.tswitch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
:root[data-theme="dark"] .tswitch { background: var(--accent); }
:root[data-theme="dark"] .tswitch::after { transform: translateX(15px); }
.lang { margin-left: auto; display: inline-flex; background: var(--sidebar-chip); border-radius: 999px; padding: 3px; gap: 2px; }
.lang button { background: none; border: 0; color: var(--sidebar-muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.lang button.on { background: var(--sidebar-active-bg); color: var(--sidebar-active-ink); }
.credit { margin: 10px 0 0; padding: 14px 12px 22px; border-top: 1px solid var(--sidebar-line); font-size: 12px; line-height: 1.55; color: var(--sidebar-muted); }
.app .credit a { color: var(--sidebar-ink); }
.sidebar .note { margin: 6px 4px 4px; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: radial-gradient(1000px 420px at 22% -140px, var(--page-glow), transparent 70%), var(--page-bg); }
.topbar { display: none; align-items: center; gap: 10px; background: var(--sidebar-bg); color: #fff; padding: 10px 14px; }
.topbar svg.logo { width: 32px; height: 32px; }
.topbar .t strong { display: block; font-size: 14px; line-height: 1.15; }
.topbar .t small { display: block; font-size: 11px; color: var(--sidebar-muted); }
.topbar .menu { margin-left: auto; background: var(--sidebar-chip); border: 1px solid var(--sidebar-line); color: #fff; border-radius: 9px; padding: 6px 11px; cursor: pointer; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(5,15,14,.42); z-index: 25; }
.content { padding: 30px 34px 40px; width: 100%; max-width: 1480px; }
.page { display: block; animation: rise .3s ease both; }
.disclaimer { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 16px 34px 20px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.disclaimer svg { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--muted); }
.disclaimer p { margin: 0; max-width: 95ch; }

/* Page header */
.page-head { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.ph-icon { width: 50px; height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex: none; }
.ph-icon svg { width: 25px; height: 25px; }
.t-mint { background: var(--t-mint-bg); color: var(--t-mint); }
.t-sky { background: var(--t-sky-bg); color: var(--t-sky); }
.t-lav { background: var(--t-lav-bg); color: var(--t-lav); }
.t-peach { background: var(--t-peach-bg); color: var(--t-peach); }
.t-gray { background: var(--t-gray-bg); color: var(--t-gray); }
.page-head h1 { font-size: 26px; font-weight: 650; margin: 0; letter-spacing: -0.015em; }
.page-head .lead { color: var(--ink-2); margin: 3px 0 0; max-width: 72ch; font-size: 15px; line-height: 1.5; }
details.how { margin: 0 0 22px 66px; }
details.how > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 13.5px; list-style: none; padding: 3px 0; }
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary svg { width: 14px; height: 14px; transition: transform .2s; }
details.how[open] > summary svg { transform: rotate(90deg); }
.how-body { margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow-sm); max-width: 880px; animation: rise .25s ease; }
.how-body ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.how-body li { margin: 6px 0; line-height: 1.55; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: background-color .25s, border-color .25s; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15px; margin: 0; font-weight: 650; }
.card-head .act { font-size: 12.5px; cursor: pointer; text-decoration: none; }
.card-body { padding: 16px 18px; }

/* Forms */
.engine { display: grid; grid-template-columns: minmax(320px, 384px) minmax(0, 1fr); gap: 22px; align-items: start; }
.engine > *, .plan-build > *, .row2 > * { min-width: 0; }
.essentials { padding: 18px 18px 20px; display: grid; gap: 16px; }
.field > label, .field > .label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.45; }
/* What history suggests for a rate, with a button that fills it in. */
.history-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 8px 0 4px; padding: 7px 10px; font-size: 12px; line-height: 1.45; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--accent-line); border-radius: 10px; }
.history-hint .grow { flex: 1 1 220px; }
.history-hint .in-use { color: var(--muted); font-style: italic; }
.history-chart { display: block; width: 100%; height: auto; margin: 10px 0 2px; }
.history-chart text { font-size: 10px; fill: var(--muted); }
.history-chart .grid { stroke: var(--grid); }
.history-chart .axis { stroke: var(--axis); }
.history-chart .band { fill: color-mix(in srgb, var(--chart-accent) 16%, transparent); }
.history-chart .bar { fill: var(--chart-accent); }
.history-chart .bar.out { fill: var(--s2); }
.field-error { color: var(--danger-ink); font-size: 12px; margin-top: 6px; font-weight: 500; }
.ig { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input-bg); overflow: hidden; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.ig:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.ig input { border: 0; outline: 0; padding: 9px 11px; font: inherit; font-size: 14px; min-width: 0; width: 100%; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.ig input::placeholder { color: var(--muted); opacity: .8; }
.ig .ad { display: flex; align-items: center; padding: 0 11px; background: var(--surface-2); color: var(--muted); font-size: 13px; border: 0; border-left: 1px solid var(--border); white-space: nowrap; }
.ig .ad.l { border-left: 0; border-right: 1px solid var(--border); }
.ig button.ad { cursor: pointer; font-size: 15px; }
.ig button.ad:hover { color: var(--accent-text); }
.ig.invalid { border-color: var(--danger-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-ink) 16%, transparent); }
.w-sm { max-width: 200px; }
.ig-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ig-row .ig { flex: 1 1 130px; }
select.sel { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 10px; font: inherit; font-size: 14px; background: var(--input-bg); color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.essentials .row2 { align-items: end; }
.vals { display: flex; align-items: center; gap: 8px; }
.vals .ig { flex: 1; }
.vals .to { color: var(--muted); font-size: 12.5px; }
.ro { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13.5px; color: var(--ink-2); }
.ro a { font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; border-radius: 999px; transition: background-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
:root[data-theme="dark"] .seg button.on { background: var(--surface-3); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; font-weight: 500; color: var(--ink); user-select: none; }
.switch .knob { width: 36px; height: 21px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; transition: background-color .2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on .knob { background: var(--accent); }
.switch.on .knob::after { transform: translateX(15px); }
.help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: help; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; background: var(--input-bg); transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--accent-line); }
.choice .dot { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--border-strong); margin-top: 1px; flex: none; position: relative; transition: border-color .15s; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice.on .dot { border-color: var(--accent); }
.choice.on .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.choice b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.choice small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.add { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--accent-text); background: none; border: 1px dashed var(--accent-line); border-radius: 9px; padding: 6px 11px; cursor: pointer; }
.add:hover { background: var(--accent-soft); }

/* Advanced settings */
details.adv { border-top: 1px solid var(--border); }
details.adv > summary { list-style: none; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 3px; padding: 14px 18px; cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); transition: background-color .15s; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary:hover { background: var(--surface-2); }
details.adv[open] > summary { border-radius: 0; border-bottom: 1px solid var(--border); }
.adv-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13.5px; color: var(--ink); }
.adv-title svg { width: 16px; height: 16px; color: var(--muted); }
.adv-sum { font-size: 12px; color: var(--muted); line-height: 1.45; }
details.adv > summary > .chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
details.adv[open] > summary > .chev { transform: rotate(180deg); }
details.adv[open] > .adv-body { animation: rise .25s ease; }
.group { border: 0; margin: 0; padding: 14px 18px 16px; min-width: 0; display: grid; gap: 12px; }
.group + .group { border-top: 1px solid var(--border); }
.group > legend { float: left; width: 100%; padding: 0; margin: 0; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
details.more { grid-column: 1 / -1; }
details.more > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 12.5px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 13px; height: 13px; transition: transform .2s; }
details.more[open] > summary svg { transform: rotate(90deg); }
details.more > .editor { margin-top: 10px; padding-top: 0; border-top: 0; animation: rise .25s ease; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; padding: 9px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background-color .15s, transform .15s, box-shadow .15s, color .15s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; flex: none; }
.app .btn.primary, .btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(15,118,110,.25), inset 0 1px 0 rgba(255,255,255,.14); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.app .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn.secondary:hover { border-color: var(--accent-line); }
.app .btn.ghost { background: none; color: var(--ink-2); border-color: var(--border); padding: 6px 11px; font-size: 12.5px; }
.app .btn.link { background: none; color: var(--accent-text); padding: 9px 6px; }
.btn.lg { padding: 11px 20px; font-size: 14.5px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.pulse { animation: pulse 2s ease-out infinite; }

/* Results */
.results { display: flex; flex-direction: column; gap: 16px; }
.results-head { position: sticky; top: 14px; z-index: 4; padding: 14px 18px; }
.card.results-head + * { margin-top: 0; }
.rh-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.rh-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rh-title h2 { font-size: 17px; margin: 0; font-weight: 650; }
.rh-status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.rh-status.ok::before, .rh-status.stale::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); }
.rh-status.stale { color: var(--warn-ink); }
.rh-status.stale::before { background: var(--warn-ink); }
.rh-status.bad { color: var(--danger-ink); font-weight: 600; }
.rh-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rh-sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.rh-sub svg { width: 15px; height: 15px; flex: none; }
.rh-sub.bad { color: var(--danger-ink); }
.rh-progress { margin-top: 12px; }
.rh-progress .bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rh-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 999px; transition: width .12s linear; }
.rh-progress .ptext { margin-top: 7px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ribbon { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-ink); font-size: 13px; animation: rise .25s ease; }
.ribbon svg { width: 17px; height: 17px; flex: none; }
.empty { padding: 46px 28px 50px; text-align: center; display: flex; flex-direction: column; align-items: center; background: radial-gradient(460px 230px at 50% 0%, var(--accent-soft), transparent 78%), var(--surface); }
.empty svg.art { width: 230px; height: 126px; margin-bottom: 18px; }
.empty h3 { margin: 0 0 8px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.empty p { margin: 0; color: var(--ink-2); max-width: 50ch; line-height: 1.6; }
.skeleton { display: grid; gap: 16px; }
.sk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sk { border-radius: 14px; background: linear-gradient(90deg, var(--skel-a) 0%, var(--skel-b) 50%, var(--skel-a) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk.tile { height: 96px; }
.sk.chart { height: 320px; border-radius: var(--radius); }
.output { display: flex; flex-direction: column; gap: 16px; transition: opacity .25s, filter .25s; }
.output > .card + .card { margin-top: 0; }
.output.dim { opacity: .45; filter: saturate(.5); }
.output.reveal > * { animation: rise .45s ease both; }
.output.reveal > :nth-child(2) { animation-delay: .08s; }
.output.reveal > :nth-child(3) { animation-delay: .16s; }
.output.reveal > :nth-child(4) { animation-delay: .24s; }
.output.reveal .tile { animation: rise .45s ease both; }
.output.reveal .tile:nth-child(2) { animation-delay: .06s; }
.output.reveal .tile:nth-child(3) { animation-delay: .12s; }
.output.reveal .tile:nth-child(4) { animation-delay: .18s; }
.summary { padding: 20px 20px 18px; }
.headline { margin: 0 0 16px; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 82ch; }
.headline b { color: var(--ink); font-weight: 650; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; }
.tile .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 24px; font-weight: 650; margin: 3px 0 2px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tile .range { margin-top: 9px; height: 6px; border-radius: 999px; background: var(--surface-3); position: relative; }
.tile .range span { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--chart-accent) 38%, transparent); }
.tile .range i { position: absolute; top: -3px; width: 4px; height: 12px; border-radius: 2px; background: var(--chart-accent); }
.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background-color .15s, color .15s; }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
:root[data-theme="dark"] .tabs button.on { background: var(--surface-3); }
.cur { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.chart-wrap { position: relative; padding: 8px 12px 4px; }
.chart { position: relative; width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); padding: 0 18px 14px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.legend i.line { height: 2.5px; border-radius: 2px; }
.lg-toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--muted); }
.lg-toggle input { accent-color: var(--accent); margin: 0; }
.cases-note { display: flex; gap: 9px; align-items: flex-start; margin: 0 18px 16px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.cases-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.cases-note .link-button { margin-left: 4px; font-size: 12.5px; }
.chart-svg text.tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-svg line.grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg line.axis { stroke: var(--axis); stroke-width: 1; }
.chart-svg .marker line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .marker text { font-size: 11px; fill: var(--ink-2); font-weight: 600; }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; opacity: .7; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 9px 11px; font-size: 12px; min-width: 180px; z-index: 5; display: none; }
.tip .h { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 7px; margin: 3px 0; white-space: nowrap; }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip .r em { font-style: normal; color: var(--muted); }
.tip .k { width: 12px; height: 2.5px; border-radius: 2px; flex: none; }
.tip .k.area { height: 9px; border-radius: 3px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.controls select.sel { width: auto; padding: 6px 9px; font-size: 12.5px; }
.table-wrap { overflow: auto; max-height: 440px; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 7px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 650; text-align: right; }
table.data thead th:first-child, table.data td:first-child { text-align: left; }
table.data td { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.neg { color: var(--danger-ink); }
table.data tr.mile td { background: var(--accent-soft); }
table.data td.sticky, table.data th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.data thead th.sticky { z-index: 3; background: var(--surface-2); }
table.data td .tag { display: inline-block; font-size: 11px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; margin-left: 6px; }
.table-foot { padding: 10px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.estimate { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; border-radius: 10px; padding: 9px 11px; margin-top: 10px; }
.estimate.ok { background: var(--accent-soft); color: var(--accent-soft-ink); }
.estimate.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-ink); }
.estimate.danger { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-ink); }
.estimate svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
/* Home */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; border-radius: 24px; padding: 42px 46px; margin-bottom: 22px; border: 1px solid var(--border); box-shadow: var(--shadow);
  background: radial-gradient(540px 320px at 86% 14%, color-mix(in srgb, var(--chart-accent) 16%, transparent), transparent 70%), radial-gradient(460px 280px at 4% 112%, color-mix(in srgb, var(--s1) 9%, transparent), transparent 70%), var(--surface); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--accent-soft-ink); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.eyebrow svg { width: 14px; height: 14px; }
.hero h1 { font-size: 38px; line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.03em; font-weight: 700; max-width: 17ch; }
.hero p { margin: 0 0 24px; font-size: 16px; color: var(--ink-2); max-width: 60ch; line-height: 1.62; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero svg.big { width: 176px; height: 176px; color: var(--ink); opacity: .92; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 30px; }
.pillar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); }
.pillar .pi { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.pillar .pi svg { width: 20px; height: 20px; }
.pillar h3 { margin: 12px 0 5px; font-size: 15px; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.section-title { font-size: 19px; font-weight: 650; margin: 6px 0 14px; letter-spacing: -0.01em; }
.engine-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 30px; }
.app a.ecard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; cursor: pointer; }
.app a.ecard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-line); }
.app a.ecard.wide { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; gap: 16px; background: linear-gradient(120deg, var(--surface) 0%, var(--surface) 45%, var(--accent-soft) 100%); }
.ecard .icon { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.ecard .icon svg { width: 21px; height: 21px; }
.ecard h3 { margin: 4px 0 0; font-size: 16px; }
.ecard.wide h3 { margin-top: 0; }
.ecard p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.58; flex: 1; }
.ecard .open { font-weight: 600; font-size: 13.5px; color: var(--accent-text); margin-top: 6px; display: inline-block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.two > * { min-width: 0; }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.prose h3 { margin: 0 0 10px; font-size: 16px; }
.prose p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.62; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 6px 0 0; padding-left: 0; list-style: none; color: var(--ink-2); }
.prose li { margin: 8px 0; line-height: 1.55; padding-left: 22px; position: relative; }
.prose li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-line); }
.prose li b { color: var(--ink); }
.prose svg.fan { width: 100%; height: 92px; margin: 2px 0 10px; display: block; }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 10px 0; color: var(--ink); }
details.dev { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.dev > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent-text); }
details.dev[open] > :not(summary) { animation: rise .25s ease; }
.story { background: linear-gradient(160deg, var(--surface) 0%, var(--surface) 55%, var(--t-peach-bg) 160%); }

/* Plan */
.plan-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.ptabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.ptabs button { background: none; border: 0; padding: 7px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; transition: background-color .15s, color .15s; }
.ptabs button.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
:root[data-theme="dark"] .ptabs button.on { background: var(--surface-3); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn-ink); display: inline-block; }
.ptab { display: none; }
.ptab.on { display: block; animation: rise .25s ease both; }
.plan-build { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.rail { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 28px); overflow-y: auto; padding: 2px; margin: -2px; }
.rail .card + .card { margin-top: 0; }
.psec + .psec { margin-top: 16px; }
.psec .card-head h2 { display: flex; align-items: center; gap: 9px; }
.psec .card-head h2 svg { width: 18px; height: 18px; color: var(--accent-text); }
.psec .count { font-size: 12px; color: var(--muted); font-weight: 500; }
.pitems { padding: 6px 12px 12px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 13px; margin-top: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.pitem:hover { border-color: var(--accent-line); }
.pitem .ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; font-weight: 700; }
.pitem .ic svg { width: 16px; height: 16px; }
.pitem .main-col { flex: 1; min-width: 0; }
.pitem .name { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pitem .desc { color: var(--ink-2); font-size: 12.5px; margin-top: 1px; }
.pitem .acts { display: flex; gap: 4px; color: var(--muted); }
.pitem .acts span { padding: 3px 7px; border-radius: 7px; cursor: pointer; }
.pitem .acts span:hover { background: var(--surface-2); }
.pitem.open { display: block; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.pitem.open .head { display: flex; align-items: center; gap: 12px; }
.pitem.dashed { border-style: dashed; background: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill.gray { background: var(--surface-3); color: var(--ink-2); }
.editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.drag { color: var(--border-strong); cursor: grab; font-size: 14px; letter-spacing: -2px; }
.order { width: 23px; height: 23px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.subnote { font-size: 12.5px; color: var(--muted); padding: 10px 12px 2px; }
.list-item { border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; display: flex; gap: 8px; align-items: center; font-size: 13px; background: var(--surface); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .sub { color: var(--muted); font-size: 12px; }
.list-item .x { color: var(--muted); cursor: pointer; }
.ref { color: var(--accent-text); font-style: normal; font-weight: 600; }
.menu-pop { position: absolute; right: 12px; top: 50px; width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 6; }
.menu-pop .mi { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.menu-pop .mi:hover { background: var(--surface-2); }
.menu-pop .mi .ic { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.menu-pop .mi svg { width: 15px; height: 15px; }
.menu-pop .mi strong { display: block; font-size: 13px; }
.menu-pop .mi span { display: block; font-size: 12px; color: var(--muted); }
.words { font-size: 13px; line-height: 1.62; color: var(--ink-2); }
.words p { margin: 0 0 8px; }
.words ol { margin: 0 0 8px; padding-left: 18px; }
.words b { color: var(--ink); font-weight: 600; }
.words i { color: var(--accent-text); font-style: normal; font-weight: 600; }
.check-ok { display: flex; gap: 8px; align-items: center; color: var(--ok-ink); font-size: 13px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; background: var(--surface); }
.chip .n { font-size: 11px; color: var(--muted); font-weight: 700; }
.rail-prog .bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.rail-prog .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 999px; }
.rail-prog .ptext { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes slidein { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ======================================================================
   The Settings page: the shared settings side by side, the tax rules below
   ====================================================================== */
.settings-grid { display: grid; gap: 18px; margin-top: 18px; }
.settings-grid > .card + .card { margin-top: 0; }

/* The Export page: the note that results aren't exported, a card to export and one to import, side by side when there's room. */
.export-note { display: flex; gap: 10px; align-items: flex-start; max-width: 980px; margin: 0 0 18px; padding: 11px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-line); color: var(--ink-2); font-size: 13px; line-height: 1.5; box-shadow: var(--shadow-sm); }
.export-note > svg { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--muted); }
.export-note p { margin: 0; }
.export-note b { color: var(--ink); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.export-grid > .card + .card { margin-top: 0; }
.export-grid .status { margin: 10px 0 0; }
.status.ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-soft-ink); }
.status.ok > svg { color: var(--accent-soft-ink); }
.parts-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.parts { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.parts li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.parts li:last-child { border-bottom: 0; }
.parts input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.parts label { font-weight: 600; font-size: 13.5px; cursor: pointer; }
.parts .part-status { grid-column: 2; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.parts .replaces { color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 6px; padding: 0 5px; }
.parts .cant { color: var(--danger-ink); }
.parts li.off label, .parts li.off input { color: var(--muted); cursor: default; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 4px; }
.link-box { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--input-bg); color: var(--ink); font: 12px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; word-break: break-all; resize: vertical; }
/* The file input lies over the whole drop area, so a click anywhere or a dropped file reaches it. */
.drop { position: relative; display: grid; justify-items: center; gap: 9px; text-align: center; padding: 26px 16px; border: 1.5px dashed var(--accent-line); border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; transition: border-color .15s; }
.drop:hover, .drop:focus-within { border-color: var(--accent); }
.drop > svg { width: 28px; height: 28px; color: var(--accent-text); }
.drop .drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.import-from { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.import-from .link-button, .export-actions .link-button { font-size: 12.5px; }
.import-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 12px; font-size: 13px; }
.import-links a { font-weight: 600; text-decoration: none; }
.import-problem { margin-bottom: 12px; padding: 10px 12px; border-radius: 11px; background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-ink); font-size: 13px; line-height: 1.5; }
.shared-groups { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.2fr) minmax(0, 1fr); }
.shared-groups .group + .group { border-top: 0; border-left: 1px solid var(--border); }
@media (max-width: 1100px) {
  .shared-groups { grid-template-columns: 1fr; }
  .shared-groups .group + .group { border-left: 0; border-top: 1px solid var(--border); }
}
.preset-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; padding: 16px 18px 6px; max-width: 620px; }
.status { margin: 8px 18px 4px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.status > svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.status .grow { flex: 1 1 260px; }
.status .btn { padding: 6px 12px; font-size: 12.5px; }
.status.changed { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.status .name-ig { flex: 0 1 220px; }
.status-error { margin: 0 18px 4px; }
.notes { margin: 4px 18px 8px; padding: 4px 14px; border-left: 3px solid var(--border-strong); font-size: 12.5px; color: var(--ink-2); }
.notes ul { margin: 6px 0; padding-left: 18px; }
.notes li { margin: 3px 0; }
details.tsec { border-top: 1px solid var(--border); }
details.tsec:first-of-type { margin-top: 12px; }
details.tsec > summary { list-style: none; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; padding: 12px 18px; cursor: pointer; transition: background-color .15s; }
details.tsec > summary::-webkit-details-marker { display: none; }
details.tsec > summary:hover { background: var(--surface-2); }
details.tsec > summary .tt { font-weight: 650; font-size: 13.5px; color: var(--ink); }
details.tsec > summary .ts { font-size: 12px; color: var(--muted); }
details.tsec > summary > svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
details.tsec[open] > summary > svg { transform: rotate(180deg); }
.tbody { padding: 4px 18px 16px; display: grid; gap: 12px; max-width: 900px; }
.years { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.years .field { width: 120px; }
.sublabel { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-top: 4px; }
table.bk { border-collapse: separate; border-spacing: 0 6px; width: 100%; max-width: 460px; }
table.bk th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
table.bk td { padding: 0 4px; vertical-align: top; }
table.bk td.x { width: 34px; text-align: center; }
.ig.ro-ig { background: var(--surface-2); }
.ig.ro-ig input { color: var(--muted); }
.rule-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; background: var(--surface); }
.rule-card .rh { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; }
.rule-card .rh small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.line-card { border: 1px dashed var(--border-strong); border-radius: 11px; padding: 10px 12px; display: grid; gap: 8px; }
.line-card > .link-button { justify-self: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.example { font-size: 12.5px; color: var(--ok-ink); background: color-mix(in srgb, var(--ok-dot) 10%, transparent); border-radius: 9px; padding: 8px 11px; }

/* What a page takes from the Settings page, under its essentials. */
.shared { display: flex; align-items: flex-start; gap: 9px; margin: 0 18px 14px; padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 12.5px; line-height: 1.45; }
.shared > svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.shared a { font-weight: 650; white-space: nowrap; text-decoration: none; margin-left: auto; color: var(--accent-text); }
.shared.problem { background: var(--warn-bg); color: var(--warn-ink); }
.psec .shared { margin: 4px 18px 16px; }

@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { animation: none !important; transition: none !important; }
}

/* A short window, such as a small laptop's: the menu tightens up so all of it still fits. */
@media (min-width: 761px) and (max-height: 720px) {
  .brand { padding: 14px 20px 10px; }
  .app .nav a { padding: 6px 12px; }
  .nav .indent { margin-bottom: 2px; }
  .foot-row { padding: 6px 12px; }
  .credit { margin-top: 6px; padding: 10px 12px 12px; }
}

/* Phone: the menu becomes a top bar that stays in view, and a drawer the height of the window. */
@media (max-width: 760px) {
  .preset-row, .grid3 { grid-template-columns: 1fr; }
  .years .field { width: 100px; }
  .sidebar { display: none; }
  .app.menu-open .sidebar { display: flex; position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 284px; height: auto; align-self: stretch; box-shadow: var(--shadow-lg); animation: slidein .2s ease; overflow-y: auto; }
  .app.menu-open .backdrop { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; }
  .content { padding: 18px 14px 28px; }
  .engine, .plan-build, .two { grid-template-columns: 1fr; }
  .results-head, .rail { position: static; max-height: none; overflow: visible; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; border-radius: 20px; }
  .hero svg.big { display: none; }
  .hero h1 { font-size: 28px; }
  .disclaimer { padding: 14px 16px 18px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .value { font-size: 20px; }
  .page-head h1 { font-size: 22px; }
  .ph-icon { width: 42px; height: 42px; border-radius: 13px; }
  details.how { margin-left: 0; }
  .sk-tiles { grid-template-columns: 1fr 1fr; }
  .app a.ecard.wide { flex-direction: column; }
}

/* The site around the mockup's app */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); text-align: center; padding: 24px; }
.splash img { animation: fade .6s ease both; }
.splash strong { font-size: 17px; color: var(--ink); }
.splash span { font-size: 13px; max-width: 34ch; }
#blazor-error-ui { display: none; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--danger-bg); color: var(--danger-ink); border: 1px solid var(--danger-border); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow-lg); gap: 12px; align-items: center; }
#blazor-error-ui .reload { font-weight: 600; color: inherit; }
.brand img { width: 46px; height: 46px; flex: none; }
.topbar img.logo { width: 32px; height: 32px; }
.hero img.big { width: 176px; height: 176px; }
.hero .logo-dark { display: none; }
:root[data-theme="dark"] .hero .logo-light { display: none; }
:root[data-theme="dark"] .hero .logo-dark { display: inline; }
.error-card { padding: 16px 18px; border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-ink); font-size: 13.5px; }
.error-card b { display: block; margin-bottom: 4px; }
.issues { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.issues li { display: flex; gap: 8px; align-items: flex-start; color: var(--danger-ink); }
.issues li b { color: var(--ink); font-weight: 600; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; font-size: inherit; }
.icon-button { background: none; border: 0; padding: 3px 7px; border-radius: 7px; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.icon-button:disabled { opacity: .35; cursor: default; background: none; }
.card-head .act { background: none; border: 0; color: var(--accent-text); font-weight: 600; }
.chart-wrap .hover { position: absolute; cursor: crosshair; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg text.tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.legend .swatch { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.legend .swatch.line { height: 2.5px; border-radius: 2px; }
.pitem .acts button { background: none; border: 0; padding: 3px 7px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 13px; }
.pitem .acts button:hover { background: var(--surface-2); color: var(--ink); }
.pitem .acts button.danger:hover { color: var(--danger-ink); }
.confirm { margin-top: 10px; padding: 10px 12px; border-radius: 11px; background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-ink); font-size: 12.5px; display: grid; gap: 8px; grid-column: 1 / -1; }
.confirm .row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-menu { position: relative; }
.menu-pop button.mi { width: 100%; background: none; border: 0; text-align: left; color: inherit; }
.empty-list { color: var(--muted); font-size: 12.5px; padding: 10px 2px 2px; }
.field.wide { grid-column: 1 / -1; }
