/* ============================================================
   AURORA LEDGER — instrument-panel futurism for Expense Tracker
   Dark-first: deep indigo void, glass panels, one aurora ribbon,
   electric-cyan accent (violet only inside gradients). Light
   "daylight deck" variant via prefers-color-scheme.
   Chart rules follow the validated dataviz method: single-hue
   cyan magnitude bars (≥3:1 on panel), status colors reserved
   and always paired with a text label.
   ============================================================ */

:root {
  color-scheme: dark;
  --void: #0a0c14;
  --panel: #11151f;
  --panel-glass: rgba(17, 21, 31, 0.72);
  --panel-2: #171c2a;
  --ink: #e8edf6;
  --ink-2: #9aa5bd;
  --muted: #67718a;
  --hairline: rgba(148, 170, 255, 0.13);
  --hairline-strong: rgba(148, 170, 255, 0.24);
  --accent: #38bdf8;
  --accent-2: #2ea8e8;
  --accent-ink: #7cd3ff;
  --glow: rgba(56, 189, 248, 0.32);
  --violet: #8b7cf6;
  --teal: #2dd4bf;
  --good: #34d399;
  --good-text: #4ade80;
  --warn: #fbbf24;
  --serious: #fb923c;
  --critical: #ff6b8a;
  --wash: rgba(148, 170, 255, 0.06);
  --wash-accent: rgba(56, 189, 248, 0.09);
  --shadow: 0 10px 40px rgba(3, 5, 12, 0.55);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --void: #eef1f7;
    --panel: #ffffff;
    --panel-glass: rgba(255, 255, 255, 0.82);
    --panel-2: #f4f6fb;
    --ink: #131828;
    --ink-2: #46506a;
    --muted: #7b849c;
    --hairline: rgba(19, 26, 47, 0.12);
    --hairline-strong: rgba(19, 26, 47, 0.22);
    --accent: #0e9bd8;
    --accent-2: #0a85bd;
    --accent-ink: #086b96;
    --glow: rgba(14, 155, 216, 0.22);
    --violet: #7c6cf0;
    --teal: #0fb5a3;
    --good: #0c9d68;
    --good-text: #0a7d54;
    --warn: #d99000;
    --serious: #e0641f;
    --critical: #d53a5e;
    --wash: rgba(19, 26, 47, 0.045);
    --wash-accent: rgba(14, 155, 216, 0.08);
    --shadow: 0 10px 30px rgba(30, 42, 80, 0.10);
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--void);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- The aurora: one artistic statement, quiet everywhere else ---- */
.aurora {
  position: fixed;
  inset: -40% -20% auto -20%;
  height: 75vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(38% 55% at 18% 38%, var(--glow), transparent 70%),
    radial-gradient(30% 45% at 55% 22%, rgba(139, 124, 246, 0.20), transparent 70%),
    radial-gradient(26% 40% at 82% 42%, rgba(45, 212, 191, 0.14), transparent 70%);
  filter: blur(46px);
  opacity: 0.85;
  animation: aurora-drift 26s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  from { transform: translate3d(-3%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 4%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none; }
  * { transition: none !important; }
}
@media (prefers-color-scheme: light) {
  .aurora { opacity: 0.5; }
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
/* Section titles read as instrument labels: small, spaced, mono */
h2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 26px 0 12px;
}
h3 { font-size: 0.95rem; margin: 22px 0 8px; font-weight: 600; }
.sub { color: var(--muted); font-size: 0.88rem; margin: 0 0 18px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--glow);
  border-radius: 4px;
}

