/* TallyParcel — institutional financial interface (decision record 0019; identity of decision record 0029, 2026-11-25).
   Warm canvas, white surfaces with 1px hairlines and no soft shadows, hull-black primary, 6-8px corners. Light, Dark or
   System (the visitor's choice, written by the server on <html data-theme>; no script). Colour carries meaning only:
   green = verified money, savings and approved/credited claims (never "Potential"); amber = deadlines within 7 days and
   warnings; grey = expired; red = errors. Brand yellow appears only in the logo symbol and the dark-mode focus ring.
   Every colour is a variable of the blocks below (a test checks it and measures the contrast of each pair).
   Fonts are served from this site (SIL Open Font License, see fonts/OFL-*.txt). */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Light (and the base for print). --control-border: form fields need 3:1 against their background (decision record 0029);
   --border-strong stays for decorative lines. --qr-paper: the two-factor QR code is always on white. */
:root {
  color-scheme: light dark;
  --canvas: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --subtle: #F1EFEA;
  --border: #E4E2DC;
  --border-strong: #CFCCC4;
  --control-border: #878A91;
  --text: #17191C;
  --text-2: #4A4D53;
  --muted: #62666D;
  --primary: #17191C;
  --primary-hover: #2B2E33;
  --on-primary: #FFFFFF;
  --symbol: #17191C;
  --focus: #17191C;
  --chart: #6B6F76;
  --green: #047857;
  --green-50: #ECFDF5;
  --green-200: #A7F3D0;
  --amber: #B45309;
  --amber-50: #FFFBEB;
  --amber-200: #FDE68A;
  --amber-text: #78350F;
  --red: #B91C1C;
  --red-50: #FEF2F2;
  --red-200: #FECACA;
  --shadow: 0 8px 24px rgba(23, 25, 28, .08);
  --header-bg: rgba(255, 255, 255, .96);
  --backdrop: rgba(23, 25, 28, .3);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%234A4D53' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --qr-paper: #FFFFFF;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 240px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
/* Dark: chosen in the selector, or System on a device in dark mode. Screens only: printing always uses the light colours.
   The two blocks hold the same values (a test checks it). */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #111316;
    --surface: #17191C;
    --surface-2: #1C1F23;
    --subtle: #23262B;
    --border: #2E3238;
    --border-strong: #41464E;
    --control-border: #6B7078;
    --text: #F3F1EA;
    --text-2: #C9CBCF;
    --muted: #A3A6AC;
    --primary: #F3F1EA;
    --primary-hover: #FFFFFF;
    --on-primary: #17191C;
    --symbol: #E0A82E;
    --focus: #E0A82E;
    --chart: #8B9098;
    --green: #3FB68B;
    --green-50: #12291F;
    --green-200: #1F5A43;
    --amber: #F4B062;
    --amber-50: #2B2113;
    --amber-200: #5C4520;
    --amber-text: #F8D9A8;
    --red: #F28B82;
    --red-50: #2C1716;
    --red-200: #5E2A27;
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --header-bg: rgba(23, 25, 28, .96);
    --backdrop: rgba(0, 0, 0, .55);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23C9CBCF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #111316;
    --surface: #17191C;
    --surface-2: #1C1F23;
    --subtle: #23262B;
    --border: #2E3238;
    --border-strong: #41464E;
    --control-border: #6B7078;
    --text: #F3F1EA;
    --text-2: #C9CBCF;
    --muted: #A3A6AC;
    --primary: #F3F1EA;
    --primary-hover: #FFFFFF;
    --on-primary: #17191C;
    --symbol: #E0A82E;
    --focus: #E0A82E;
    --chart: #8B9098;
    --green: #3FB68B;
    --green-50: #12291F;
    --green-200: #1F5A43;
    --amber: #F4B062;
    --amber-50: #2B2113;
    --amber-200: #5C4520;
    --amber-text: #F8D9A8;
    --red: #F28B82;
    --red-50: #2C1716;
    --red-200: #5E2A27;
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --header-bg: rgba(23, 25, 28, .96);
    --backdrop: rgba(0, 0, 0, .55);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23C9CBCF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
@media print { :root { color-scheme: light; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3, h4 { color: var(--text); line-height: 1.25; margin: 0 0 .4em; font-weight: 600; letter-spacing: -.004em; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 .8em; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Precision figures: money, percentages, dates, invoice and tracking numbers */
.mono, .num, td.num, th.num, .kpi-value, .amount-pos, .money, .hero-figure, .price, .key, .codes, .date {
  font-family: var(--mono); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: -.01em; }
.mono { font-size: 12.5px; }
.money-verified, .amount-pos { color: var(--green); }
.amount-pos { font-weight: 500; }

/* ---------- logo ---------- */
.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { flex: none; display: block; max-width: 100%; height: auto; }
.brand-symbol { fill: var(--symbol); }
.brand-name { fill: var(--text); }

/* ---------- application shell: fixed sidebar + slim top bar ---------- */
.shell { display: flex; min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar { width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 12px 14px; }
.sidebar .brand { padding: 2px 8px 14px; }
.workspace { margin: 0 0 6px; }
.workspace-card { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; background: var(--surface); min-width: 0; }
.workspace-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-label { font-size: 11px; color: var(--muted); }
.workspace select { width: 100%; font-weight: 600; font-size: 13px; padding: 7px 28px 7px 10px; }
.nav-group { margin-top: 14px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 5px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; font-size: 13.5px; text-decoration: none; }
.nav-link svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: var(--subtle); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--subtle); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11px; color: var(--muted); }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar-spacer { flex: 1; }
.menu-button { display: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  align-items: center; justify-content: center; cursor: pointer; background: var(--surface); }
.menu-button svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 1.75; stroke-linecap: round; }
.current-workspace { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; min-width: 0; }
.current-workspace b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.profile { position: relative; }
.profile > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:hover { background: var(--subtle); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600;
  display: grid; place-items: center; letter-spacing: .02em; }
.profile-name { font-weight: 500; font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; z-index: 30; box-shadow: var(--shadow); }
.profile-menu .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; }
.profile-menu a, .profile-menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text); font: 500 13px var(--font); text-decoration: none; background: none; border: 0; cursor: pointer; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--subtle); }
.profile-menu form { margin: 0; }
.content { padding: 28px 32px 40px; max-width: 1280px; width: 100%; }
.footer { color: var(--muted); font-size: 12px; padding: 0 32px 28px; max-width: 1280px; }
.footer a { color: var(--muted); font-weight: 400; }
.footer-links { float: right; }

