/* EZ Roofing portal. Tokens per SPEC.md; every page and the report templates use them. */
:root {
  --ink:#14213d; --paper:#fbfaf7; --card:#ffffff; --line:#e7e2d8; --accent:#ff6b35; --accent-ink:#7a2e0e;
  --ok:#1f9d6b; --warn:#d98e04; --bad:#c8402f; --sky:#2b6cb0; --radius:14px;
  --muted:#5b6478; --soft:#f3efe6; --accent-soft:#fff0e8; --ok-soft:#e5f5ee; --warn-soft:#fdf3dc; --bad-soft:#fbe9e6; --sky-soft:#e8f0fa;
  --btn-ink:#ffffff; --shadow:0 1px 2px rgba(20,33,61,.06), 0 6px 20px rgba(20,33,61,.06);
  --s1:#257de0; --s2:#f47230; --s3:#00b894; --grid:#ece8df;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:#eef1f7; --paper:#0e1524; --card:#162033; --line:#2a3650; --accent:#ff7a47; --accent-ink:#ffb48f;
    --ok:#3cc28b; --warn:#f0a92a; --bad:#ef6b5b; --sky:#6aa5e8; --muted:#9aa5bd; --soft:#1b2740;
    --accent-soft:#3a2219; --ok-soft:#14322a; --warn-soft:#3a2d12; --bad-soft:#3b1d1a; --sky-soft:#17294a;
    --btn-ink:#1a0d06; --shadow:0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --s1:#338ced; --s2:#e76624; --s3:#00a888; --grid:#24304a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink:#eef1f7; --paper:#0e1524; --card:#162033; --line:#2a3650; --accent:#ff7a47; --accent-ink:#ffb48f;
  --ok:#3cc28b; --warn:#f0a92a; --bad:#ef6b5b; --sky:#6aa5e8; --muted:#9aa5bd; --soft:#1b2740;
  --accent-soft:#3a2219; --ok-soft:#14322a; --warn-soft:#3a2d12; --bad-soft:#3b1d1a; --sky-soft:#17294a;
  --btn-ink:#1a0d06; --shadow:0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --s1:#338ced; --s2:#e76624; --s3:#00a888; --grid:#24304a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin:0; background:var(--paper); color:var(--ink); font:16px/1.55 var(--font); overflow-x:hidden; }
img, svg { max-width:100%; }
a { color:var(--sky); text-underline-offset:2px; }
a:hover { color:var(--accent-ink); }
h1, h2, h3 { font-family:var(--font-display); line-height:1.2; letter-spacing:-.015em; margin:0 0 .5em; }
h1 { font-size:clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight:750; }
h2 { font-size:1.25rem; font-weight:700; }
h3 { font-size:1.05rem; font-weight:650; }
p { margin:0 0 1em; }
small, .muted { color:var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size:.9em; }
:focus-visible { outline:3px solid var(--accent); outline-offset:2px; border-radius:6px; }
.skip { position:absolute; left:-999px; top:8px; background:var(--card); padding:8px 14px; border-radius:8px; z-index:99; }
.skip:focus { left:8px; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.wrap { width:100%; max-width:1120px; margin:0 auto; padding:0 16px; }

/* ---------- header */
.top { background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.top::after { content:""; display:block; height:6px; background:url("/static/roofline.svg") repeat-x left top / 48px 6px; opacity:.9; }
.top .wrap { display:flex; align-items:center; gap:14px; min-height:62px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); font-weight:800; font-size:1.12rem; letter-spacing:-.02em; white-space:nowrap; }
.brand img { width:34px; height:34px; }
.brand .tag { font-size:.7rem; font-weight:700; color:var(--accent-ink); background:var(--accent-soft); padding:2px 8px; border-radius:99px; letter-spacing:.02em; }
.nav { display:flex; gap:2px; margin-left:8px; overflow-x:auto; scrollbar-width:none; flex:1; }
.nav::-webkit-scrollbar { display:none; }
.nav a { padding:8px 12px; border-radius:10px; text-decoration:none; color:var(--muted); font-weight:600; font-size:.95rem; white-space:nowrap; }
.nav a:hover { background:var(--soft); color:var(--ink); }
.nav a[aria-current="page"] { color:var(--ink); background:var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.who { display:flex; align-items:center; gap:10px; margin-left:auto; }
.avatar { width:34px; height:34px; border-radius:50%; background:var(--ink); color:var(--paper); display:grid; place-items:center; font-weight:700; font-size:.85rem; flex:none; }
.who form { margin:0; }
.demo-banner { background:repeating-linear-gradient(135deg, var(--warn-soft) 0 12px, transparent 12px 24px); border-bottom:1px solid var(--line); text-align:center; font-weight:700; font-size:.85rem; padding:6px 16px; color:var(--ink); }
@media (max-width: 760px) {
  .top .wrap { flex-wrap:wrap; gap:6px 10px; padding-top:8px; }
  .nav { order:3; flex-basis:100%; margin:0 -16px; padding:0 12px 8px; }
  .who .name { display:none; }
}

main.wrap { padding-top:28px; padding-bottom:56px; min-height:60vh; }
footer.foot { border-top:1px solid var(--line); color:var(--muted); font-size:.85rem; padding:20px 0 32px; }
footer.foot .wrap { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; }

/* ---------- building blocks */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); min-width:0; }
.card + .card { margin-top:18px; }
.card h2:first-child, .card h3:first-child { margin-top:0; }
.card.flat { box-shadow:none; }
.card.accent { border-top:4px solid var(--accent); }
.grid { display:grid; gap:18px; }
.grid > * { min-width:0; }
.g2 { grid-template-columns:repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns:repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns:repeat(4, minmax(0,1fr)); }
.side { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
@media (max-width: 900px) { .g4 { grid-template-columns:repeat(2, minmax(0,1fr)); } .g3, .side { grid-template-columns:minmax(0,1fr); } }
@media (max-width: 560px) { .g2, .g4 { grid-template-columns:minmax(0,1fr); } .card { padding:18px; } }
.stack > * + * { margin-top:18px; }
.row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.row.between { justify-content:space-between; }
.page-head { display:flex; flex-wrap:wrap; gap:12px 20px; align-items:flex-end; justify-content:space-between; margin-bottom:22px; }
.page-head h1 { margin:0; }
.page-head p { margin:4px 0 0; color:var(--muted); }
.crumbs { font-size:.9rem; margin-bottom:6px; }
.crumbs a { color:var(--muted); }
hr.soft { border:0; border-top:1px dashed var(--line); margin:18px 0; }

/* ---------- buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 18px; border-radius:11px; border:1px solid transparent;
  font:600 1rem/1.1 var(--font); cursor:pointer; text-decoration:none; background:var(--accent); color:var(--btn-ink); transition:transform .06s ease, filter .15s; }
.btn:hover { filter:brightness(1.05); color:var(--btn-ink); }
.btn:active { transform:translateY(1px); }
.btn.big { min-height:54px; font-size:1.08rem; padding:14px 26px; border-radius:13px; box-shadow:0 6px 18px rgba(255,107,53,.28); }
.btn.ghost { background:transparent; color:var(--ink); border-color:var(--line); }
.btn.ghost:hover { background:var(--soft); color:var(--ink); }
.btn.dark { background:var(--ink); color:var(--paper); }
.btn.danger { background:transparent; color:var(--bad); border-color:color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover { background:var(--bad-soft); color:var(--bad); }
.btn.small { min-height:34px; padding:6px 12px; font-size:.9rem; border-radius:9px; }
.btn.block { width:100%; }
.btn[disabled], .btn.is-busy { opacity:.6; cursor:progress; }
.linkbtn { background:none; border:0; padding:0; color:var(--sky); font:inherit; text-decoration:underline; cursor:pointer; }

/* ---------- forms */
form.f { display:grid; gap:16px; }
.field { display:grid; gap:6px; min-width:0; }
.field label { font-weight:650; font-size:.95rem; }
.field .hint { font-size:.85rem; color:var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width:100%; min-height:46px; padding:10px 13px; border:1.5px solid var(--line); border-radius:11px; background:var(--card); color:var(--ink); font:inherit; }
textarea { min-height:96px; resize:vertical; }
input:focus, select:focus, textarea:focus { border-color:var(--accent); outline:3px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset:0; }
input[type=color] { width:64px; height:46px; padding:4px; border:1.5px solid var(--line); border-radius:11px; background:var(--card); }
input[type=file] { font:inherit; max-width:100%; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color:var(--bad); }
.err { color:var(--bad); font-size:.88rem; font-weight:600; }
.err:empty { display:none; }
.f .two { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.f .three { display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px; }
@media (max-width: 560px) { .f .two, .f .three { grid-template-columns:minmax(0,1fr); } }
.inline-form { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; }
.inline-form .field { flex:1 1 160px; }
fieldset { border:1px solid var(--line); border-radius:12px; padding:14px; margin:0; min-width:0; }
legend { font-weight:650; padding:0 6px; }
.choice { display:flex; gap:8px; align-items:center; }

/* ---------- alerts / pills */
.flash { border-radius:12px; padding:12px 16px; margin-bottom:20px; font-weight:600; border:1px solid; }
.flash.ok { background:var(--ok-soft); border-color:color-mix(in srgb, var(--ok) 35%, transparent); }
.flash.bad { background:var(--bad-soft); border-color:color-mix(in srgb, var(--bad) 35%, transparent); }
.flash.info { background:var(--sky-soft); border-color:color-mix(in srgb, var(--sky) 35%, transparent); }
.pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:99px; font-size:.8rem; font-weight:700; white-space:nowrap; background:var(--soft); color:var(--ink); }
.pill::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.8; }
.pill.submitted { background:var(--sky-soft); color:var(--sky); }
.pill.in_progress { background:var(--warn-soft); color:color-mix(in srgb, var(--warn) 75%, var(--ink)); }
.pill.needs_info { background:var(--accent-soft); color:var(--accent-ink); }
.pill.approved { background:var(--ok-soft); color:var(--ok); }
.pill.delivered { background:var(--ok); color:#fff; }
.pill.cancelled, .pill.disabled, .pill.failed { background:var(--bad-soft); color:var(--bad); }
.pill.active, .pill.sent, .pill.paid { background:var(--ok-soft); color:var(--ok); }
.pill.past_due, .pill.partially_refunded { background:var(--warn-soft); color:color-mix(in srgb, var(--warn) 75%, var(--ink)); }
.pill.refunded, .pill.canceled, .pill.none { background:var(--soft); color:var(--muted); }
.pill.role { background:var(--ink); color:var(--paper); }
.pill.role::before { display:none; }

/* ---------- hero numbers / tiles */
.kpi { padding:18px 20px; }
.kpi .label { font-size:.85rem; font-weight:650; color:var(--muted); }
.kpi .value { font-family:var(--font-display); font-size:clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight:780; letter-spacing:-.02em; line-height:1.15; margin-top:4px; }
.kpi .sub { font-size:.82rem; color:var(--muted); margin-top:2px; }
.kpi .up { color:var(--ok); font-weight:700; }
.kpi .down { color:var(--bad); font-weight:700; }
.credits-hero { display:flex; align-items:center; gap:18px; }
.credits-hero .num { font-family:var(--font-display); font-size:3.2rem; font-weight:800; letter-spacing:-.04em; line-height:1; }

/* ---------- landing */
.hero { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:40px; align-items:center; padding:20px 0 30px; }
.hero h1 { font-size:clamp(2rem, 1.3rem + 2.8vw, 3.2rem); letter-spacing:-.03em; }
.hero h1 em { font-style:normal; color:var(--accent); }
.hero .lead { font-size:1.15rem; color:var(--muted); max-width:34em; }
.hero-art { width:100%; height:auto; }
.ticks { list-style:none; padding:0; margin:18px 0 0; display:grid; gap:8px; }
.ticks li { padding-left:30px; position:relative; }
.ticks li::before { content:""; position:absolute; left:0; top:3px; width:20px; height:20px; border-radius:50%; background:var(--ok-soft) url("/static/check.svg") center / 12px no-repeat; }
.signin-card { max-width:440px; }
@media (max-width: 860px) { .hero { grid-template-columns:minmax(0,1fr); gap:22px; } .hero-art { max-height:220px; } }
.plans { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
@media (max-width: 900px) { .plans { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width: 420px) { .plans { grid-template-columns:minmax(0,1fr); } }
.plan { border:1.5px solid var(--line); border-radius:var(--radius); padding:18px; background:var(--card); display:flex; flex-direction:column; gap:6px; position:relative; }
.plan .n { font-size:1.9rem; font-weight:800; font-family:var(--font-display); letter-spacing:-.03em; line-height:1; }
.plan .price { font-weight:700; font-size:1.1rem; }
.plan .per { font-size:.85rem; color:var(--muted); }
.plan form { margin-top:auto; padding-top:8px; }
.plan.best { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.plan .badge { position:absolute; top:-11px; right:12px; background:var(--accent); color:var(--btn-ink); font-size:.72rem; font-weight:800; padding:3px 9px; border-radius:99px; }
.selfserve { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:22px; align-items:center; }
@media (max-width: 760px) { .selfserve { grid-template-columns:minmax(0,1fr); } }
.bigprice { font-family:var(--font-display); font-size:2.4rem; font-weight:800; letter-spacing:-.03em; }
.bigprice s { color:var(--muted); font-size:1.3rem; font-weight:600; margin-right:8px; }
.bigprice small { font-size:1rem; font-weight:600; }

/* ---------- tables */
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--card); }
table.t { width:100%; border-collapse:collapse; font-size:.93rem; }
table.t th { text-align:left; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; background:var(--soft); }
table.t th, table.t td { padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:top; }
table.t tr:last-child td { border-bottom:0; }
table.t td.num, table.t th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
table.t tbody tr:hover { background:color-mix(in srgb, var(--soft) 60%, transparent); }
table.t a { font-weight:600; }
.empty { text-align:center; padding:34px 18px; color:var(--muted); }
.empty img { width:120px; height:auto; display:block; margin:0 auto 10px; }
.empty strong { display:block; color:var(--ink); font-size:1.08rem; margin-bottom:4px; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; margin-bottom:14px; }
.toolbar .field { flex:0 1 200px; }
.toolbar .grow { flex:1 1 220px; }

/* ---------- order list cards (client) */
.olist { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.olist a.o { display:flex; gap:14px; align-items:center; justify-content:space-between; padding:14px 16px; border:1px solid var(--line); border-radius:12px;
  text-decoration:none; color:var(--ink); background:var(--card); }
.olist a.o:hover { border-color:var(--accent); }
.olist .addr { font-weight:650; overflow-wrap:anywhere; }
.olist .meta { font-size:.85rem; color:var(--muted); }

/* ---------- timeline */
.steps { list-style:none; margin:0 0 6px; padding:0; display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:6px; counter-reset:s; }
.steps li { position:relative; padding-top:30px; font-size:.85rem; font-weight:650; color:var(--muted); text-align:center; }
.steps li::before { counter-increment:s; content:counter(s); position:absolute; top:0; left:50%; transform:translateX(-50%); width:26px; height:26px; border-radius:50%;
  background:var(--soft); border:2px solid var(--line); display:grid; place-items:center; font-size:.78rem; color:var(--muted); z-index:1; }
.steps li::after { content:""; position:absolute; top:12px; left:calc(-50% + 14px); right:calc(50% + 14px); height:3px; background:var(--line); }
.steps li:first-child::after { display:none; }
.steps li.done { color:var(--ink); }
.steps li.done::before { background:var(--ok); border-color:var(--ok); color:#fff; content:"\2713"; }
.steps li.done::after, .steps li.now::after { background:var(--ok); }
.steps li.now { color:var(--ink); }
.steps li.now::before { background:var(--accent); border-color:var(--accent); color:var(--btn-ink); box-shadow:0 0 0 5px var(--accent-soft); }
.steps li time { display:block; font-weight:500; font-size:.75rem; color:var(--muted); }
.feed { list-style:none; margin:0; padding:0; display:grid; gap:12px; }
.feed li { display:grid; grid-template-columns:34px minmax(0,1fr); gap:10px; }
.feed .dot { width:34px; height:34px; border-radius:50%; background:var(--soft); display:grid; place-items:center; font-size:.8rem; font-weight:700; color:var(--muted); }
.feed .dot.us { background:var(--accent-soft); color:var(--accent-ink); }
.feed .bubble { background:var(--soft); border-radius:4px 12px 12px 12px; padding:10px 14px; white-space:pre-wrap; overflow-wrap:anywhere; }
.feed .bubble.note { background:var(--warn-soft); }
.feed .sys { font-size:.88rem; color:var(--muted); padding-top:6px; }
.feed .when { font-size:.78rem; color:var(--muted); margin-bottom:3px; }
.soon { border:2px dashed var(--line); border-radius:var(--radius); padding:22px; text-align:center; color:var(--muted); background:repeating-linear-gradient(135deg, transparent 0 14px, var(--soft) 14px 15px); }
.soon strong { color:var(--ink); display:block; font-size:1.05rem; }
.confirm-addr { font-size:1.25rem; font-weight:700; padding:16px 18px; border-radius:12px; background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 30%, transparent); overflow-wrap:anywhere; }
.logo-preview { width:160px; height:100px; border:1px dashed var(--line); border-radius:12px; display:grid; place-items:center; background:var(--soft); overflow:hidden; }
.logo-preview img { max-width:100%; max-height:100%; object-fit:contain; }
.swatch { display:inline-block; width:18px; height:18px; border-radius:5px; vertical-align:-3px; border:1px solid var(--line); }
.dl { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:6px 16px; margin:0; }
.dl dt { color:var(--muted); font-size:.9rem; }
.dl dd { margin:0; font-weight:600; overflow-wrap:anywhere; }

/* ---------- admin */
body.admin .top { background:var(--ink); border-bottom:0; }
body.admin .top .brand, body.admin .top .who { color:var(--paper); }
body.admin .nav a { color:color-mix(in srgb, var(--paper) 70%, transparent); }
body.admin .nav a:hover { background:rgba(255,255,255,.08); color:var(--paper); }
body.admin .nav a[aria-current="page"] { background:rgba(255,107,53,.18); color:var(--paper); }
body.admin .avatar { background:var(--accent); color:var(--btn-ink); }
body.admin .who .btn.ghost { color:var(--paper); border-color:rgba(255,255,255,.25); }
body.admin .who .btn.ghost:hover { background:rgba(255,255,255,.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.admin .top { background:#0a101c; border-bottom:1px solid var(--line); } }
.chart-card { padding:18px 20px; }
.chart-head { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:6px; }
.chart-head h2 { margin:0; font-size:1.05rem; }
.chart { position:relative; width:100%; min-height:200px; }
.chart svg { display:block; width:100%; height:auto; overflow:visible; }
.chart text { fill:var(--muted); font:12px var(--font); }
.chart .gridline { stroke:var(--grid); stroke-width:1; }
.chart .axis { stroke:var(--line); }
.chart .s1 { fill:var(--s1); } .chart .s2 { fill:var(--s2); } .chart .s3 { fill:var(--s3); }
.chart .l1 { stroke:var(--s1); fill:none; stroke-width:2; } .chart .l2 { stroke:var(--s2); fill:none; stroke-width:2; }
.chart .area1 { fill:var(--s1); opacity:.12; }
.chart .hit { fill:transparent; }
.chart .hover-line { stroke:var(--muted); stroke-dasharray:3 3; }
.chart .dot1 { fill:var(--s1); stroke:var(--card); stroke-width:2; }
.chart .ink { fill:var(--ink); font-weight:700; }
.legend { display:flex; flex-wrap:wrap; gap:14px; font-size:.85rem; color:var(--muted); margin:2px 0 8px; }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.legend i { width:12px; height:12px; border-radius:3px; display:inline-block; }
.legend i.k1 { background:var(--s1); } .legend i.k2 { background:var(--s2); } .legend i.k3 { background:var(--s3); }
.tip { position:absolute; pointer-events:none; background:var(--card); color:var(--ink); border:1px solid var(--line); box-shadow:var(--shadow); border-radius:10px; padding:8px 11px;
  font-size:.82rem; min-width:120px; z-index:5; display:none; }
.tip strong { display:block; font-size:.95rem; }
.tip .r { display:flex; justify-content:space-between; gap:12px; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.seg button { border:0; background:var(--card); color:var(--muted); font:600 .85rem var(--font); padding:6px 12px; cursor:pointer; min-height:34px; }
.seg button[aria-pressed="true"] { background:var(--ink); color:var(--paper); }
details.tbl { margin-top:8px; font-size:.88rem; }
details.tbl summary { cursor:pointer; color:var(--muted); }
details.tbl .table-wrap { max-height:260px; overflow:auto; margin-top:8px; }
.funnel { display:grid; gap:10px; }
.funnel .fr { display:grid; grid-template-columns:130px minmax(0,1fr) 80px; gap:10px; align-items:center; font-size:.9rem; }
.funnel svg { height:22px; }
@media (max-width: 560px) { .funnel .fr { grid-template-columns:100px minmax(0,1fr) 64px; } }
.activity { list-style:none; padding:0; margin:0; font-size:.9rem; }
.activity li { padding:8px 0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; }
.activity li:last-child { border-bottom:0; }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.tabs a { padding:6px 12px; border-radius:99px; border:1px solid var(--line); text-decoration:none; color:var(--muted); font-weight:600; font-size:.88rem; background:var(--card); }
.tabs a[aria-current="page"] { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.tabs a .c { opacity:.7; margin-left:4px; }

/* error page */
.oops { text-align:center; padding:40px 0; max-width:560px; margin:0 auto; }
.oops .code { font-family:var(--font-display); font-size:5rem; font-weight:850; color:var(--accent); letter-spacing:-.05em; line-height:1; }
.oops img { width:220px; height:auto; }
@media print { .top, footer.foot, .nav { display:none; } body { background:#fff; } }

/* landing extras + utilities (no inline styles anywhere: CSP style-src 'self') */
.fine { font-size:.85rem; margin:12px 0 0; }
.nomargin { margin:0; }
.mt0 { margin-top:0; } .mt1 { margin-top:10px; } .mt2 { margin-top:18px; } .mb0 { margin-bottom:0; }
.right { text-align:right; }
.how { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:30px; align-items:center; margin:10px 0 36px; }
.how-steps { list-style:none; counter-reset:h; margin:0; padding:0; display:grid; gap:16px; }
.how-steps li { counter-increment:h; display:grid; grid-template-columns:44px minmax(0,1fr); gap:4px 14px; }
.how-steps li::before { content:counter(h); grid-row:span 2; width:44px; height:44px; border-radius:14px; background:var(--accent-soft); color:var(--accent-ink); font-weight:800; font-size:1.2rem; display:grid; place-items:center; }
.how-steps span { color:var(--muted); }
@media (max-width: 760px) { .how { grid-template-columns:minmax(0,1fr); } }
.checklist { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.checklist li { display:flex; gap:10px; align-items:flex-start; }
.checklist .tick { flex:none; width:24px; height:24px; border-radius:50%; border:2px solid var(--line); }
.checklist li.done .tick { background:var(--ok) url("/static/check-white.svg") center / 13px no-repeat; border-color:var(--ok); }
.checklist li.done span { color:var(--muted); text-decoration:line-through; }
.callout { border-left:4px solid var(--accent); background:var(--accent-soft); padding:12px 16px; border-radius:10px; }
.big-cta { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; }
.greet { font-size:1.05rem; color:var(--muted); margin:0; }
.inbox-art { width:96px; height:auto; }
.narrow { max-width:680px; }
.mx { margin-left:auto; margin-right:auto; }
.mb { margin-bottom:0; }
.grow-input { flex:1; min-width:0; }
.swatch { border:0; vertical-align:-3px; }
.narrow { max-width:680px; }
.mx { margin-left:auto; margin-right:auto; }
.mb { margin-bottom:0; }
.grow-input { flex:1; min-width:0; }
.swatch { border:0; vertical-align:-3px; }
.pill.testmode { background:var(--warn); color:#1d1300; letter-spacing:.04em; }
.pill.live { background:var(--bad); color:#fff; letter-spacing:.04em; }
.pill.testmode::before, .pill.live::before { display:none; }
.pill.flag { background:var(--bad-soft); color:var(--bad); }
.mb2 { margin-bottom:18px; }
.charts .span2 { grid-column:1 / -1; }
/* cards inside grids/stacks get their spacing from the gap, not from .card + .card */
.grid > .card + .card, .row > .card + .card, .plans > * + * { margin-top:0; }
/* admin: the section tabs sit on their own row so every page stays reachable */
body.admin .top .wrap { flex-wrap:wrap; row-gap:0; }
body.admin .nav { order:3; flex-basis:100%; margin:0 -4px; padding:0 0 6px; }
body.admin .who { margin-left:auto; }
body.admin .top .wrap { padding-top:8px; }
@media (max-width: 560px) {
  .grid.kpis { grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
  .grid.kpis .kpi { padding:12px 14px; }
  .grid.kpis .kpi .value { font-size:1.3rem; }
}
/* the admin header is always dark, so its text is always light (both themes) */
body.admin .top .brand, body.admin .top .who, body.admin .top .who .name { color:#f4f6fb; }
body.admin .nav a { color:rgba(244,246,251,.72); }
body.admin .nav a:hover, body.admin .nav a[aria-current="page"] { color:#ffffff; }
body.admin .who .btn.ghost, body.admin .who .btn.ghost:hover { color:#ffffff; }

/* ---------- phase 2a: phone menu, stacked tables, production + Self Serve */
.menu-btn { display:none; }
@media (max-width: 760px) {
  html.js .menu-btn { display:inline-flex; order:2; margin-left:auto; align-items:center; gap:8px; min-height:40px; padding:6px 14px; border-radius:10px;
    border:1px solid var(--line); background:var(--card); color:var(--ink); font:600 .95rem var(--font); cursor:pointer; }
  html.js .who { margin-left:0; order:2; }
  html.js .nav { display:none; }
  html.js .nav.open { display:flex; flex-direction:column; gap:2px; overflow:visible; padding:4px 0 10px; margin:0; }
  html.js .nav.open a { padding:12px 14px; font-size:1.02rem; }
  body.admin .menu-btn { background:transparent; color:#fff; border-color:rgba(255,255,255,.3); }
}
@media (max-width: 560px) {
  table.t thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  table.t, table.t tbody, table.t tr, table.t td { display:block; width:100%; }
  table.t tr { padding:8px 0; border-bottom:1px solid var(--line); }
  table.t tr:last-child { border-bottom:0; }
  table.t td, table.t td.num { display:flex; justify-content:space-between; gap:12px; text-align:right; border:0; padding:5px 14px; }
  table.t td::before { content:attr(data-l); font-size:.78rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; text-align:left; flex:none; }
  table.t td[data-l=""]::before { content:none; }
  table.t td > * { min-width:0; overflow-wrap:anywhere; }
}
.preview-frame { width:100%; height:760px; border:1px solid var(--line); border-radius:12px; background:#fff; margin-top:8px; }
@media (max-width: 560px) { .preview-frame { height:560px; } }
.job { display:flex; align-items:center; gap:10px; font-weight:600; margin:0 0 12px; }
.job .spinner { width:16px; height:16px; border-radius:50%; border:3px solid var(--accent-soft); border-top-color:var(--accent); animation:spin 1s linear infinite; flex:none; }
.job-done .spinner, .job-unknown .spinner { animation:none; border-color:var(--ok); }
.job-failed { color:var(--bad); }
.job-failed .spinner { animation:none; border-color:var(--bad); }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .job .spinner { animation:none; } }
.hint-ok { color:var(--ok); font-weight:600; }
.hint-info { color:var(--sky); font-weight:600; }
.hint-warn { color:color-mix(in srgb, var(--warn) 70%, var(--ink)); font-weight:600; background:var(--warn-soft); padding:10px 14px; border-radius:10px; }
.houses { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.houses li.house { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; padding:14px 16px; border:1px solid var(--line); border-radius:12px; }
.houses .grow { flex:1 1 260px; min-width:0; }
.houses .addr { font-weight:650; overflow-wrap:anywhere; }
.houses .meta { font-size:.88rem; color:var(--muted); }
.houses .meta .job { display:inline-flex; margin:0; font-weight:500; }
.feed .dot.eng { background:var(--sky-soft); color:var(--sky); }
pre.log { margin:0; max-height:320px; overflow:auto; font:12px/1.5 ui-monospace, Consolas, monospace; background:var(--soft); padding:12px; border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere; }

/* keep me signed in / devices */
.pill.ok { background:var(--ok-soft); color:var(--ok); }
small.block { display:block; margin-top:2px; }
label.check { display:flex; gap:12px; align-items:flex-start; margin:4px 0 16px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; cursor:pointer; min-height:44px; }
label.check input { width:22px; height:22px; margin:2px 0 0; flex:none; accent-color:var(--accent); }
label.check small { display:block; color:var(--muted); font-size:.85rem; margin-top:2px; line-height:1.4; }

/* ---------- public site (site.py, site_pages.py): a measured, drafting-sheet look. Display type is Bahnschrift (DIN) with
   tabular figures; orange marks only what you act on or what is selected; the report's pitch colours are data colours. */
body.public { --dim: "Bahnschrift", "DIN Alternate", "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --page: #f3f5f8; --sheet: #ffffff; --rule: #d9dfe8; --navy: #14213d; --navy-2: #1d2d4f; --walk: #2f6fd6; --steep: #d68a14; --vsteep: #c8402f;
  background: var(--page); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.public { --page: #0e1524; --sheet: #162033; --rule: #2a3650; --navy: #0b1222; --navy-2: #13203a; } }
body.public main { min-height: 60vh; }
body.public h1, body.public h2, body.public h3, .xfigs dd, .ledger td.num, .path-price, .bigline strong, .calc-out dd, .plan-out strong {
  font-family: var(--dim); font-stretch: 92%; font-variant-numeric: tabular-nums; }
body.public h1 { font-weight: 700; letter-spacing: -.01em; }
body.public h2 { font-size: clamp(1.55rem, 1.1rem + 1.6vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; margin: 0 0 .4em; }
body.public h3 { font-size: 1.2rem; font-weight: 700; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 40em; line-height: 1.55; }
.narrowp { max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.pubtop .wrap { flex-wrap: nowrap; gap: 10px; }
.pubnav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.pubnav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 10px 12px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.pubnav a:hover { background: var(--soft); }
.pubact { display: flex; gap: 8px; align-items: center; }
.pubact .btn { min-height: 44px; padding: 8px 16px; }
@media (max-width: 860px) { .hide-sm { display: none !important; } .pubact { margin-left: auto; } }
@media (max-width: 359px) { .hide-xs { display: none !important; } }

/* hero */
.hero2 { background: var(--navy); color: #eef2f9; padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero2::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: url("/static/roofline.svg") repeat-x left top / 48px 6px; opacity: .9; }
.hero2-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero2 h1 { font-size: clamp(2.1rem, 1.2rem + 3.1vw, 3.6rem); line-height: 1.04; margin: 0 0 18px; color: #fff; text-wrap: balance; }
.hero2 .lead { color: #c5cfe0; }
.hero2-cta { gap: 12px; margin: 26px 0 14px; flex-wrap: wrap; }
.btn.inv { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.btn.inv:hover { background: rgba(255,255,255,.08); color: #fff; }
.trial-line { color: #aab6cc; font-size: .95rem; margin: 0; max-width: 36em; }
.slot { margin: 0; position: relative; }
.slot img, .slot video { display: block; width: 100%; height: auto; border-radius: 12px; background: #fff; }
.hero-slot img, .hero-slot video { box-shadow: 0 30px 60px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08); max-height: 520px; object-fit: cover; object-position: top; }
.loop-toggle { position: absolute; right: 10px; bottom: 10px; min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 10px; border: 0;
  background: rgba(20,33,61,.82); color: #fff; font: 600 .85rem var(--font); cursor: pointer; }

/* sections */
.psec { padding: 64px 0; }
.psec.alt { background: var(--sheet); border-block: 1px solid var(--rule); }
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 28px; border: 1px solid var(--rule); border-radius: 16px; background: var(--sheet); overflow: hidden; }
.path { padding: 28px; }
.path + .path { border-left: 1px solid var(--rule); }
.path h3 { font-size: 1.45rem; margin: 0; }
.path-price { color: var(--accent-ink); font-weight: 700; margin: 2px 0 18px; font-size: 1.1rem; }
ol.hsteps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 16px; }
ol.hsteps li { counter-increment: s; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 12px; }
ol.hsteps li::before { content: counter(s); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center;
  font: 700 1rem var(--dim); }
ol.hsteps b { font-weight: 700; }
ol.hsteps span { color: var(--muted); line-height: 1.5; }

/* the report explorer: the one bold element on the page */
.xsec { padding: 64px 0 72px; background: var(--sheet); border-block: 1px solid var(--rule); }
.explorer { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; margin-top: 26px; align-items: start; }
.xplan { position: sticky; top: 84px; }
.xplan-in { background: var(--page); border: 1px solid var(--rule); border-radius: 16px; padding: 10px; }
svg.plan { display: block; width: 100%; height: auto; }
svg.plan .pl { fill: #dfe6f1; stroke: #fff; stroke-width: 1; cursor: pointer; transition: fill .15s, opacity .15s; }
svg.plan .pl.b-walk { fill: #d6e3f7; } svg.plan .pl.b-steep { fill: #f6e2bf; } svg.plan .pl.b-vsteep { fill: #f3cdc6; } svg.plan .pl.b-flat { fill: #e3e6ea; }
svg.plan .pl:hover, svg.plan .pl:focus-visible { fill: #c3d4ee; outline: none; }
svg.plan .pl:focus-visible { stroke: var(--ink); stroke-width: 2.5; }
svg.plan.focus .pl { opacity: .35; }
svg.plan.focus .pl.on { opacity: 1; fill: #ffd2bd; stroke: var(--accent); stroke-width: 2.5; }
svg.plan .e { stroke-width: 3; stroke-linecap: round; transition: opacity .15s, stroke-width .15s; }
.e-eaves { stroke: #3b82f6; } .e-rakes { stroke: #22a55a; } .e-ridges { stroke: #e0443a; } .e-hips { stroke: #9b6bd6; } .e-valleys { stroke: #f0a020; }
.e-step_flashing { stroke: #b58a4c; stroke-dasharray: 6 4; } .e-wall_flashing { stroke: #e57bb0; stroke-dasharray: 6 4; } .e-transitions { stroke: #8a94a6; }
svg.plan[data-edge] .e { opacity: .15; }
svg.plan[data-edge="eaves"] .e-eaves, svg.plan[data-edge="rakes"] .e-rakes, svg.plan[data-edge="ridges"] .e-ridges, svg.plan[data-edge="hips"] .e-hips,
svg.plan[data-edge="valleys"] .e-valleys, svg.plan[data-edge="step_flashing"] .e-step_flashing, svg.plan[data-edge="wall_flashing"] .e-wall_flashing,
svg.plan[data-edge="transitions"] .e-transitions { opacity: 1; stroke-width: 6; }
svg.plan .pt { font: 700 12px var(--dim); fill: #14213d; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
svg.plan .pen { fill: #14213d; opacity: .7; pointer-events: none; }
svg.plan .scale line { stroke: #14213d; stroke-width: 2; } svg.plan .scale text { font: 600 12px var(--dim); fill: #14213d; }
.xinfo { margin: 10px 4px 0; color: var(--muted); min-height: 3em; }
.xaddr { margin: 0 0 12px; font-weight: 700; }
.xfigs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.xfigs div { padding: 10px 8px 12px 0; }
.xfigs dt { font-size: .82rem; color: var(--muted); }
.xfigs dd { margin: 2px 0 0; font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.xtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.xtabs [role=tab] { border: 0; background: none; font: 600 .95rem var(--font); color: var(--muted); padding: 10px 12px; min-height: 44px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.xtabs [role=tab][aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.explorer.tabbed .xpanel-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.xpanel { margin-bottom: 18px; }
.xpanel-h { font-size: 1.05rem; margin: 18px 0 8px; }
.xrow { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; color: var(--ink); padding: 8px 6px; margin: -8px -6px; min-height: 44px; cursor: pointer; border-radius: 8px; text-align: left; }
.xrow:hover { background: var(--soft); }
.xrow[aria-pressed=true] { background: #ffe7db; color: #7a2e0e; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sw.b-walk { background: #d6e3f7; border: 2px solid var(--walk); } .sw.b-steep { background: #f6e2bf; border: 2px solid var(--steep); }
.sw.b-vsteep { background: #f3cdc6; border: 2px solid var(--vsteep); } .sw.b-flat { background: #e3e6ea; border: 2px solid #8a94a6; }
.sw[class*=" e-"] { height: 4px; border-radius: 2px; width: 18px; }
.sw.e-eaves { background: #3b82f6; } .sw.e-rakes { background: #22a55a; } .sw.e-ridges { background: #e0443a; } .sw.e-hips { background: #9b6bd6; }
.sw.e-valleys { background: #f0a020; } .sw.e-step_flashing { background: #b58a4c; } .sw.e-wall_flashing { background: #e57bb0; } .sw.e-transitions { background: #8a94a6; }

/* ledgers: tables that read like a takeoff sheet */
table.ledger { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.ledger th, table.ledger td { padding: 10px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.ledger thead th { font-size: .85rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); }
table.ledger .num { text-align: right; white-space: nowrap; }
table.ledger tfoot th, table.ledger tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; font-size: 1.1rem; }
@media (max-width: 560px) {
  table.ledger { font-size: .92rem; }
  table.ledger th, table.ledger td { padding: 9px 5px; }
  .xpanel table.ledger td:last-child:not(.num) { display: none; }
  .xpanel table.ledger thead th:last-child { display: none; }
}

/* film strip of the four product loops */
.film { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.frame { margin: 0; }
.frame .slot img, .frame .slot video { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border: 1px solid var(--rule); }
.frame figcaption { margin-top: 10px; color: var(--muted); line-height: 1.45; font-size: .95rem; }
.frame figcaption b { color: var(--ink); display: block; }

/* pricing */
.price-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.bigline { font-size: 1.1rem; margin-top: 18px; }
.bigline strong { font-size: 1.3rem; }
.plan-box { background: var(--page); border: 1px solid var(--rule); border-radius: 16px; padding: 22px; }
.plan-box h3 { margin-top: 0; }
form.plan label { font-weight: 600; display: block; margin-bottom: 6px; }
form.plan output { font-family: var(--dim); font-size: 1.4rem; font-weight: 700; color: var(--accent-ink); }
form.plan input[type=range] { width: 100%; min-height: 44px; accent-color: var(--accent); }
.plan-out p { margin: 8px 0; }
.plan-out .verdict { font-weight: 700; border-top: 1px solid var(--rule); padding-top: 10px; }
.trial-band { background: var(--navy-2); color: #eef2f9; padding: 52px 0; }
.trial-in > * { max-width: 46em; }
.trial-band h2 { color: #fff; }
.trial-band p { color: #c5cfe0; font-size: 1.08rem; }
.trial-band b { color: #fff; }

/* features, audiences, samples */
.feat2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; }
dl.feats { margin: 18px 0; display: grid; gap: 16px; }
dl.feats dt { font-weight: 700; font-family: var(--dim); font-size: 1.15rem; }
dl.feats dd { margin: 2px 0 0; color: var(--muted); line-height: 1.55; }
.feat-fig { margin: 0; }
.shot { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--rule); box-shadow: 0 20px 40px -26px rgba(20,33,61,.45); background: #fff; }
.who2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0 30px; }
.who-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--rule); border-radius: 14px; background: var(--page); color: var(--ink); text-decoration: none; min-height: 44px; }
.who-card b { font-family: var(--dim); font-size: 1.15rem; }
.who-card span { color: var(--muted); line-height: 1.5; }
.who-card:hover, .who-card:focus-visible { border-color: var(--ink); }
.sample-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.samples-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 26px 0; }
.sample { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.sample-img img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; background: #e2e7ee; }
.sample-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sample-title { margin: 0; font-size: 1.2rem; }
.sample-title a { color: var(--ink); text-decoration: none; }
.sample-body > p { margin: 0; color: var(--muted); }
dl.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 8px 0; border-top: 1px solid var(--rule); }
dl.figs div { padding-top: 6px; }
dl.figs dt { font-size: .78rem; color: var(--muted); }
dl.figs dd { margin: 0; font: 700 1.05rem var(--dim); font-variant-numeric: tabular-nums; }
.attrib { font-size: .8rem !important; color: var(--muted); }
.sample-acts { gap: 8px; margin-top: auto !important; flex-wrap: wrap; }
.report-frame { width: 100%; height: min(80vh, 1100px); border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.email-box { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 22px; margin: 10px 0 40px; max-width: 760px; }
.email-samples { gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.email-samples .field { margin: 0; min-width: 240px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details.qa { border-bottom: 1px solid var(--rule); }
details.qa summary { cursor: pointer; list-style: none; font-weight: 700; padding: 16px 40px 16px 0; position: relative; min-height: 44px; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.4rem; color: var(--accent); font-weight: 400; }
details.qa[open] summary::after { content: "\2212"; }
details.qa p { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.signin-wrap { display: grid; place-items: center; }
.signin-wrap .signin-card, .signin-page .signin-card { width: 100%; max-width: 520px; }
.signin-page { padding-top: 40px; padding-bottom: 60px; display: grid; place-items: center; }
.cta-band { background: var(--navy); color: #eef2f9; padding: 48px 0; }
.cta-in { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { color: #c5cfe0; margin: 0; max-width: 40em; }
.cta-band .row { gap: 12px; flex-wrap: wrap; }

/* content pages */
.article-wrap { padding-top: 26px; padding-bottom: 56px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 18px; padding: 0; font-size: .92rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule); }
.crumbs a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; }
.article-head { max-width: 820px; margin-bottom: 10px; }
.article-head h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); line-height: 1.08; margin: 0 0 12px; text-wrap: balance; }
.updated { color: var(--muted); font-size: .9rem; }
.article-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.article-grid > .prose:first-child { grid-column: 1 / -1; }
.toc { position: sticky; top: 84px; font-size: .93rem; }
.toc p { font-weight: 700; margin: 0 0 6px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--rule); }
.toc a { display: block; padding: 6px 0 6px 12px; color: var(--muted); text-decoration: none; min-height: 44px; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 720px; font-size: 1.05rem; line-height: 1.7; }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.2em 0; padding: 14px 18px; border-left: 4px solid var(--ink); background: var(--sheet); font-family: var(--dim); font-size: 1.02rem; }
.prose code { font-size: .92em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.prose table.ledger { margin: 1em 0; }
.prose .cta-band { margin: 2em 0; border-radius: 16px; padding: 28px 24px; }
.prose .cta-band .wrap { padding: 0; }
.related { max-width: 720px; margin-top: 40px; border-top: 2px solid var(--ink); padding-top: 14px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.related li a { font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.related li span { display: block; color: var(--muted); font-size: .93rem; margin-top: -6px; margin-bottom: 8px; }
form.calc { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 20px; margin: 1.4em 0; }
.calc-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.cf label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.cf-in { display: flex; align-items: center; gap: 8px; }
.cf-in input { width: 100%; min-height: 44px; font-size: 1.05rem; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.cf-in .unit { color: var(--muted); min-width: 2em; }
.cf .hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
dl.calc-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 18px 0 0; border-top: 2px solid var(--ink); }
dl.calc-out div { padding: 10px 8px 6px 0; }
dl.calc-out dt { font-size: .85rem; color: var(--muted); }
dl.calc-out dd { margin: 0; font-size: 1.5rem; font-weight: 700; }

/* the sign-in dialog: a centred sheet; a bottom sheet on phones */
dialog.sheet { border: 0; padding: 0; border-radius: 18px; width: min(460px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(10,18,40,.55); }
dialog.sheet::backdrop { background: rgba(14,21,36,.55); }
.sheet-in { padding: 26px 24px 22px; position: relative; }
.sheet-in h2 { margin: 0 0 6px; font-size: 1.6rem; padding-right: 40px; }
.sheet-x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; font-size: 1.6rem; color: var(--muted); cursor: pointer; }
.sheet-x:hover { background: var(--soft); color: var(--ink); }
html.dlg-open { overflow: hidden; }
@media (max-width: 560px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .sheet-in { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in .22s ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* the hand-off after a sign-in link */
.handoff { min-height: 60vh; display: grid; place-items: center; padding: 40px 16px; }
.handoff-in { text-align: center; max-width: 420px; }
.handoff-in h1 { margin: 16px 0 6px; }
.handoff-bar { height: 4px; border-radius: 4px; background: var(--rule); overflow: hidden; margin: 18px auto; width: 220px; }
.handoff-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
@media (prefers-reduced-motion: no-preference) { .handoff-bar span { animation: handoff .9s ease-out both; } @keyframes handoff { from { transform: scaleX(0); } } }

/* legal and contact */
.legal { padding-top: 36px; padding-bottom: 56px; max-width: 820px; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { margin-top: 30px; font-size: 1.3rem; }
.legal li, .legal p { line-height: 1.65; }
.legal ul { padding-left: 22px; }
.contact-card .big { font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; margin: 4px 0 10px; }
.contact-card .big a { display: inline-block; min-height: 44px; padding: 6px 0; }

/* footer */
.pubfoot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 20px 40px; align-items: start; padding-top: 18px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; }
.foot-h { font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.foot-cols ul { list-style: none; margin: 0 0 12px; padding: 0; }
.foot-cols a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }
.foot-copy { grid-column: 1 / -1; margin: 0; }
.row.center { justify-content: center; flex-wrap: wrap; }
body.public section.oops { padding-top: 40px; padding-bottom: 40px; }

@media (max-width: 960px) {
  .hero2-grid, .explorer, .price-grid, .feat2 { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .xplan { position: static; }
  .film { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .pubfoot .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .paths { grid-template-columns: minmax(0, 1fr); }
  .path + .path { border-left: 0; border-top: 1px solid var(--rule); }
  .who2, .sample-strip, .samples-grid { grid-template-columns: minmax(0, 1fr); }
  .xfigs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-in, dl.calc-out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hero2 { padding: 34px 0 44px; }
  .psec, .xsec { padding: 42px 0; }
  .film { grid-template-columns: minmax(0, 1fr); }
  .hero2-cta .btn, .cta-band .row .btn { flex: 1 1 auto; }
  .path { padding: 20px; }
}

fieldset.qa-edit { border:1px solid var(--line); border-radius:12px; padding:12px 14px 4px; margin:0 0 12px; }
fieldset.qa-edit legend { font-weight:700; padding:0 6px; }

/* ---------- responsive audit (Nov 2026): 44 px tap targets on touch, readable small print, safe areas, sticky actions */
.brand { min-height:44px; }
.nav a { min-height:44px; display:inline-flex; align-items:center; }
.brand .tag, .plan .badge, .badge { font-size:.75rem; }
@media (max-width: 1024px), (pointer: coarse) {
  .btn.small { min-height:44px; padding:8px 14px; }
  html.js .menu-btn, .menu-btn { min-height:44px; }
  .who .avatar, a.avatar { width:44px; height:44px; }
  .tabs a { min-height:44px; display:inline-flex; align-items:center; padding:8px 14px; }
  .seg button { min-height:44px; padding:8px 14px; }
  table.t td a:not(.btn), .card a.tap, .preview-actions a { display:inline-flex; align-items:center; min-height:44px; }
  input[type=checkbox], input[type=radio] { width:22px; height:22px; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height:44px; display:inline-flex; align-items:center; gap:10px; }
  input[type=file] { min-height:44px; }
}
/* phones: fields at 16 px so iOS doesn't zoom; a long form keeps its main button in reach */
@media (max-width: 560px) {
  input, select, textarea { font-size:16px; }
  .sticky-actions, form.f.long > .actions { position:sticky; bottom:0; z-index:5; background:var(--card); margin:0 -18px -18px;
    padding:12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top:1px solid var(--line); box-shadow:0 -8px 20px -14px rgba(20,33,61,.35); }
  .sticky-actions .btn, form.f.long > .actions .btn { width:100%; }
}
/* notches and home bars (viewport-fit=cover) */
.top .wrap, footer.foot .wrap, main.wrap, .phero .wrap, .psec .wrap, .legal { padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); }
footer.foot { padding-bottom:calc(32px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1100px) { table.t { min-width:0; } .table-wrap { overflow-x:auto; } }
/* wide tables become cards on tablets too */
@media (max-width: 1100px) {
  table.t.many thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  table.t.many, table.t.many tbody, table.t.many tr, table.t.many td { display:block; width:100%; }
  table.t.many tr { padding:8px 0; border-bottom:1px solid var(--line); }
  table.t.many td, table.t.many td.num { display:flex; justify-content:space-between; gap:12px; text-align:right; border:0; padding:5px 14px; }
  table.t.many td::before { content:attr(data-l); font-size:.78rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; text-align:left; flex:none; }
  table.t.many td[data-l=""]::before { content:none; }
}
@media (max-width: 860px) {
  table.t.some thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  table.t.some, table.t.some tbody, table.t.some tr, table.t.some td { display:block; width:100%; }
  table.t.some tr { padding:8px 0; border-bottom:1px solid var(--line); }
  table.t.some td, table.t.some td.num { display:flex; justify-content:space-between; gap:12px; text-align:right; border:0; padding:5px 14px; }
  table.t.some td::before { content:attr(data-l); font-size:.78rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; text-align:left; flex:none; }
  table.t.some td[data-l=""]::before { content:none; }
}
@media (max-width: 1024px), (pointer: coarse) {
  table.t td a:not(.btn) { min-width:44px; }
  .row > a:not(.btn), .card p > a.tap { display:inline-flex; align-items:center; min-height:44px; }
  summary { min-height:44px; display:flex; align-items:center; }
}
@media (max-width: 1024px), (pointer: coarse) { ul.activity li > a, .card > a:not(.btn) { display:inline-flex; align-items:center; min-height:44px; } }

/* ---------- help messages, free accounts, trial */
.count { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:99px; background:var(--accent); color:var(--btn-ink); font-size:.75rem; font-weight:800; margin-left:4px; }
.help-btn { margin-left:auto; }
@media (max-width: 760px) { .help-btn { display:none; } }
ol.thread { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
ol.thread .msg { max-width:88%; border:1px solid var(--line); border-radius:14px; padding:10px 14px; background:var(--card); overflow-wrap:anywhere; }
ol.thread .msg.mine { align-self:flex-end; background:var(--accent-soft); border-color:transparent; }
ol.thread .msg.note { background:var(--warn-soft); border-style:dashed; }
ol.thread .meta { font-size:.85rem; color:var(--muted); margin-bottom:4px; }
ol.thread .meta b { color:var(--ink); }
ol.thread .atts { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
ol.thread .atts img { border-radius:8px; border:1px solid var(--line); height:auto; max-width:160px; }
ol.thread .att { display:inline-block; min-height:44px; min-width:44px; }
ol.thread .ctx { font-size:.82rem; margin-top:6px; }
.files { display:grid; gap:8px; }
.choices .choice h2 { font-size:1.3rem; }
ul.grants { list-style:none; margin:0 0 8px; padding:0; display:grid; gap:10px; }
.pill.trial { background:var(--sky-soft); color:var(--sky); }
.pill.comp { background:var(--ok-soft); color:var(--ok); }
.pubflash { padding-top:14px; }
.pubflash .flash { margin-bottom:0; }
.foot-cols a, .crumbs a { min-width: 44px; }
@media (max-width: 1024px), (pointer: coarse) { .page-head a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; } }