/* ---- Shell ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--panel-glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--hairline);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 750;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 13px 14px 13px 0;
  white-space: nowrap;
}
.brand a { color: var(--ink); }
.brand a::before {
  content: "✦ ";
  background: linear-gradient(120deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav { display: flex; align-items: center; gap: 1px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2);
  font-size: 0.84rem;
  padding: 14px 9px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active {
  color: var(--ink);
  border-image: linear-gradient(90deg, var(--accent), var(--violet)) 1;
  border-bottom: 2px solid;
  font-weight: 600;
}
.nav .count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 9px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #051018;
  font-size: 0.71rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 0 10px var(--glow);
}
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 0.84rem; color: var(--ink-2); }
.userbox form { margin: 0; }
.rolechip {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  border: 1px solid var(--hairline-strong);
  padding: 2px 8px;
  border-radius: 999px;
}
main { max-width: 1160px; margin: 0 auto; padding: 26px 20px 70px; position: relative; z-index: 1; }

/* ---- Panels ---- */
.card, .panel {
  background: var(--panel-glass);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(1px)) {
  .card, .panel, .topbar { background: var(--panel); }
}
.card > h2:first-child, .panel > h2:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 880px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- Stat tiles: thin large numerals, cockpit style ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile {
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
  opacity: 0.55;
}
.tile .label {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.tile .value { font-size: 2.1rem; font-weight: 300; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.tile .note { font-size: 0.78rem; color: var(--ink-2); margin-top: 4px; }
.tile .note.alert { color: var(--critical); font-weight: 600; }
.tile .note.ok { color: var(--good-text); }
.tile a { color: inherit; }
.tile a:hover { text-decoration: none; }

/* ---- Bars: single-hue cyan magnitude, values in text ink ---- */
.barchart { margin: 6px 0 2px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: 10px; align-items: center; padding: 3px 0; }
.bar-row .blabel { font-size: 0.82rem; color: var(--ink-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .btrack { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .bar {
  height: 15px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, var(--panel)), var(--accent));
  border-radius: 0 4px 4px 0;
  min-width: 2px;
  max-width: calc(100% - 88px);
  flex: 0 0 auto;
  box-shadow: 0 0 12px var(--glow);
}
.bar-row .bval { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-baseline { border-left: 1px solid var(--hairline-strong); }

/* ---- Tables ---- */
table.list { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.list th {
  text-align: left;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-strong);
  white-space: nowrap;
}
table.list td { padding: 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.rowlink:hover td { background: var(--wash-accent); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.neg { color: var(--good-text); }

/* ---- Status: color + dot + text label, never color alone ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--wash);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.badge.unmatched  { color: var(--ink); } .badge.unmatched::before  { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
/* Still unsubmitted, but the receipt is in — nothing is overdue from you. */
.badge.unmatched.ready::before { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.badge.submitted  { color: var(--ink); } .badge.submitted::before  { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.badge.rejected   { color: var(--ink); } .badge.rejected::before   { background: var(--critical); box-shadow: 0 0 8px var(--critical); }
.badge.approved   { color: var(--ink); } .badge.approved::before   { background: var(--good); box-shadow: 0 0 8px var(--good); }
.badge.exported::before { background: var(--muted); }
.badge.excluded { color: var(--muted); }
.flag {
  display: inline-block;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 6px;
  white-space: nowrap;
  border: 1px solid;
}
.flag.personal { color: var(--serious); border-color: var(--serious); background: transparent; }
.flag.affidavit { color: var(--warn); border-color: var(--warn); }
.flag.receipt-missing { color: var(--critical); border-color: var(--critical); }

/* ---- Forms ---- */
form.stack { display: flex; flex-direction: column; gap: 13px; max-width: 470px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; color: var(--ink-2); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
.hint { font-size: 0.76rem; color: var(--muted); font-weight: 400; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form label.f { flex: 0 1 auto; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 0.86rem; color: var(--ink); font-weight: 400; }
.checkline input { width: auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 17px;
  border-radius: 9px;
  border: 1px solid var(--hairline-strong);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 14px var(--glow); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #051018;
  box-shadow: 0 2px 18px var(--glow);
}
@media (prefers-color-scheme: light) { .btn.primary { color: #ffffff; } }
.btn.danger { color: var(--critical); border-color: var(--critical); background: transparent; }
.btn.danger:hover { box-shadow: 0 0 14px color-mix(in srgb, var(--critical) 40%, transparent); }
.btn.small { font-size: 0.76rem; padding: 5px 11px; }
.btnrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ghostbtn {
  font: inherit; font-size: 0.72rem; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 4px 0;
}
.ghostbtn:hover { color: var(--critical); }

/* ---- Flash ---- */
.flash { border-radius: 10px; padding: 11px 15px; margin-bottom: 16px; font-size: 0.88rem; border: 1px solid; }
.flash.ok { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.flash.err { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, transparent); }

/* ---- Capture hero ---- */
.capture-hero { text-align: center; padding: 26px 0 30px; }
.capture-hero .sub { margin-bottom: 24px; }
.ai-chip {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  color: var(--accent-ink);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 6px;
}
.shutter { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; cursor: pointer; }
.shutter input, .alt-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.shutter-ring {
  width: 108px; height: 108px; border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--accent), var(--violet), var(--teal), var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 0 34px var(--glow), inset 0 0 18px rgba(0,0,0,0.25);
  animation: ring-spin 9s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .shutter-ring { animation: none; } }
.shutter-core {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--panel);
  display: grid; place-items: center;
  font-size: 2rem;
  color: var(--accent);
  animation: ring-spin 9s linear infinite reverse; /* keep the glyph upright */
}
.shutter-label { font-size: 0.95rem; font-weight: 650; letter-spacing: 0.02em; }
.shutter:hover .shutter-ring { box-shadow: 0 0 48px var(--glow); }
.alt-pick { display: block; margin-top: 14px; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.alt-pick:hover { color: var(--accent-ink); }

/* ---- Receipt cards ---- */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rcard {
  display: flex; gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--hairline);
  border-radius: 13px;
  padding: 11px;
}
.rthumb { flex: 0 0 84px; }
.rthumb img, .rthumb .pdficon {
  width: 84px; height: 104px; object-fit: cover; border-radius: 8px; display: block;
  border: 1px solid var(--hairline);
}
.pdficon { display: grid; place-items: center; background: var(--wash); color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.rmeta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.rname { font-size: 0.78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsource { color: var(--accent-ink); margin-right: 5px; }
.rnote { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-read { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; color: var(--accent-ink); }
.why { font-size: 0.72rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.ok-note { color: var(--accent-ink); font-size: 0.86rem; margin: 0 0 12px; }
.suglist { display: flex; flex-direction: column; gap: 5px; }
.sug { margin: 0; }
.sugbtn {
  width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  font: inherit; text-align: left;
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--ink);
  cursor: pointer;
}
.sugbtn:hover { border-color: var(--accent); box-shadow: 0 0 10px var(--glow); }
.sugbtn.exact { border-color: var(--good); }
.sugbtn.exact .s-meta { color: var(--good-text); }
.s-merchant { font-size: 0.76rem; font-weight: 600; }
.s-meta { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Open charge rows (capture page) ---- */
.openlist { display: flex; flex-direction: column; }
.openrow {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 0.86rem;
}
.openrow:last-child { border-bottom: none; }
.openrow:hover { background: var(--wash-accent); text-decoration: none; border-radius: 8px; }
.o-date { font-family: ui-monospace, Menlo, monospace; font-size: 0.74rem; color: var(--muted); }
.o-merchant { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.o-amount { font-variant-numeric: tabular-nums; font-weight: 300; font-size: 1rem; }
.o-state { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 5px; }
.dot.ok { background: var(--good); box-shadow: 0 0 7px var(--good); }
.dot.want { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.count-chip {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.68rem;
  color: var(--accent-ink);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.count-chip.warn { color: var(--warn); border-color: var(--warn); }

/* ---- Channel cards ---- */
.chgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.chan { background: var(--panel-2); border: 1px solid var(--hairline); border-radius: 13px; padding: 14px 16px; }
.ch-head { font-weight: 650; font-size: 0.9rem; margin-bottom: 6px; }
.codebox {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--void);
  border: 1px dashed var(--hairline-strong);
  border-radius: 9px;
  padding: 10px 14px;
  margin: 8px 0 10px;
  text-align: center;
  user-select: all;
}

/* ---- Attach-from-inbox picker (txn page) ---- */
.inbox-pick-title { margin-top: 18px; }
.inbox-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.pick { margin: 0; }
.pickbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; background: var(--panel-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: var(--ink-2);
}
.pickbtn:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--glow); }
.pickbtn img, .pickbtn .pdficon { width: 74px; height: 92px; object-fit: cover; border-radius: 6px; }
.pickname { font-size: 0.66rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Transaction detail ---- */
.txn-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; flex-wrap: wrap; }
.txn-amount { font-size: 2.3rem; font-weight: 250; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; font-size: 0.86rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.receipt-thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.receipt-thumb {
  border: 1px solid var(--hairline);
  border-radius: 11px;
  padding: 8px;
  width: 150px;
  font-size: 0.74rem;
  color: var(--ink-2);
  background: var(--panel-2);
}
.receipt-thumb img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.receipt-thumb .pdficon { width: 100%; height: 110px; border-radius: 6px; font-size: 1rem; }
.receipt-thumb .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 6px; }
.rejectbox { border: 1px solid var(--critical); background: color-mix(in srgb, var(--critical) 8%, transparent); border-radius: 10px; padding: 11px 15px; margin: 12px 0; font-size: 0.88rem; }
.affidavitbox { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 10px; padding: 11px 15px; margin: 12px 0; font-size: 0.88rem; }

/* ---- Filters ---- */
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; font-size: 0.84rem; }
.filters label.f { min-width: 130px; flex: 0 1 auto; }
.filters .btn { margin-bottom: 1px; }

/* ---- Auth ---- */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.authcard {
  background: var(--panel-glass);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.authcard h1 { margin-bottom: 2px; }
.authcard .brandline {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
  background: linear-gradient(120deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Misc ---- */
.empty { color: var(--muted); font-size: 0.88rem; padding: 20px 0; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
details.help { margin-top: 10px; font-size: 0.84rem; color: var(--ink-2); }
details.help summary { cursor: pointer; color: var(--muted); }

@media (max-width: 700px) {
  main { padding: 18px 12px 90px; }
  .card, .panel { padding: 16px; border-radius: 14px; }
  .nav { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 13px 8px; white-space: nowrap; }
  .userbox span:first-child { display: none; }
  .openrow { grid-template-columns: 46px 1fr auto; }
  .o-state { display: none; }
  .tile .value { font-size: 1.8rem; }
}

/* ---- SMS enrollment example (public /legal/sms-optin) --------------------
   A transcript of a real opt-in, laid out the way carrier reviewers expect
   to read one: the prompt the employee sees, then each turn of the exchange. */
.smsdemo {
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  background: var(--wash);
  padding: 18px 20px;
  margin: 18px 0;
}
.smsdemo h3 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.smsdemo .prompt {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  margin-bottom: 4px;
}
.smsturn { padding: 10px 0; }
.smsturn + .smsturn { border-top: 1px solid var(--hairline); }
.smsturn .who {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--accent-ink);
  margin-bottom: 4px;
}
.smsturn .msg {
  display: block;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
}
.smsturn .msg.out { color: var(--muted); }

/* Screenshots of the in-app call to action on /legal/sms-optin. */
.shots { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0; }
.shots figure { margin: 0; flex: 1 1 300px; min-width: 260px; }
.shots img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
  background: var(--void);
}
.shots figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

/* Public context on the sign-in screen (business + SMS program disclosure). */
.pubnote {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}
.pubnote p { margin: 0 0 8px; }
.pubnote a { color: var(--accent-ink); }

/* Consent disclosure on the SMS opt-in card (required by carriers). */
.consent {
  margin: 10px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}
.consent a { color: var(--accent-ink); }

/* The tick box itself — the affirmative act carriers ask to see evidence of,
   so it is boxed and legible rather than fine print under a button. */
.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
.consent-check input { margin-top: 2px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); }
.consent-check a { color: var(--accent-ink); }
.consent-done { margin: 12px 0 0; color: var(--good); }

/* Quoted consent language on the public enrollment page. */
.consentquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--wash);
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}

/* "Filed before as" category chips on the reconciliation screen. */
.suggests { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.suggests .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 6px 0 0;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.suggests .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.suggests .chip .n {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--void);
  border-radius: 999px;
  padding: 1px 6px;
}

/* Per-category substantiation questions on the reconcile form. */
.detailset {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--wash);
}
.detailset-head { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.detailset .f { margin-bottom: 10px; }
.detailset .f:last-child { margin-bottom: 0; }
.req { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn); font-weight: 700; }
.flabel { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* The four disclosures a carrier reviewer checks off, as a labelled list. */
.disclosures { margin: 0 0 18px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.disclosures dt { font-weight: 700; color: var(--accent-ink); font-size: 0.84rem; }
.disclosures dd { margin: 0; font-size: 0.9rem; }
@media (max-width: 620px) {
  .disclosures { grid-template-columns: 1fr; gap: 2px; }
  .disclosures dd { margin-bottom: 10px; }
}