/* signed-out pages (sign-in, set-up, invitations, resets) */
.plain-header { height: 64px; display: flex; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface); }
.plain-main { padding-top: 40px; padding-bottom: 48px; }
.local-badge { font-size: 12px; color: var(--text-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }

/* ---------- generic blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.card + .card, .section + .section { margin-top: 16px; }
.grid > .card + .card, .grid > .card, .hero > .card { margin-top: 0; }
.section { margin-top: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-end { justify-content: flex-end; }
.span-2 { grid-column: span 2; }
.flash { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); color: var(--text);
  padding: 10px 14px; border-radius: 0; margin-bottom: 18px; }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 14px; font-size: 13.5px; }
.alert-warn { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-text); }
.alert-error { background: var(--red-50); border-color: var(--red-200); color: var(--red); }
.alert-info { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.alert a { color: inherit; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px/1.4 var(--font);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--subtle); text-decoration: none; }
.btn-primary, .btn-emerald { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover, .btn-emerald:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-danger { color: var(--red); border-color: var(--red-200); }
.btn-danger:hover { background: var(--red-50); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }

/* ---------- forms ---------- */
label.field, legend.field { display: block; font-weight: 500; font-size: 12.5px; color: var(--text); margin-bottom: 4px; }
select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=url], input[type=tel], input[type=file], textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: 14px var(--font); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-repeat: no-repeat; background-position: right 10px center;
  background-size: 12px; background-image: var(--select-arrow); }
