/* StatsToTable — interface styles
   Palette: navy #1B3A57, rust #A84B2A, panel #F4F6F8
*/
:root {
  --ink: #1f2328;
  --navy: #1b3a57;
  --navy-soft: #2c5478;
  --rust: #a84b2a;
  --muted: #626b76;
  --line: #d5dbe2;
  --panel: #f4f6f8;
  --panel-2: #edf2f6;
  --white: #ffffff;
  --ok: #2e7d32;
  --warn: #b26a00;
  --bad: #b04e2f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27, 58, 87, .06), 0 8px 24px rgba(27, 58, 87, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0; }
p { margin: 0 0 12px; }
code, .mono { font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; font-size: .92em; }

/* ---------------------------------------------------------------- chrome */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.94);
  backdrop-filter: blur(6px); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: block; flex: none;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.topnav { display: flex; gap: 22px; font-size: 13.5px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--navy); }

.sitefooter {
  border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 32px 40px;
  color: var(--muted); font-size: 12.5px; text-align: center;
}
.sitefooter p { margin: 0 0 4px; }
.subtle { color: #8b939c; font-size: 11.5px; }

/* ------------------------------------------------------------------ home */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.hero { text-align: center; padding: 64px 0 0; }
.hero h1 {
  font-size: 40px; letter-spacing: -.022em; margin-bottom: 14px;
  max-width: 820px; margin-left: auto; margin-right: auto;
}
.hero .lede { font-size: 16.5px; color: var(--muted); max-width: 660px; margin: 0 auto 34px; }

.dropzone {
  border: 2px dashed var(--navy); border-radius: 18px; background: var(--panel-2);
  padding: 44px 24px; cursor: pointer; transition: background .15s, border-color .15s;
  max-width: 760px; margin: 0 auto;
}
.dropzone:hover, .dropzone.dragging { background: #e4ecf4; }
.dropzone .arrow {
  width: 52px; height: 52px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center;
  margin: 0 auto 18px; font-size: 22px; color: var(--navy);
}
.dropzone strong { display: block; font-size: 19px; color: var(--navy); margin-bottom: 6px; }
.dropzone span { color: var(--muted); font-size: 13.5px; }
.dropzone .hint { display: block; margin-top: 14px; font-size: 12.5px; color: #8b939c; }

.chips { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 18px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 9px 20px; font-size: 13.5px; color: var(--muted); cursor: pointer;
  font-family: inherit;
}
.chip:hover { border-color: var(--navy); color: var(--navy); background: #fff; }

.trustbar {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px;
  color: var(--muted); font-size: 13px; text-align: center;
  max-width: 760px; margin: 0 auto;
}

.section { margin-top: 52px; }
.section h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.recent { display: grid; gap: 8px; max-width: 760px; margin: 0 auto; }
.recent-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--panel); border-radius: 10px; padding: 12px 16px; font-size: 14px;
  cursor: pointer;
}
.recent-row:hover { background: var(--panel-2); }
.recent-row .meta { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------- app shell */
.appbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff;
}
.appbar .file { font-weight: 600; color: var(--navy); }
.appbar .spacer { flex: 1; }
.badge {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
}
.badge.ok { color: var(--ok); border-color: #cfe3d0; background: #f0f7f0; }
.badge.warn { color: var(--warn); border-color: #f0e2c6; background: #fdf6e9; }
.badge.bad { color: var(--bad); border-color: #f3d8d1; background: #fdf1ed; }

.btn {
  font-family: inherit; font-size: 14px; border-radius: 9px; padding: 9px 18px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
}
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.btn.primary:hover { background: var(--navy-soft); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

/* ------------------------------------------------------------- workbench */
.workbench { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 190px); }
.sidebar { border-right: 1px solid var(--line); background: var(--panel); padding: 18px 0; }
.sidebar h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 18px 10px; }
.varsearch { margin: 0 14px 12px; }
.varsearch input {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  font-family: inherit; font-size: 13px; background: #fff;
}
.varlist { max-height: calc(100vh - 320px); overflow-y: auto; padding: 0 8px; }
.varrow {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 8px; font-size: 13.5px;
}
.varrow:hover { background: #fff; }
.varrow.selected { background: #fff; box-shadow: inset 0 0 0 2px var(--navy); }
.typechip {
  font-size: 10.5px; text-align: center; padding: 3px 2px; border-radius: 5px;
  color: #fff; font-weight: 600; letter-spacing: .02em; cursor: pointer; border: none;
  font-family: inherit; width: 100%; max-width: 64px;
}
.typechip.scale { background: var(--navy); }
.typechip.nominal { background: var(--rust); }
.typechip.ordinal { background: var(--warn); }
.typechip option { color: var(--ink); background: #fff; }
.varrow .vname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.varrow .vnote { color: var(--muted); font-size: 11.5px; }

.main { padding: 26px 32px 60px; max-width: 940px; }
.main h2 { font-size: 21px; margin-bottom: 6px; }
.main .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.qcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.qcard {
  border: 1px solid var(--line); background: var(--panel); border-radius: 11px;
  padding: 14px 16px; cursor: pointer; text-align: left; font-family: inherit;
}
.qcard:hover { border-color: var(--navy); background: #fff; }
.qcard.active { border: 2px solid var(--navy); background: #fff; padding: 13px 15px; }
.qcard strong { display: block; color: var(--navy); font-size: 15px; margin-bottom: 3px; }
.qcard span { color: var(--muted); font-size: 12.5px; }

.setup { display: grid; gap: 14px; margin-bottom: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--navy); }
.field select, .field input[type=text] {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.multiselect {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  display: flex; flex-wrap: wrap; gap: 6px; background: #fff; max-height: 150px; overflow-y: auto;
}
.toggle {
  display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink);
  cursor: pointer;
}
.toggle input { width: 16px; height: 16px; accent-color: var(--navy); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.rec {
  border: 2px solid var(--navy); border-radius: var(--radius); background: #fff;
  padding: 18px 20px 18px 26px; position: relative; margin: 20px 0;
}
.rec::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 5px;
  background: var(--rust); border-radius: 4px;
}
.rec h3 { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec ul { margin: 0; padding-left: 18px; color: var(--ink); font-size: 14px; }
.rec li { margin-bottom: 5px; }
.rec .alt {
  margin-top: 12px; background: var(--panel); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--muted);
}

.assumptions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.assume {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: #fff;
}
.assume .head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.muted { background: #9aa3ad; }
.assume .detail { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- result */
.result { padding: 26px 32px 70px; max-width: 1060px; margin: 0 auto; }
.headline {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin: 18px 0 26px;
}
.headline .kicker { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--rust); font-weight: 700; }
.headline p { margin: 6px 0 0; font-size: 16px; }

.resultgrid { display: grid; grid-template-columns: 1fr 290px; gap: 30px; align-items: start; }
@media (max-width: 900px) { .resultgrid { grid-template-columns: 1fr; } }

.caption { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }

table.threeline { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 10px; }
table.threeline thead th {
  border-top: 1.5px solid #000; border-bottom: .75px solid #000;
  padding: 8px 10px; text-align: right; font-weight: 600; color: var(--ink);
}
table.threeline thead th:first-child { text-align: left; }
table.threeline tbody td { padding: 7px 10px; text-align: right; border: none; }
table.threeline tbody td:first-child { text-align: left; }
table.threeline tbody tr:last-child td { border-bottom: 1.5px solid #000; }
.tablenote { font-size: 12px; color: var(--muted); line-height: 1.5; }

.details { display: grid; gap: 0; border-top: 1px solid var(--line); }
.detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.detail-row span:first-child { color: var(--muted); }
.detail-row span:last-child { font-weight: 600; color: var(--ink); }

.apablock {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #fff; margin-top: 22px;
}
.apablock h3 { font-size: 14px; margin-bottom: 8px; }
.apablock p { font-size: 14px; margin: 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* --------------------------------------------------------------- checkup */
.checkgrid { display: grid; grid-template-columns: 300px 1fr; gap: 30px; padding: 26px 32px 60px; max-width: 1080px; margin: 0 auto; align-items: start; }
@media (max-width: 860px) { .checkgrid { grid-template-columns: 1fr; } }
.scorecard { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.scorecard .grade { font-size: 52px; font-weight: 700; line-height: 1; margin: 6px 0 10px; }
.grade.ok { color: var(--ok); }
.grade.warn { color: var(--warn); }
.grade.bad { color: var(--bad); }
.scorecard .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.issue { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.issue .title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.issue .detail { color: var(--muted); font-size: 13px; margin-top: 5px; }
.issue .fix { color: var(--rust); font-size: 13px; margin-top: 5px; }

/* ---------------------------------------------------------------- tables */
.vartable { width: 100%; border-collapse: collapse; font-size: 13px; }
.vartable th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.vartable td { padding: 7px 10px; border-bottom: 1px solid #eef1f4; }
.vartable tr:hover td { background: var(--panel); }

/* ----------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 32, 44, .45); display: grid;
  place-items: center; z-index: 60; padding: 24px;
}
.modal {
  background: #fff; border-radius: 14px; width: min(680px, 100%); padding: 24px;
  box-shadow: 0 20px 60px rgba(20,32,44,.28);
}
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--muted); font-size: 13.5px; }
.modal textarea {
  width: 100%; height: 220px; font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; resize: vertical;
}
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ------------------------------------------------------------------ misc */
.alert { border-radius: 10px; padding: 13px 16px; font-size: 13.5px; margin: 16px 0; }
.alert.error { background: #fdf1ed; border: 1px solid #f3d8d1; color: #8a3a24; }
.alert.info { background: var(--panel-2); border: 1px solid var(--line); color: var(--navy); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { color: var(--muted); font-size: 14px; padding: 24px 0; }
.center { text-align: center; }
.mt24 { margin-top: 24px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.skip { position: absolute; left: -9999px; }

/* --------------------------------------------------------------- pricing */
.planwrap { margin-left: 20px; }
.planwrap .badge { cursor: pointer; }

.pricing { max-width: 980px; margin: 0 auto; padding: 52px 0 40px; }
.pricing h1 { font-size: 34px; letter-spacing: -.02em; margin-bottom: 8px; }
.pricing .lede { color: var(--muted); font-size: 16px; margin-bottom: 26px; }

.plangrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; align-items: stretch; margin: 26px 0 20px;
}
.plancard {
  border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px;
  background: #fff; display: flex; flex-direction: column; position: relative;
}
.plancard.featured { border: 2px solid var(--navy); box-shadow: var(--shadow); }
.plancard h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.plancard .price { font-size: 38px; font-weight: 700; color: var(--navy); line-height: 1; }
.plancard .price span { font-size: 13.5px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.plannote { font-size: 12.5px; color: var(--rust); margin-top: 6px; font-weight: 600; }
.planlist { list-style: none; padding: 0; margin: 18px 0 22px; flex: 1; }
.planlist li {
  font-size: 13.5px; color: var(--ink); padding: 6px 0 6px 22px; position: relative;
  border-bottom: 1px solid #f0f3f6;
}
.planlist li:last-child { border-bottom: none; }
.planlist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.planbtn { width: 100%; }
.planstate { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 0; }
.ribbon {
  position: absolute; top: -11px; right: 18px; background: var(--rust); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px;
}
.pricingfoot { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.plangrid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 760px; }
.meter {
  display: inline-block; margin: 4px 0 20px; padding: 9px 16px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink);
}
.meter strong { color: var(--navy); }

/* =====================================================================
   Responsive
   Breakpoints: 1024 (small laptop), 860 (tablet / workbench collapse),
   600 (phone). Tables scroll rather than squash; the variable panel folds
   away on small screens behind a toggle.
   ===================================================================== */

/* Wide tables get their own scroll container so the page never scrolls sideways. */
.tablewrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.tablewrap table { margin-bottom: 0; }

.varstoggle { display: none; }

.workbench {
  min-height: calc(100vh - 190px);
  min-height: calc(100dvh - 190px);
}

@media (max-width: 1024px) {
  .wrap { padding: 0 18px; }
  .main { padding: 22px 22px 48px; }
  .result { padding: 20px 22px 56px; }
  .checkgrid { padding: 20px 22px 48px; gap: 22px; }
  .workbench { grid-template-columns: 250px 1fr; }
  .hero h1 { font-size: 34px; }
}

@media (max-width: 860px) {
  .workbench { grid-template-columns: 1fr; }
  .sidebar {
    display: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
  }
  .workbench.vars-open .sidebar { display: block; }
  .varstoggle { display: inline-block; }
  .varlist { max-height: 42vh; }
  .resultgrid { grid-template-columns: 1fr; gap: 22px; }
  .checkgrid { grid-template-columns: 1fr; }
  .appbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; }
  .appbar .file { flex: 1 1 100%; order: -1; font-size: 15px; }
  .appbar .spacer { display: none; }
  .scorecard { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: center; }
  .scorecard .kicker { grid-column: 1 / -1; }
  .scorecard .grade { margin: 0; }
  .scorecard p { grid-column: 1 / -1; margin-top: 12px !important; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; }
  .brand-name { font-size: 16px; }
  .planwrap { margin-left: auto; }
  .topnav {
    order: 3; width: 100%; gap: 6px 18px; flex-wrap: wrap;
    font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px;
  }
  .topnav a { white-space: nowrap; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(25px, 7.2vw, 32px); letter-spacing: -.015em; }
  .hero .lede { font-size: 14.5px; margin-bottom: 22px; }
  .dropzone { padding: 28px 16px; border-radius: 14px; }
  .dropzone strong { font-size: 16px; }
  .dropzone .arrow { width: 44px; height: 44px; font-size: 18px; margin-bottom: 14px; }
  .chips { gap: 8px; }
  .chip { padding: 9px 14px; font-size: 13px; }
  .trustbar { font-size: 12px; padding: 10px 12px; }
  .section { margin-top: 36px; }

  .main { padding: 18px 14px 44px; }
  .main h2 { font-size: 19px; }
  .result { padding: 16px 14px 48px; }
  .checkgrid { padding: 16px 14px 40px; gap: 18px; }

  .qcards { grid-template-columns: 1fr; gap: 10px; }
  .qcard { padding: 13px 15px; }
  .qcard.active { padding: 12px 14px; }

  .row-actions { flex-direction: column; }
  .row-actions .btn { width: 100%; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }

  .headline { padding: 14px 16px; }
  .headline p { font-size: 15px; }
  .apablock { padding: 14px; }
  .tablenote { font-size: 11.5px; }

  .pricing { padding: 32px 0 28px; }
  .pricing h1 { font-size: 26px; }
  .pricing .lede { font-size: 14.5px; }
  .plangrid { grid-template-columns: 1fr; gap: 14px; }

  .modal { padding: 18px; border-radius: 12px; }
  .modal textarea { height: 150px; }
  .modal-backdrop { padding: 14px; align-items: end; }

  .scorecard .grade { font-size: 40px; }
  .assumptions { grid-template-columns: 1fr; }
  .details .detail-row { font-size: 12.5px; }

  /* 16px keeps iOS from zooming when a control receives focus. */
  .field select, .field input[type=text], .modal input, .modal textarea { font-size: 16px; }
  .varsearch input { font-size: 16px; }
  .typechip { font-size: 15px; max-width: 84px; padding: 4px 2px; }
  .varrow { grid-template-columns: 84px 1fr auto; padding: 8px 10px; gap: 10px; }

  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .toggle { font-size: 14px; padding: 4px 0; }

  .hide-sm { display: none; }
  .tablewrap table { min-width: 460px; }
  .tablewrap .vartable { min-width: 520px; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
  .hero h1 { font-size: 24px; }
  .chip { padding: 8px 12px; font-size: 12.5px; }
  .typechip { max-width: 76px; }
  .varrow { grid-template-columns: 76px 1fr auto; }
}

/* Touch devices: no sticky hover states, and comfortable hit areas. */
@media (hover: none) {
  .qcard:hover, .varrow:hover, .recent-row:hover, .chip:hover { background: inherit; }
  .qcard:hover { border-color: var(--line); }
  .chip:hover { border-color: var(--line); color: var(--muted); }
  .btn:hover { border-color: var(--line); }
  .btn.primary:hover { background: var(--navy); }
}

/* Respect the notch and home indicator. */
@supports (padding: env(safe-area-inset-bottom)) {
  .sitefooter { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  @media (max-width: 720px) {
    .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  }
}

@media print {
  .topbar, .sitefooter, .actions, .appbar, .varstoggle { display: none !important; }
  .result { padding: 0; max-width: none; }
  .resultgrid { grid-template-columns: 1fr; }
}

/* Pre-checkout disclosures. One screen, two independent agreements. The body
   scrolls so a long policy cannot push the buttons off a small screen. */
.consentbody { max-height: min(44vh, 360px); overflow-y: auto; margin: 4px 0 14px; }
.consentsection {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 12px 14px; margin-bottom: 12px;
}
.consentsection h4 {
  margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--navy); font-weight: 700;
}
.consentsection p { font-size: 13.5px; line-height: 1.6; margin: 0 0 8px; color: var(--ink); }
.consentsection ul { margin: 0; padding-left: 18px; }
.consentsection li { font-size: 13px; line-height: 1.55; margin-bottom: 6px; color: var(--muted); }
.consentsection .hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.consentcheck {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13.5px; line-height: 1.55; margin-bottom: 10px;
  transition: border-color .12s, background .12s;
}
.consentcheck.ticked { border-color: var(--navy); background: #eef4f9; }
.consentcheck input {
  margin-top: 2px; flex: none; width: 17px; height: 17px; accent-color: var(--navy);
}
@media (max-width: 600px) {
  .consentbody { max-height: 38vh; }
  .consentcheck { font-size: 13px; padding: 10px 12px; }
  .consentsection { padding: 10px 12px; }
}

/* Three claims under the plan cards. These are the reasons to pay that are not
   "unlimited exports", so they get their own band rather than a feature line. */
.whyrow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin: 8px 0 22px;
  border-top: 1px solid var(--line); padding-top: 26px;
}
.whyrow strong { display: block; font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.whyrow p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }
@media (max-width: 600px) {
  .whyrow { gap: 16px; padding-top: 20px; }
  .whyrow p { font-size: 13px; }
}