input[type=file] { padding: 5px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.req { color: var(--red); }

/* ---------- New Audit ---------- */
.upload-card { padding: 18px 20px 20px; }
.contract-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px;
  margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.contract-line .label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.contract-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: 13px; color: var(--text); background: var(--surface-2); }
.contract-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text); flex: none; }
.contract-chip.none .dot { background: var(--amber); }
.dropzone { display: block; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); padding: 40px 20px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin: 0 0 14px; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--surface); }
.dropzone strong { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin: 10px 0 2px; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { width: 40px; height: 40px; margin: 0 auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; }
.drop-icon svg { stroke: var(--text); }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; }
.file-list li { display: flex; justify-content: space-between; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 4px; background: var(--surface); }
.file-list li .muted { font-family: var(--mono); font-size: 12px; }
.upload-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.templates-note { font-size: 12.5px; color: var(--text-2); }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); }
.checklist, .steps-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { padding-left: 20px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 1px; background: var(--text); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 24px; font-weight: 500; color: var(--text); margin-top: 6px; letter-spacing: -.03em; line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.kpi-hero { background: var(--green-50); border-color: var(--green-200); }
.kpi-hero .kpi-label, .kpi-hero .kpi-value { color: var(--green); }
.kpi-hero .kpi-value { font-size: 28px; }
.kpi-amber { background: var(--amber-50); border-color: var(--amber-200); }
.kpi-amber .kpi-label, .kpi-amber .kpi-value { color: var(--amber); }
.kpi-muted { background: var(--surface-2); }
.kpi-muted .kpi-value { color: var(--text-2); font-size: 20px; }
.kpis-secondary { margin-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.separator-note { font-size: 12px; color: var(--text-2); margin: 10px 2px 0; }
.small-value { font-size: 18px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 8px 14px; color: var(--text-2); font-weight: 500; margin-bottom: -1px; border-bottom: 2px solid transparent; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tab .tab-note { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ---------- charts ---------- */
.chart { display: block; overflow: visible; }
.chart-label { font: 500 12.5px var(--font); fill: var(--text-2); }
.chart-value { font: 500 12.5px var(--mono); fill: var(--text); font-variant-numeric: tabular-nums; }
.bar-track { fill: var(--subtle); }
.bar-emerald { fill: var(--green); }
.bar-slate { fill: var(--chart); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  background: var(--surface-2); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-family: var(--font); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.num { font-size: 12.5px; }
table.data tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
tr.detail-row td { background: var(--surface-2); }
details.finding > summary { list-style: none; cursor: pointer; }
details.finding > summary::-webkit-details-marker { display: none; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 4px 0; }
.detail-grid h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.detail-grid p { margin: 0; white-space: pre-wrap; }
.toggle { color: var(--text); font-weight: 500; font-size: 12px; }
table.compact td, table.compact th { padding: 6px 10px; }
table.data td.check, table.data th.check { width: 36px; text-align: center; }
table.data tr.highlight td { background: var(--green-50); }
.preview td, .preview th { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); line-height: 1.6; }
.badge-lg { font-size: 12.5px; padding: 3px 10px; }
.b-verified, .b-recognized, .b-done, .b-sent, .b-ok, .b-passed, .b-active, .b-credited { background: var(--green-50); color: var(--green); border-color: var(--green-200); }
.b-potential_rate_card, .b-potential_address, .b-potential_commitment, .b-potential_data, .b-needs_mapping, .b-draft, .b-warn, .b-past_due, .b-attention, .b-canceling { background: var(--amber-50); color: var(--amber); border-color: var(--amber-200); }
.b-processing, .b-running, .b-queued, .b-sending, .b-pilot, .b-awaiting_payment, .b-unverified { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.b-expired, .b-ignored, .b-skipped, .b-na, .b-lifted, .b-exempt { background: var(--subtle); color: var(--muted); border-color: var(--border); }
.b-rejected, .b-failed, .b-error, .b-suspended, .b-read_only { background: var(--red-50); color: var(--red); border-color: var(--red-200); }
.b-rule { background: var(--surface); color: var(--text); border-color: var(--border-strong); font-family: var(--mono); font-size: 11px; }
.b-demo { background: var(--surface); color: var(--text-2); border-style: dashed; border-color: var(--border-strong); }
.b-role { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.s-detected { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.s-claimed { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.s-credited { background: var(--green-50); color: var(--green); border-color: var(--green-200); }
.s-rejected { background: var(--red-50); color: var(--red); border-color: var(--red-200); }
.s-expired, .s-covered, .s-none { background: var(--subtle); color: var(--muted); border-color: var(--border); }
.days { font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.days-urgent { color: var(--amber); }
.days-ok { color: var(--text-2); }
.days-expired { color: var(--muted); text-decoration: line-through; }
.pending { background: var(--amber-50); color: var(--amber-text); border-radius: 3px; padding: 0 4px; font-weight: 600; }

/* ---------- urgent panel (claims due within 7 days) ---------- */
.urgent { border-color: var(--amber-200); border-left: 3px solid var(--amber); border-radius: 0 var(--radius) var(--radius) 0; }
.urgent h2 { color: var(--amber); }
.urgent-list { list-style: none; padding: 0; margin: 0; }
.urgent-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.urgent-list li:last-child { border-bottom: 0; }

/* ---------- vendor packs ---------- */
.pack { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pack:last-child { border-bottom: 0; }
.pack-name { font-weight: 600; color: var(--text); }

/* ---------- progress ---------- */
.progress-card { max-width: 620px; margin: 40px auto; text-align: center; padding: 40px 30px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--subtle); border-top-color: var(--primary);
  margin: 0 auto 18px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- misc ---------- */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.charge-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; }
.charge-options label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.auth-wrap { display: flex; justify-content: center; padding: 12px 0 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 640px; }
.auth-card.center { margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack .btn { align-self: flex-start; margin-top: 10px; }
.stack label.field { margin-top: 8px; }
.qr-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.qr { border: 1px solid var(--border); border-radius: var(--radius); background: var(--qr-paper); max-width: 100%; height: auto; }
.key { font-size: 14px; letter-spacing: .04em; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; padding: 14px 18px 14px 38px; margin: 14px 0;
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 15px; }
.linkbox { display: flex; gap: 8px; margin: 16px 0 8px; }
.linkbox input { flex: 1; font-family: var(--mono); font-size: 12.5px; }
.inline-form { margin: 0; }
.inline-form select { min-width: 140px; }
.grid-edit td { padding: 4px 6px; }
.grid-edit input[type=text] { padding: 5px 7px; font-size: 13px; min-width: 90px; font-family: var(--mono); }
.bulk { display: grid; grid-template-columns: auto minmax(160px, 1fr) minmax(160px, 1fr) auto; gap: 8px 12px; align-items: end; }
.bulk label.field { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); }
.timeline li + li { margin-top: 2px; }
.prewrap { white-space: pre-wrap; }
.grid > *, .kpis > * { min-width: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
label.check input { margin-top: 3px; accent-color: var(--primary); }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.check-line input { margin-top: 3px; flex: none; accent-color: var(--primary); }

/* owner console: rehearsal and operations checklists */
.rehearsal-checks { list-style: none; margin: 0; padding: 0; }
.rehearsal-checks li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.rehearsal-checks li:last-child { border-bottom: 0; }
.rehearsal-checks li > span[aria-hidden] { display: inline-block; width: 1.4em; font-weight: 700; }
.check-ok > span[aria-hidden] { color: var(--green); }
.check-fail > span[aria-hidden] { color: var(--red); }
.check-fail { color: var(--red); }
.check-info > span[aria-hidden] { color: var(--muted); }
.check-warn > span[aria-hidden] { color: var(--amber); }
.check-warn { color: var(--amber-text); }
.ops-detail { margin-left: 1.4em; }
.ops-status b { margin-right: 4px; }
.console-problems { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ================================================================ public website and legal pages */
body.public { background: var(--surface); font-size: 16px; line-height: 1.6; }
.pub-header { background: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.pub-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.pub-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.pub-nav a:not(.btn) { color: var(--text-2); font-weight: 500; text-decoration: none; }
.pub-nav a:not(.btn):hover { color: var(--text); }
.pub-nav .btn { font-size: 13.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 0 12px; }
.hero { background: var(--canvas); border-bottom: 1px solid var(--border); padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: 48px; line-height: 1.06; letter-spacing: -.018em; margin-bottom: 18px; font-weight: 650; }
.lead { font-size: 18px; color: var(--text-2); max-width: 36em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0 14px; }
.hero-card { padding: 0; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); }
.preview-body { padding: 18px; }
.hero-figure { font-size: 34px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.hero-figure .muted { font-size: 18px; font-weight: 400; }
.preview-rows { margin: 14px 0 0; border-top: 1px solid var(--border); }
.preview-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.preview-rows div:last-child { border-bottom: 0; }
.preview-rows span:first-child { color: var(--text-2); }
.preview-rows .mono { font-size: 13px; }
.preview-foot { padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.hero-list { padding-left: 18px; margin: 14px 0; color: var(--text-2); }
.trust-strip { display: flex; gap: 28px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 22px; }
.trust-strip span::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--green); border-radius: 1px; margin-right: 8px; vertical-align: 2px; }
.pub-section { padding: 72px 0; }
.pub-section.alt { background: var(--canvas); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pub-section h2 { font-size: 32px; letter-spacing: -.014em; margin-bottom: 10px; font-weight: 650; }
.section-lead { color: var(--text-2); font-size: 17px; margin: 0 0 32px; max-width: 46em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.feature { padding: 22px 24px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.feature:nth-child(3n) { border-right: 0; }
.feature:nth-last-child(-n+3) { border-bottom: 0; }
.feature .rule-id { font-family: var(--mono); font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.ticks { list-style: none; padding: 0; margin: 12px 0; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 10px; color: var(--text-2); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 6px; border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.steps { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { position: relative; padding-top: 16px; border-top: 1px solid var(--text); }
.step-n { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.step h3 { font-size: 17px; }
.step p { color: var(--text-2); margin: 0; }
.what-you-need { border-left: 2px solid var(--text); padding: 4px 0 4px 20px; }
.what-you-need ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
.price-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 40px; align-items: start; margin-top: 18px; }
.price-card { padding: 28px; border-color: var(--text); }
.price { font-size: 40px; font-weight: 500; letter-spacing: -.04em; }
.price .muted { font-size: 16px; font-weight: 400; font-family: var(--font); letter-spacing: 0; }
.pricing-notes ul { padding-left: 18px; color: var(--text-2); }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq p { color: var(--text-2); margin: 10px 0 0; }
.contact { background: var(--canvas); border-top: 1px solid var(--border); }
.contact-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.contact-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.contact-email { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.request-form .form-grid { gap: 12px 16px; }
.request-form label.field { margin-top: 0; }
.request-form .btn { margin-top: 16px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 12.5px; color: var(--text-2); margin: 12px 0 0; }
.notice-ok { border: 1px solid var(--green-200); background: var(--green-50); color: var(--green); border-radius: var(--radius-sm); padding: 12px 14px; }
.pub-footer { background: var(--surface); color: var(--text-2); padding: 40px 0 28px; font-size: 14px; border-top: 1px solid var(--border); }
.pub-footer .muted { color: var(--text-2); }
.pub-footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.pub-footer-links { display: flex; flex-direction: column; gap: 6px; }
.pub-footer-links a { color: var(--text); font-weight: 400; text-decoration: none; }
.pub-footer-links a:hover { text-decoration: underline; }
.pub-footer-note { margin-top: 18px; }
.brand-footer { margin-bottom: 10px; }
.legal-page { max-width: 860px; padding-top: 40px; padding-bottom: 48px; }
.legal-head { margin: 8px 0 24px; }
.legal-head h1 { font-size: 34px; letter-spacing: -.014em; }
.legal-body h2 { font-size: 20px; margin-top: 34px; }
.legal-body p, .legal-body li { color: var(--text-2); }
.legal-body li { margin-bottom: 6px; }
.legal-table { margin: 12px 0 18px; font-size: 14px; }
.legal-table td { vertical-align: top; }
.legal-table tr.emphasis td { background: var(--amber-50); }
.legal-foot { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 36px; }
.draft-banner { margin-top: 8px; }
.pub-section[id], .pub-section [id] { scroll-margin-top: 80px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s;
    box-shadow: none; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--backdrop); cursor: pointer; }
  .topbar .topbar-brand { display: inline-flex; }
  .nav-toggle:focus-visible ~ .shell-main .menu-button { outline: 2px solid var(--focus); outline-offset: 2px; }
  .menu-button { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 32px; }
  .footer { padding: 0 16px 24px; }
  .current-workspace .b-role { display: none; }
  .hero-grid, .two-col, .price-grid, .contact-inner { grid-template-columns: 1fr; gap: 28px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { border-right: 0; border-bottom: 1px solid var(--border) !important; }
  .feature:last-child { border-bottom: 0 !important; }
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .pub-header { position: static; }
  .footer-links { float: none; display: block; margin-top: 6px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .kpis, .kpis-secondary, .grid-3, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 31px; }
  .pub-section { padding: 52px 0; }
  .pub-section h2 { font-size: 26px; }
  .urgent-list li { grid-template-columns: 1fr auto; }
  .codes { grid-template-columns: 1fr; }
  .bulk { grid-template-columns: 1fr; }
  .linkbox { flex-direction: column; }
  .profile-name, .current-workspace { display: none; }
  .pub-nav { gap: 14px; }
  .pub-nav a.hide-narrow { display: none; }
  /* the wordmark logo is wider than the old label: on phones the two buttons go to a second row */
  .pub-header-inner { padding-top: 12px; padding-bottom: 12px; gap: 10px 16px; }
}
@media print {
  .sidebar, .topbar, .footer, .actions, .btn, .plain-header { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card { border: 0; }
}
.plain-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.sidebar-close { display: none; }
@media (min-width: 961px) { .nav-toggle { display: none; } }
fieldset.carriers { border: 0; padding: 0; margin: 14px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
fieldset.carriers legend { padding: 0; margin-bottom: 6px; width: 100%; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }
.check-inline input { accent-color: var(--primary); }
.request-form textarea { margin-bottom: 4px; }
.contact-inner h1 { font-size: 36px; letter-spacing: -.016em; }
a.kpi, a.card { display: block; color: inherit; text-decoration: none; font-weight: inherit; }
a.kpi:hover, a.card:hover { border-color: var(--border-strong); text-decoration: none; }
.nav-backdrop, .topbar-brand { display: none; }

/* ---------- appearance selector (decision record 0029): profile menu and public footer ---------- */
.theme-picker { margin: 4px 0 0; padding: 8px 10px 6px; border-top: 1px solid var(--border); }
.theme-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.theme-options { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.theme-options .theme-option { display: inline-block; width: auto; margin: 0; padding: 4px 11px; border: 0; border-left: 1px solid var(--border-strong);
  border-radius: 0; background: var(--surface); color: var(--text-2); font: 500 12.5px/1.4 var(--font); cursor: pointer; }
.theme-options .theme-option:first-child { border-left: 0; }
.theme-options .theme-option:hover { background: var(--subtle); color: var(--text); }
.theme-options .theme-option[aria-pressed="true"] { background: var(--subtle); color: var(--text); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--primary); }
.theme-options .theme-option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.theme-inline { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; border: 0; }
.theme-inline .theme-label { display: inline; margin: 0; }
.pub-footer-note { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
