/* Penny design system.
   A calm, precise financial workspace. Color is used by meaning only:
     teal   = primary action and selection     green = completed      amber = needs review
     red    = blocking or destructive          slate = inactive, skipped, historical
     copper = the Penny brand mark only
   Every status also carries a text label and an icon, so nothing depends on color alone.
   Text and control colors were checked against WCAG 2.2 AA (see the contrast notes in the repo's SCOPE.md). */

/* Inter is bundled (assets/fonts, SIL Open Font License), so the app makes no third-party requests and works offline. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.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; }

:root {
  /* color: surfaces and text */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e8ecf1;
  --th-bg: #f2f4f7;
  --border: #e1e6ec;
  --border-strong: #c9d1db;
  --control-border: #7f8b9c;   /* 3:1 against surfaces, for inputs and buttons */
  --text: #17212f;
  --text-2: #526174;
  --text-3: #5f6e82;
  /* color: action */
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --accent-soft: #e3f3f0;
  --on-accent: #ffffff;
  --focus: #0f766e;
  /* color: brand */
  --copper: #a85a26;
  --copper-strong: #8a4719;
  --copper-soft: #fbefe5;
  /* color: navigation frame */
  --side-bg: #15212f;
  --side-text: #eef2f6;
  --side-text-2: #b7c2d0;
  --side-text-3: #8c9aac;
  --side-hover: #1f2d3e;
  --side-active-bg: #183c3c;
  --side-active-text: #7fe0d2;
  --side-border: #233244;
  /* color: status (text on its own soft background) */
  --ok: #166534;      --ok-soft: #e6f4ea;
  --hold: #8a4b08;    --hold-soft: #fdf1d8;
  --dup: #9f1f17;     --dup-soft: #fde8e6;
  --skip: #475569;    --skip-soft: #eef1f5;
  --fail: #b42318;    --fail-soft: #fde8e6;
  --info: #0f766e;    --info-soft: #e3f3f0;
  /* color: charts (paired with labels and counts) */
  --bar-ok: #2f9461; --bar-entrata: #74b995; --bar-hold: #d9922b; --bar-dup: #d0574c; --bar-skip: #b2bccb;

  /* type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14.5px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;

  /* space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;

  /* shape and depth */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(23, 33, 47, .05);
  --shadow-md: 0 2px 8px rgba(23, 33, 47, .08);
  --shadow-lg: 0 12px 32px rgba(23, 33, 47, .16);

  /* motion */
  --dur: 160ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --sidebar-w: 240px;
  color-scheme: light;
}

/* Dark: slate-navy surfaces with clear separation, bright readable text, teal stays the action color. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1722; --surface: #172231; --surface-2: #1d2a3b; --surface-3: #263447; --th-bg: #1d2a3b;
    --border: #2b3a4f; --border-strong: #3d506a; --control-border: #6b809e;
    --text: #edf2f7; --text-2: #b6c2d1; --text-3: #9aa8ba;
    --accent: #2dd4bf; --accent-strong: #5eead4; --accent-soft: #123a3a; --on-accent: #062621; --focus: #5eead4;
    --copper: #e9a36f; --copper-strong: #f3c39c; --copper-soft: #3a2616;
    --side-bg: #0b121c; --side-text: #edf2f7; --side-text-2: #b6c2d1; --side-text-3: #8492a6;
    --side-hover: #152131; --side-active-bg: #123a3a; --side-active-text: #7fe0d2; --side-border: #1b2737;
    --ok: #6ee7a0; --ok-soft: #12301f; --hold: #fbbf5c; --hold-soft: #352510;
    --dup: #fca5a0; --dup-soft: #3a1717; --skip: #b6c2d1; --skip-soft: #243041; --fail: #fca5a0; --fail-soft: #3a1717;
    --info: #5eead4; --info-soft: #123a3a;
    --bar-ok: #43b47d; --bar-entrata: #86ccaa; --bar-hold: #e3a23f; --bar-dup: #e0746a; --bar-skip: #55657d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 2px 10px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1722; --surface: #172231; --surface-2: #1d2a3b; --surface-3: #263447; --th-bg: #1d2a3b;
  --border: #2b3a4f; --border-strong: #3d506a; --control-border: #6b809e;
  --text: #edf2f7; --text-2: #b6c2d1; --text-3: #9aa8ba;
  --accent: #2dd4bf; --accent-strong: #5eead4; --accent-soft: #123a3a; --on-accent: #062621; --focus: #5eead4;
  --copper: #e9a36f; --copper-strong: #f3c39c; --copper-soft: #3a2616;
  --side-bg: #0b121c; --side-text: #edf2f7; --side-text-2: #b6c2d1; --side-text-3: #8492a6;
  --side-hover: #152131; --side-active-bg: #123a3a; --side-active-text: #7fe0d2; --side-border: #1b2737;
  --ok: #6ee7a0; --ok-soft: #12301f; --hold: #fbbf5c; --hold-soft: #352510;
  --dup: #fca5a0; --dup-soft: #3a1717; --skip: #b6c2d1; --skip-soft: #243041; --fail: #fca5a0; --fail-soft: #3a1717;
  --info: #5eead4; --info-soft: #123a3a;
  --bar-ok: #43b47d; --bar-entrata: #86ccaa; --bar-hold: #e3a23f; --bar-dup: #e0746a; --bar-skip: #55657d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 2px 10px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute always wins over component display rules */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14.5px; line-height: 1.5; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.num, td.num, .money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: absolute; left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
main:focus, main:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column; gap: 24px; padding: 20px 14px;
  overflow-y: auto; overscroll-behavior: contain;    /* v2.1.3: a short window scrolls the menu, so Help center is never cut off */
  background: var(--side-bg); border-right: 1px solid var(--side-border); color: var(--side-text);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--side-text); }
.brand:hover { text-decoration: none; color: var(--side-text); }
.brand-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--side-text-3); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--side-text-2); font-weight: 500; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--side-hover); color: var(--side-text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active-text); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--side-active-text); }
.nav .nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 650; line-height: 20px; text-align: center; background: #f5c26b; color: #2b1a02; }
.nav-label { padding: 14px 10px 4px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--side-text-3); }
.motto { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--side-border); font-size: 12.5px; color: var(--side-text-3); line-height: 1.6; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 48px; outline: none; }
.footer {
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
  padding: 18px 28px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px;
}
.loading { color: var(--text-3); padding: 40px 0; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- search */
.search { position: relative; flex: 1; max-width: 460px; }
.search > svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 36px 0 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--text-3);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--surface-2);
}
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow: auto;
}
.search-results li { border-radius: var(--radius-sm); }
.search-results a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 10px; color: var(--text); }
.search-results a:hover, .search-results li[aria-selected="true"] a { background: var(--surface-2); text-decoration: none; }
.sr-title { font-weight: 550; }
.sr-meta { grid-column: 1; font-size: 12.5px; color: var(--text-3); }
.sr-amt { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; color: var(--text-2); }
.search-results .sr-empty { padding: 10px; color: var(--text-3); }
.search-results .sr-all a { display: block; color: var(--accent); font-weight: 500; }

/* ---------- role picker */
.role-picker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.role-picker select {
  height: 36px; padding: 0 30px 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23687285' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  color: var(--text); font: inherit; font-weight: 500; appearance: none; -webkit-appearance: none; cursor: pointer;
}

/* ---------- page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-head p.lede { margin-top: 6px; color: var(--text-2); max-width: 720px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

/* ---------- cards and grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head p { color: var(--text-3); font-size: 13px; }
.card-body { padding: 14px 20px 18px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--kpi-color, var(--accent)); }
.kpi-dot-accent { --kpi-color: var(--accent); } .kpi-dot-ok { --kpi-color: var(--bar-ok); } .kpi-dot-hold { --kpi-color: var(--bar-hold); }
.kpi-dot-dup { --kpi-color: var(--bar-dup); } .kpi-dot-skip { --kpi-color: var(--bar-skip); } .kpi-dot-info { --kpi-color: var(--info); }
.kpi-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.kpi-value { margin-top: 6px; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 2px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--bar-ok); } .dot-hold { background: var(--bar-hold); } .dot-dup { background: var(--bar-dup); } .dot-skip { background: var(--bar-skip); } .dot-accent { background: var(--accent); } .dot-info { background: var(--info); }

.proof {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px;
  background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); border-radius: var(--radius);
}
.proof svg { width: 22px; height: 22px; color: var(--ok); flex: none; }
.proof strong { color: var(--ok); }
.proof p { color: var(--text-2); }

/* ---------- badges and chips */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 550; white-space: nowrap; line-height: 1.6;
}
.badge svg { width: 13px; height: 13px; flex: none; stroke-width: 2; }
.b-ok { color: var(--ok); background: var(--ok-soft); }
.b-hold { color: var(--hold); background: var(--hold-soft); }
.b-dup { color: var(--dup); background: var(--dup-soft); }
.b-skip { color: var(--skip); background: var(--skip-soft); }
.badge-lg { font-size: 13.5px; padding: 4px 12px; }
.chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 550;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.chip-code { font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-phase { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; white-space: nowrap; }

/* ---------- bars */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 170px 1fr 36px; align-items: center; gap: 12px; }
.hbar-label { font-size: 13.5px; color: var(--text); }
.hbar-label small { display: block; color: var(--text-3); font-size: 12px; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--bar-hold); border-radius: 999px; }
.hbar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 550; }

.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.stackbar span { display: block; height: 100%; }
.s-ENTER_INTACCT { background: var(--bar-ok); } .s-ENTER_ENTRATA { background: var(--bar-entrata); }
.s-HOLD { background: var(--bar-hold); } .s-DUP { background: var(--bar-dup); } .s-SKIP_ALREADY_ENTERED { background: var(--bar-skip); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.run-rows { display: flex; flex-direction: column; gap: 14px; }
.run-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 12px; align-items: center; }
.run-row a { font-weight: 550; }
.run-row small { display: block; color: var(--text-3); font-size: 12px; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; background: var(--th-bg); white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
.data tbody tr { cursor: pointer; }
.data tbody tr:hover td { background: var(--surface-2); }
.data td .main-link { color: var(--text); font-weight: 550; }
.data td .sub { display: block; color: var(--text-3); font-size: 12.5px; }
.data td:nth-child(2) { white-space: nowrap; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button.sort:focus-visible { outline: 2px solid var(--focus); border-radius: 3px; }
th[aria-sort] { color: var(--text); }
.tfoot td { font-weight: 600; background: var(--surface-2); }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); }

/* ---------- filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 550; color: var(--text-3); }
.field input, .field select {
  height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--control-border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; min-width: 0;
}
.field select { padding-right: 28px; appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23687285' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 7px center / 15px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-grow { flex: 1; min-width: 180px; }
.filter-summary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 16px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { border-color: var(--text-2); background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn[aria-disabled="true"] { cursor: not-allowed; color: var(--text-3); background: var(--surface-2); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented button .count { color: var(--text-3); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- invoice detail */
.inv-head { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.inv-title { display: flex; flex-direction: column; gap: 8px; }
.inv-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 13.5px; }
.inv-meta span { display: inline-flex; gap: 6px; }
.inv-amount { text-align: right; }
.inv-amount .big { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inv-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 20px; align-items: start; }
.pdf-panel { position: sticky; top: 80px; }
.pdf-pages {
  height: calc(100vh - 170px); min-height: 520px; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius);
}
.pdf-pages canvas { display: block; width: 100%; height: auto; flex: none; background: #fff; border-radius: 3px; box-shadow: 0 1px 3px rgba(16, 24, 40, .12), 0 0 0 1px rgba(16, 24, 40, .05); }
.pdf-status { margin: auto; padding: 24px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.pdf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pdf-missing { padding: 40px 28px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pdf-missing svg { width: 40px; height: 40px; color: var(--text-3); }
.pdf-missing code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); word-break: break-all; }

.callout { padding: 16px 18px; border-radius: var(--radius); border: 1px solid; display: flex; flex-direction: column; gap: 12px; }
.callout-hold { background: var(--hold-soft); border-color: color-mix(in srgb, var(--hold) 25%, transparent); }
.callout-dup { background: var(--dup-soft); border-color: color-mix(in srgb, var(--dup) 25%, transparent); }
.callout-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout-skip { background: var(--skip-soft); border-color: color-mix(in srgb, var(--skip) 25%, transparent); }
.callout h2 { font-size: 15px; }
.reason { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; }
.reason .chip-code { background: var(--surface); }
.reason p { color: var(--text); }
.route { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--text-2); padding-top: 10px; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.route strong { color: var(--text); font-weight: 600; }
.notes { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.actions .who { font-size: 13px; color: var(--text-3); margin-right: auto; }

.checks { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); align-items: start; }
.checks li:last-child { border-bottom: 0; }
.checks svg { width: 18px; height: 18px; margin-top: 1px; }
.checks .pass svg { color: var(--ok); }
.checks .fail svg { color: var(--fail); }
.checks .fail p { color: var(--text); }
.checks p { color: var(--text-2); }
.checks .code { font-family: var(--mono); font-size: 11.5px; color: var(--fail); font-weight: 600; margin-right: 6px; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--text-3); font-weight: 550; margin-bottom: 2px; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.kv .wide { grid-column: 1 / -1; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; justify-content: end; margin-left: auto; width: min(320px, 100%); padding-top: 10px; font-variant-numeric: tabular-nums; }
.totals .t-label { color: var(--text-2); }
.totals .t-val { text-align: right; }
.totals .grand { font-weight: 650; border-top: 1px solid var(--border); padding-top: 6px; }
.sub-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 18px 0 8px; }
.mini th, .mini td { padding: 7px 10px; font-size: 13px; }
.mini th { font-size: 11px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.current::after { border-color: var(--accent); background: var(--accent); }
.timeline .t-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timeline .t-note { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; font: inherit; font-weight: 550; color: var(--text-3); padding: 12px 10px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }
.tab-panel { padding: 16px 20px 20px; }

/* ---------- runs */
.run-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.run-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.run-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.run-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.run-card h2 { font-size: 17px; }
.run-card .muted { color: var(--text-3); font-size: 13px; }
.run-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.run-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.run-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.run-stats span { font-size: 12px; color: var(--text-3); }
.run-note { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.run-note svg { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---------- rules */
.rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setting { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .s-name { font-weight: 550; }
.setting .s-help { font-size: 12.5px; color: var(--text-3); }
.setting .s-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.route-list { list-style: none; margin: 0; padding: 0; }
.route-list li { display: grid; grid-template-columns: 30px 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.route-list li:last-child { border-bottom: 0; }
.route-list .rank { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.kw-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.kw-row:last-child { border-bottom: 0; }
.role-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.role-banner strong { color: var(--text); }

/* ---------- about */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.steps li { padding: 18px; }
.steps .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; margin-bottom: 10px; }
.steps p { color: var(--text-2); margin-top: 6px; font-size: 13.5px; }
.prose p + p { margin-top: 10px; }
.prose p { color: var(--text-2); max-width: 760px; }
.role-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-layout { grid-template-columns: minmax(0, 1fr); }
  .pdf-panel { position: static; }
  .pdf-pages { height: auto; min-height: 240px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 14, 20, .4); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  main { padding: 20px 16px 40px; }
  .footer { padding: 16px; }
  .two, .run-cards, .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .role-label { display: none; }
  .search-kbd { display: none; }
  .kv { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 120px 1fr 30px; }
  .run-row { grid-template-columns: 110px 1fr 30px; }
  .inv-amount { text-align: left; }
  .data .hide-sm { display: none; }
  .route-list li { grid-template-columns: 24px 1fr; }
  .route-list li > :last-child { grid-column: 2; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 21px; }
  .run-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
  .inv-amount .big { font-size: 24px; }
  .topbar { gap: 8px; }
  .data .hide-xs { display: none; }
}

/* ======================================================================= sprite, intro and sign-in */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
body.booting .shell, body.booting .auth { visibility: hidden; }

.splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(900px 600px at 50% 40%, #1f3561 0%, #12213f 55%, #0b1428 100%);
  color: #f3e6da; transition: opacity .6s ease;
}
.intro-seen .splash { display: none; }
.splash.done { opacity: 0; pointer-events: none; }
.splash-stage { position: relative; width: min(46vmin, 300px); height: min(46vmin, 300px); perspective: 1100px; }
.coin-toss { position: absolute; inset: 0; animation: toss 1.9s cubic-bezier(.3, .02, .25, 1) both; }
.coin { position: absolute; inset: 0; transform-style: preserve-3d; animation: flip 1.9s cubic-bezier(.2, .55, .3, 1) both; }
.coin-face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
/* A real penny has thickness: the two faces sit apart and a copper edge joins them, so the coin never turns paper thin. */
.splash-stage { --coin-t: min(2.2vmin, 13px); }
.coin-front { transform: translateZ(calc(var(--coin-t) / 2)); }
.coin-back { transform: rotateX(180deg) translateZ(calc(var(--coin-t) / 2)); }
.coin-edge {
  position: absolute; left: 0.5%; right: 0.5%; top: 50%; height: var(--coin-t); margin-top: calc(var(--coin-t) / -2);
  border-radius: 999px; transform: rotateX(90deg);
  background: linear-gradient(90deg, #6b300d 0%, #b8642a 18%, #e9a26b 50%, #b8642a 82%, #6b300d 100%);
}
.coin-shadow {
  position: absolute; left: 50%; bottom: -14%; width: 70%; height: 12%; transform: translateX(-50%) scale(.25);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); opacity: 0;
  animation: shadow 1.9s ease-out both;
}
@keyframes toss {
  0%   { transform: translateY(70vh) scale(.28); }
  42%  { transform: translateY(-34vh) scale(.55); }
  82%  { transform: translateY(0) scale(1.06); }
  90%  { transform: translateY(-2%) scale(.98); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes flip { 0% { transform: rotateX(0deg); } 82% { transform: rotateX(1800deg); } 90% { transform: rotateX(1815deg); } 100% { transform: rotateX(1800deg); } }
@keyframes shadow { 0%, 55% { opacity: 0; transform: translateX(-50%) scale(.25); } 85%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
.splash-stage::after {   /* a glint that sweeps across once the penny lands */
  content: ""; position: absolute; inset: 4%; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%) no-repeat;
  background-size: 250% 100%; background-position: 130% 0; opacity: 0; animation: glint .9s ease-out 1.9s both;
}
@keyframes glint { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 1; background-position: -60% 0; } }
.splash-center { display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 6vh, 48px); }
.splash.landed .splash-center { animation: coinOut .7s ease-in forwards; }
.splash-load { width: min(340px, 72vw); display: flex; flex-direction: column; gap: 10px; opacity: 0; animation: loadIn .5s ease 1.6s forwards; }
@keyframes loadIn { to { opacity: 1; } }
.splash-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: #e9a36f; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.splash-status { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #dbe3ee; letter-spacing: .01em; }
.splash-pct { font-variant-numeric: tabular-nums; color: #f2c49d; font-weight: 600; }
@keyframes coinOut { to { opacity: 0; transform: scale(1.12); filter: blur(2px); } }
.splash-welcome { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; opacity: 0; pointer-events: none; padding: 16px; }
.splash.welcome .splash-welcome { animation: welcome 2.1s ease both; }
@keyframes welcome { 0% { opacity: 0; transform: translateY(10px); } 22%, 72% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.splash-hello { font-size: clamp(30px, 6vw, 52px); font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.splash-motto { font-size: clamp(15px, 2.4vw, 19px); color: #f2c49d; letter-spacing: .02em; }
.splash-skip {
  position: absolute; right: 20px; bottom: 20px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
  color: #e9eef8; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
}
.splash-skip:hover { background: rgba(255, 255, 255, .14); }
@media (prefers-reduced-motion: reduce) {
  .splash-load { animation: none !important; opacity: 1; }
  .splash-bar span { transition: none; }
  .coin-toss, .coin, .coin-shadow, .splash-stage::after { animation: none !important; }
  .coin-shadow { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* sign-in: a calm split screen. Brand on the left, a fast path into each role on the right. */
.auth { min-height: 100vh; background: #0f1a26; color: var(--text); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: var(--s8) var(--s4); }
.auth-card {
  width: min(1040px, 100%); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  animation: rise .35s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-brand { background: #15212f; color: #e9eef4; padding: var(--s10) var(--s8); display: flex; flex-direction: column; gap: var(--s5); border-right: 1px solid #233244; }
.auth-logo { display: flex; align-items: center; gap: var(--s3); font-size: 20px; font-weight: 700; color: #fff; }
.auth-coin { width: 44px; height: 44px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.auth-brand h1 { font-size: 28px; line-height: 1.2; color: #fff; letter-spacing: -0.02em; }
.auth-lede { color: #b9c5d3; font-size: 15px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.auth-points li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s2); color: #c9d3df; font-size: 14px; }
.auth-points svg { width: 18px; height: 18px; color: #5eead4; stroke-width: 2.4; margin-top: 2px; }
.auth-points b { color: #fff; }
.auth-security { margin-top: auto; border-top: 1px solid #263649; padding-top: var(--s4); font-size: 13px; color: #b9c5d3; }
.auth-security summary { cursor: pointer; color: #e9eef4; font-weight: 600; }
.auth-security summary:hover { color: #7fe0d2; }
.auth-security ul { margin: var(--s2) 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.auth-main { padding: var(--s10) var(--s8); display: flex; flex-direction: column; gap: var(--s4); }
.auth-main h2 { font-size: 22px; }
.auth-sub { color: var(--text-2); margin-top: calc(-1 * var(--s3)); }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.role-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; text-align: left; padding: var(--s3) var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.role-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.role-card:active { transform: none; }
.role-card:disabled { cursor: progress; opacity: .6; }
.role-card.busy { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.role-card.busy .role-go { animation: nudge .8s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.role-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.role-text b { font-size: 14px; }
.role-name { font-size: 12px; font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }
.role-can { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.role-go { color: var(--text-3); font-size: 16px; transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.role-card:hover .role-go { color: var(--accent); transform: translateX(3px); }
.auth-form { display: flex; flex-direction: column; gap: var(--s3); }
.auth-form .field input { height: 44px; font-size: 15px; width: 100%; }
.auth-form .field input[aria-invalid="true"] { border-color: var(--fail); }
.field-err { color: var(--fail); font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { background: var(--accent-soft); }
.caps { color: var(--hold); }
.auth-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fail-soft); color: var(--fail); font-size: 13.5px; }
.auth-info { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: 13.5px; }
.btn-primary { width: 100%; justify-content: center; height: 46px; font-size: 15px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-primary .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-primary.busy .spin { display: inline-block; }
.btn-primary[disabled] { cursor: progress; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.cred-box { font-size: 13px; color: var(--text-2); }
.cred-box summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.creds { margin-top: var(--s2); }
.creds td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.creds code { font: 12px var(--mono); }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-credit { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: center; color: #b9c5d3; font-size: 14px; }
.auth-credit strong { color: #fff; }
.auth-credit a { color: #7fe0d2; }
@media (max-width: 900px) {
  .auth-card { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: var(--s6) var(--s5); border-right: 0; border-bottom: 1px solid #233244; }
  .auth-brand h1 { font-size: 22px; }
  .auth-points, .auth-lede { display: none; }
  .auth-security { margin-top: 0; }
  .auth-main { padding: var(--s6) var(--s5); }
}
@media (max-width: 520px) { .role-grid { grid-template-columns: minmax(0, 1fr); } .auth-wrap { padding: var(--s4) var(--s3); } .creds td:first-child { display: none; } }
@media (prefers-reduced-motion: reduce) { .auth-card, .btn-primary .spin, .role-card.busy .role-go { animation: none !important; } }

/* topbar user menu */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 12.5px; font-weight: 700; color: #fff; flex: none;
  background: var(--av, #0f766e); }
.av-viewer { --av: #4b5b70; } .av-clerk { --av: #0f766e; } .av-approver { --av: #1f6f43; } .av-admin { --av: #8a4719; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.user-btn:hover { border-color: var(--border-strong); }
.user-btn > svg { width: 16px; height: 16px; color: var(--text-3); }
.user-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--copper); font-weight: 600; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.user-pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12.5px; color: var(--text-3); }
.user-pop-head strong { display: block; color: var(--text); font-size: 13.5px; }
.user-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; cursor: pointer; }
.user-pop button:hover, .user-pop button:focus-visible { background: var(--surface-2); }
.demo-pill { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; color: var(--copper-strong); background: var(--copper-soft); border: 1px solid color-mix(in srgb, var(--copper) 30%, transparent); }
@media (max-width: 860px) { .demo-pill { display: none; } .user-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .user-btn { padding: 0 6px 0 4px; } }   /* the name is hidden from sight, not from screen readers */

/* dialogs */
.dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(8, 14, 28, .55); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.dialog h2 { font-size: 18px; }
.dialog .lede { color: var(--text-2); font-size: 13.5px; }
.dialog textarea { width: 100%; min-height: 96px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.dialog textarea:focus, .dialog input:focus, .dialog select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.choice { display: grid; gap: 8px; }
.choice label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice small { grid-column: 2; color: var(--text-3); font-size: 12.5px; }
.form-error { color: var(--fail); font-size: 13px; }
.hint { font-size: 12.5px; color: var(--text-3); }

/* new statuses and action pieces */
.b-cleared { color: var(--info); background: var(--info-soft); }
.b-rejected { color: var(--fail); background: var(--fail-soft); }
.b-approved { color: var(--ok); background: var(--ok-soft); }
.b-waiting { color: var(--copper-strong); background: var(--copper-soft); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-danger { color: var(--fail); }
.btn-danger:hover { border-color: var(--fail); color: var(--fail); }
.approvals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.approvals li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.approvals .who-line { display: flex; flex-direction: column; }
.approvals small { color: var(--text-3); font-size: 12.5px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--bar-ok); border-radius: 999px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.activity li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.activity .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.activity .a-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.activity .a-head time { color: var(--text-3); font-size: 12.5px; }
.activity .a-note { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sys-avatar { background: #a85a26; }

/* queue */
.queue-tabs { margin-bottom: 14px; }
.team-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 20px 10px; border-bottom: 1px solid var(--border); }
.team-head h2 { font-size: 15px; }
.team-head span { color: var(--text-3); font-size: 13px; }
.empty-state { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2); }
.empty-state svg { width: 44px; height: 44px; color: var(--bar-ok); }

/* audit */
.audit td { font-size: 13.5px; }
.audit .diff { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.audit .diff del { color: var(--fail); text-decoration: line-through; }
.audit .diff ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.audit tbody tr { cursor: default; }

/* rules editor */
.setting input.num-input { width: 130px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; text-align: right; font-variant-numeric: tabular-nums; }
.setting input.changed, .route-input.changed { border-color: var(--copper); background: var(--copper-soft); }
.route-input { width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; }
.edit-bar { position: sticky; bottom: 16px; z-index: 15; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--copper); box-shadow: var(--shadow-lg); }
.edit-bar strong { color: var(--copper-strong); }
.impact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.impact li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.impact li b { display: block; margin-bottom: 2px; }
.changed-tag { font-size: 11px; font-weight: 700; color: var(--copper-strong); background: var(--copper-soft); padding: 1px 7px; border-radius: 999px; margin-left: 6px; }

/* ======================================================================= design brief components */
.dialog::backdrop { background: rgba(10, 16, 26, .55); backdrop-filter: none; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 15px; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--control-border); border-bottom-width: 2px; border-radius: 5px; font: 12px var(--mono); text-align: center; background: var(--surface-2); color: var(--text); }
.keys td { padding: 8px 10px; }
.keys td:first-child { white-space: nowrap; }

/* page header: restrained */
h1 { font-size: var(--fs-2xl); font-weight: 650; }

/* overview: the attention queue is the first thing on the page */
.attention { margin-bottom: var(--s4); border-top: 3px solid var(--accent); }
.att-head { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); align-items: center; justify-content: space-between; padding: var(--s5) var(--s5) var(--s4); }
.att-head h2 { font-size: 18px; }
.att-head p { color: var(--text-2); margin-top: var(--s1); max-width: 640px; }
.att-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.att-list li + li { border-top: 1px solid var(--border); }
.att-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) var(--s5); color: var(--text);
  transition: background var(--dur) var(--ease); }
.att-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.att-row:focus-visible { outline-offset: -2px; }
.att-main b, .att-reason { display: block; }
.att-reason { font-weight: 550; color: var(--hold); }
.att-row .sub { display: block; color: var(--text-3); font-size: var(--fs-sm); }
.att-amt { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.att-more { display: block; padding: var(--s3) var(--s5); border-top: 1px solid var(--border); font-weight: 550; }
@media (max-width: 720px) { .att-row { grid-template-columns: minmax(0, 1fr) auto; } .att-why { grid-column: 1 / -1; grid-row: 2; } }

.kpi-link { display: block; color: var(--text); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.kpi-link:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-go { position: absolute; right: var(--s4); bottom: var(--s3); color: var(--text-3); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.kpi-link:hover .kpi-go { transform: translateX(3px); color: var(--accent); }
a.hbar { color: var(--text); border-radius: var(--radius-sm); padding: 2px 4px; margin: -2px -4px; }
a.hbar:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.empty-state.small { padding: var(--s5) var(--s3); }

/* status, destination and confidence are visually different things */
.status-strip { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.dest-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 550;
  color: var(--text-2); background: var(--surface); border: 1px dashed var(--control-border); }
.dest-tag::before { content: ""; width: 10px; height: 10px; border-radius: 2px; border: 1.5px solid currentColor; }
.conf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); border: 1px solid var(--border); background: var(--surface-2); }
.conf-chip svg { width: 14px; height: 14px; stroke-width: 2.2; }
.conf-chip .cb { stroke: var(--text-3); }
.conf-high .cb { stroke: var(--ok); }
.conf-medium .cb { stroke: var(--hold); stroke-dasharray: 0; }
.conf-low .cb { stroke: var(--fail); }
.b-cleared svg, .b-ok svg, .b-hold svg, .b-dup svg, .b-skip svg, .b-rejected svg, .b-approved svg, .b-waiting svg { stroke: currentColor; }

/* callouts lead with the plain-language issue, then cause, then next step */
.callout-title { display: flex; gap: var(--s2); align-items: flex-start; }
.callout-title svg { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke-width: 2; }
.callout-hold .callout-title { color: var(--hold); } .callout-dup .callout-title { color: var(--dup); } .callout-ok .callout-title { color: var(--ok); }
.callout-skip .callout-title { color: var(--skip); }
.callout-title h2 { color: var(--text); }
.callout-h { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s1); }
.reason { display: flex; gap: var(--s3); align-items: flex-start; justify-content: space-between; }
.reason p { flex: 1; }
.reason-plain { font-weight: 550; display: block; }

/* record navigation */
.record-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-bottom: var(--s3); font-size: var(--fs-sm); }
.record-nav .crumb-id { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.record-step { margin-left: auto; display: inline-flex; gap: var(--s2); align-items: center; }

/* exceptions guide */
.exc-card { margin-bottom: var(--s4); scroll-margin-top: 80px; }
.exc-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: space-between; align-items: baseline; padding: var(--s5) var(--s5) var(--s3); }
.exc-head h2 { font-size: 17px; margin-bottom: var(--s1); }
.exc-count { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.exc-grid { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr; gap: var(--s4) var(--s5); padding: 0 var(--s5) var(--s4); color: var(--text-2); font-size: 13.5px; }
@media (max-width: 860px) { .exc-grid { grid-template-columns: minmax(0, 1fr); } }
.more-codes { margin-top: var(--s4); }
.more-codes > summary { cursor: pointer; padding: var(--s4) var(--s5); font-weight: 600; }
.more-codes > summary:hover { color: var(--accent); }
.more-codes .exc-card { box-shadow: none; border-left: 0; border-right: 0; border-radius: 0; margin: 0; }

.files td .sub code { font-size: 11.5px; }

/* footer: the builder's name on every screen */
.site-footer { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s6); align-items: center; padding: var(--s5) 28px; background: var(--surface); }
.credit { display: flex; align-items: center; gap: var(--s3); font-size: 14px; color: var(--text-2); }
.credit strong { color: var(--text); font-weight: 650; }
.credit-coin { width: 26px; height: 26px; flex: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: flex-end; font-size: var(--fs-sm); }
.footer-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 720px) { .site-footer { grid-template-columns: minmax(0, 1fr); padding: var(--s4); } .footer-links { justify-content: flex-start; } }

/* ======================================================================= help center */
.help-search { position: relative; margin-bottom: var(--s5); }
.help-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }
.help-search input { width: 100%; height: 52px; padding: 0 16px 0 44px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.help-search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.help-search input:focus { outline: none; }
.help-sec { margin-bottom: var(--s6); }
.help-sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s3); }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.help-card { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4); color: var(--text); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.help-card:hover { color: var(--text); text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.help-card span { color: var(--text-2); font-size: 13.5px; }
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.help-toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.toc-wrap > summary { display: none; }
.toc-group { margin-bottom: var(--s4); }
.toc-h { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s1); }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc a { display: block; padding: 5px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; border-left: 2px solid transparent; }
.help-toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.help-toc a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.help-article { padding: var(--s8) var(--s10); max-width: 860px; }
.help-article h1 { font-size: 26px; margin-bottom: var(--s2); }
.help-article > .lede { color: var(--text-2); font-size: 16px; margin-bottom: var(--s6); }
.help-body { font-size: 15px; line-height: 1.65; color: var(--text); }
.help-body > * + * { margin-top: var(--s4); }
.help-body h2 { font-size: 18px; margin-top: var(--s8); }
.help-body ul, .help-body ol { padding-left: 22px; }
.help-body li + li { margin-top: 6px; }
.help-body pre { background: var(--side-bg); color: #e6edf5; padding: var(--s4); border-radius: var(--radius); overflow: auto; font-size: 13px; line-height: 1.6; }
.help-body code { font-family: var(--mono); font-size: .9em; }
.help-body :not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.help-body table { font-size: 14px; }
.help-note { padding: var(--s4); border-radius: var(--radius); background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--text); }
.help-code { padding-top: var(--s4); border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.help-code h2 { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-top: 0; }
.glossary dt { font-weight: 650; margin-top: var(--s3); }
.glossary dd { margin: 2px 0 0; color: var(--text-2); }
.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s10); padding-top: var(--s5); border-top: 1px solid var(--border); }
.help-pager a { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; }
.help-pager a:hover { border-color: var(--accent); text-decoration: none; }
.help-pager .next { text-align: right; }
@media (max-width: 1100px) { .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; max-height: none; }
  .toc-wrap > summary { display: block; cursor: pointer; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; }
  .toc-wrap:not([open]) { margin-bottom: 0; }
  .toc-wrap[open] > summary { margin-bottom: var(--s3); }
  .help-article { padding: var(--s5); }
  .help-grid { grid-template-columns: minmax(0, 1fr); }
}

.unit-wrap { display: inline-flex; align-items: center; gap: 6px; }
.unit { color: var(--text-2); font-weight: 600; font-size: 13.5px; }

/* help navigation: always a visible way back */
.help-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s4); font-weight: 600; font-size: 14px; }
.toc-home { display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; }
.toc-home svg { width: 16px; height: 16px; color: var(--accent); }
.toc-home:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.help-article .crumbs a { color: var(--accent); }
.help-article .crumbs [aria-current] { color: var(--text-2); }
.help-sec { scroll-margin-top: 80px; }
.help-sec.flash h2 { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .splash.landed .splash-center { opacity: 0; }
  .splash.welcome .splash-welcome { opacity: 1; }
}

/* exports: one row per file, the noun first, then what is inside and who uses it */
.export-run { margin-bottom: var(--s4); }
.export-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding: var(--s5) var(--s5) var(--s3); }
.export-head h2 { font-size: 17px; margin-bottom: 2px; }
.export-head p { color: var(--text-2); font-size: 13.5px; }
.export-tally { margin-top: 4px; color: var(--text-3) !important; }
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.file-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--s3) var(--s4); align-items: start; padding: var(--s4) var(--s5); }
.file-row + .file-row { border-top: 1px solid var(--border); }
.file-type { display: grid; place-items: center; height: 36px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.t-csv { background: var(--ok-soft); color: var(--ok); } .t-excel { background: var(--accent-soft); color: var(--accent-strong); } .t-summary { background: var(--copper-soft); color: var(--copper-strong); }
.file-main b { font-size: 15px; }
.file-main p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; max-width: 680px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-3) !important; font-size: 12.5px !important; margin-top: 6px !important; }
.file-meta code { font-size: 11.5px; }
.file-actions { display: flex; gap: var(--s2); align-self: center; }
@media (max-width: 720px) { .file-row { grid-template-columns: 56px minmax(0, 1fr); } .file-actions { grid-column: 2; } .file-type { font-size: 9.5px; letter-spacing: .02em; } }
.dialog.dialog-wide { width: min(900px, calc(100vw - 32px)); }
.summary-body { max-height: 65vh; overflow: auto; display: flex; flex-direction: column; gap: var(--s3); font-size: 14px; color: var(--text-2); }
.summary-body .sub-h { margin: var(--s3) 0 0; }

/* rules editor */
.text-input { height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; width: 100%; min-width: 0; }
.text-input:focus, .num-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-input.changed, .num-input.changed { border-color: var(--copper); background: var(--copper-soft); }
.code-input { font-family: var(--mono); font-size: 13px; max-width: 120px; }
.setting > div:first-child { min-width: 0; }
.setting .s-name { display: block; }
.setting-block { flex-direction: column; align-items: stretch; }
.changed-box { outline: 2px solid var(--copper); outline-offset: 4px; border-radius: 6px; }
.words-edit { display: flex; flex-direction: column; gap: var(--s2); }
.word-chips { list-style: none; margin: 0; padding: 0; }
.word-chip { gap: 4px; padding-right: 2px; }
.chip-x { border: 0; background: none; width: 20px; height: 20px; border-radius: 4px; color: var(--text-3); cursor: pointer; font-size: 15px; line-height: 1; }
.chip-x:hover { background: var(--fail-soft); color: var(--fail); }
.word-add { display: flex; gap: var(--s2); max-width: 420px; }
.map-edit { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.map-head, .map-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 36px; gap: var(--s2); width: 100%; align-items: center; }
.map-head { font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.map-row .icon-btn { width: 34px; height: 34px; font-size: 16px; }
.order-edit { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-direction: column; gap: 4px; }
.order-edit li { display: grid; grid-template-columns: 26px 1fr auto; gap: var(--s2); align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.order-name { font-size: 13px; color: var(--text-2); }
.order-btns { display: inline-flex; gap: 4px; }
.order-btns .icon-btn { width: 30px; height: 30px; font-size: 14px; }
.order-btns .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.switch { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--control-border); position: relative; transition: background var(--dur) var(--ease); }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform var(--dur) var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 520px) { .map-head, .map-row { grid-template-columns: minmax(0, 1fr) 90px 36px; } }
.edit-bar .impact { max-height: 30vh; overflow: auto; padding-right: 4px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast-btn { border: 0; border-radius: 6px; padding: 5px 10px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font: inherit; font-weight: 700; cursor: pointer; }
.toast-btn:hover, .toast-btn:focus-visible { background: color-mix(in srgb, var(--bg) 30%, transparent); outline: 2px solid var(--bg); outline-offset: 1px; }

/* suggested fixes */
.suggest { border-left: 3px solid var(--accent); }
.suggest-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; padding: var(--s4) var(--s5) var(--s2); }
.suggest-head h2 { display: flex; gap: 6px; align-items: center; font-size: 15px; }
.suggest-head h2 svg { width: 16px; height: 16px; color: var(--accent); stroke-width: 2.4; }
.suggest-list { list-style: none; margin: 0; padding: 0 var(--s5) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.suggest-list li { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.suggest-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.suggest-main p { color: var(--text); font-size: 14px; }
.suggest-main .suggest-why { color: var(--text-3); font-size: 12.5px; }
.suggest-list .btn { flex: none; }
.suggest-inline { display: flex; align-items: center; gap: var(--s2); margin-top: 6px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.ins-fill { background: var(--accent) !important; }
@media (max-width: 520px) { .suggest-list li { flex-direction: column; align-items: stretch; } }

/* new batch */
.mode-banner { padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s4); font-size: 14px; border: 1px solid; }
.mode-demo { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.mode-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.mode-warn { background: var(--hold-soft); border-color: color-mix(in srgb, var(--hold) 30%, transparent); }
.batch-flow { display: flex; flex-direction: column; gap: var(--s4); max-width: 880px; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s4); padding: var(--s5); }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.step-body { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.step-body h2 { font-size: 17px; }
.nb-name { display: flex; flex-direction: column; gap: var(--s2); max-width: 520px; }
.nb-name .text-input { height: 44px; font-size: 16px; }
.tz-wrap { display: grid; gap: 4px; justify-items: end; min-width: 0; }
.tz-select { width: min(360px, 100%); padding-right: 28px; cursor: pointer; }
@media (max-width: 640px) { .tz-wrap { justify-items: stretch; } }
.chip-btn { cursor: pointer; font: inherit; font-size: 12.5px; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.nb-folder { font-size: 13.5px; color: var(--text-2); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s8) var(--s4); text-align: center; cursor: pointer;
  border: 2px dashed var(--control-border); border-radius: var(--radius); background: var(--surface-2); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone svg { width: 36px; height: 36px; color: var(--accent); }
.link-like { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.nb-summary { display: flex; justify-content: space-between; gap: var(--s3); font-size: 13.5px; color: var(--text-2); }
.nb-files { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.nb-file { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; gap: var(--s3); align-items: center; padding: 8px 10px; }
.nb-file + .nb-file { border-top: 1px solid var(--border); }
.nb-main b { display: block; overflow-wrap: anywhere; font-size: 14px; }
.nb-main .sub { display: block; font-size: 12.5px; color: var(--text-3); }
.nb-ic svg { width: 18px; height: 18px; stroke-width: 2.2; }
.st-ok .nb-ic { color: var(--ok); } .st-warn .nb-ic, .st-warn .sub { color: var(--hold); } .st-bad .nb-ic, .st-bad .sub { color: var(--fail); } .st-checking .nb-ic { color: var(--text-3); }
.choice label.is-disabled { opacity: .6; cursor: not-allowed; }
.nb-review { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); margin: 0; padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface-2); }
.nb-review dt { font-size: 12px; color: var(--text-3); font-weight: 600; }
.nb-review dd { margin: 0; font-weight: 600; }
#nb-go { align-self: flex-start; }
#nb-go:disabled { opacity: .5; cursor: not-allowed; }
.nb-progress, .nb-done { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.nb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.nb-steps li { display: grid; grid-template-columns: 26px 1fr; gap: var(--s2); align-items: start; }
.nb-steps .sub { display: block; color: var(--text-3); font-size: 12.5px; }
.ns-done .nb-ic { color: var(--ok); } .ns-error .nb-ic { color: var(--fail); }
.nb-steps .spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
.nb-bar { background: var(--surface-3); }
.nb-bar span { background: var(--accent); }
.nb-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.nb-counts li { padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.nb-counts b { display: block; font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.nb-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 600px) { .step { grid-template-columns: minmax(0, 1fr); } .nb-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .nb-steps .spin { animation: none; } }

/* ---------------------------------------------------------------- v1.5: blockers, recheck, manual entry, urgency */
.b-ready { color: var(--accent-strong); background: var(--accent-soft); }
.b-manual { color: var(--copper-strong); background: var(--copper-soft); }
.sub { display: block; color: var(--text-3); font-size: 12.5px; }
.sub-inline { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.form-warn { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--hold-soft); color: var(--hold); font-size: 13.5px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); margin: 10px 0; cursor: pointer; }
.check-line input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dlg-files { list-style: none; padding: 0; margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); display: grid; gap: 2px; }
.due-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); margin-right: 4px; }
.due-tag.late { background: var(--hold-soft); color: var(--hold); }
.due-tag.soon { background: var(--copper-soft); color: var(--copper-strong); }
.urgency { margin-top: 6px; }

.blocker-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.blocker { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.blocker.st-cleared { background: var(--surface-2); }
.bl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bl-top b { font-weight: 600; margin-right: auto; }
.bl-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0 0; font-size: 13px; }
.bl-meta dt { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.bl-meta dd { margin: 0; color: var(--text); }
.bl-note { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2); }
.bl-files { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 2px; font-size: 13px; }
.bl-actions { display: flex; gap: 8px; margin-top: 10px; }
.bl-done { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--ok); font-weight: 600; }
.bl-done svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

.recheck { border-color: var(--accent); }
.rc-verdict { font-weight: 600; margin-bottom: 12px; }
.rc-verdict.ok { color: var(--ok); } .rc-verdict.hold { color: var(--hold); }
.rc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rc-col { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-width: 0; }
.rc-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; }
.rc-col .chips { margin: 6px 0; }
.rc-col .notes { font-size: 13.5px; }
.rc-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0 10px; font-size: 13px; }
.rc-versions dt { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.rc-versions dd { margin: 0; overflow-wrap: anywhere; }
.callout-manual { background: var(--copper-soft); border-color: color-mix(in srgb, var(--copper) 30%, transparent); }
.callout-manual .callout-title { color: var(--copper-strong); }

.m-steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.m-steps li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-3); }
.m-steps .sub { flex-basis: 100%; font-size: 11.5px; }
.ms-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 12px; flex: none; }
.ms-n svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.m-steps .ms-now { border-color: var(--accent); color: var(--text); font-weight: 600; }
.m-steps .ms-now .ms-n { background: var(--accent); color: var(--on-accent, #fff); }
.m-steps .ms-done { color: var(--ok); } .m-steps .ms-done .ms-n { background: var(--ok-soft); }
.manual-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.m-evidence { position: sticky; top: 76px; }
.m-files { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.m-files li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.m-files li.on { border-color: var(--accent); background: var(--accent-soft); }
.m-files li.st-bad { border-color: var(--hold); }
.m-preview { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); min-height: 120px; display: grid; place-items: center; overflow: hidden; margin-bottom: 10px; }
.m-preview img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: #fff; }
.m-preview iframe { width: 100%; height: 60vh; border: 0; background: #fff; }
.dz-sm { padding: var(--s4); }
.m-form h2 { font-size: 18px; margin-bottom: 6px; }
.m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.m-grid .span2 { grid-column: span 2; }
.m-grid .field select { height: 34px; }
.m-lines { display: grid; gap: 6px; }
.m-line { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.5fr) 34px; gap: 6px; align-items: center; }
.m-line-head { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.m-lines > .btn { justify-self: start; margin-top: 4px; }
.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.m-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tie { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 13.5px; }
.tie li { display: flex; gap: 8px; align-items: center; }
.tie svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.tie .ok { color: var(--ok); } .tie .bad { color: var(--hold); } .tie .info { color: var(--copper-strong); }
.m-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0; font-size: 14px; }
.m-summary dt { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.m-summary dd { margin: 0; overflow-wrap: anywhere; }
.m-lines-table { margin: 8px 0 12px; }

.queue-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.queue-bar .segmented { margin: 0; }
.queue-why { padding: 0 20px 6px; }
.edit-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.sim-list li { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.sim-doc { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.sim-doc .sub { display: inline; }
.sim-change { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sim-change .arrow { color: var(--text-3); margin: 0 4px; }
.waiting { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.waiting li { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.waiting li > div:first-child { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: minmax(0, 1fr); }
  .m-evidence { position: static; }
  .m-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .rc-cols, .rc-versions, .m-grid, .m-summary, .field-row { grid-template-columns: minmax(0, 1fr); }
  .m-grid .span2 { grid-column: auto; }
  .m-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .m-line > input[data-lf="desc"] { grid-column: 1 / -1; }
  .m-line-head { display: none; }
}

/* ---------------------------------------------------------------- v1.6: version and updates */
.version-tag { margin-left: var(--s3); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.version-tag:hover { color: var(--accent); }
.version-tag.needs { color: var(--hold); font-weight: 600; }
.update-banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 16px 28px 0; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.update-banner .ub-text { flex: 1 1 320px; min-width: 0; }
.update-banner .ub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ub-optional { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.ub-required { background: var(--hold-soft); border-color: var(--hold); color: var(--text); border-left-width: 4px; }
.ub-required strong { color: var(--hold); }
.releases { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.release { padding: 16px 20px; }
.release.mine { border-color: var(--accent); }
.rel-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 6px; }
.rel-head h2 { font-size: 17px; margin-right: 4px; }
.rel-date { margin-left: auto; color: var(--text-3); font-size: 13px; }
.release .notes { margin-top: 8px; font-size: 14px; }
@media (max-width: 720px) { .update-banner { margin: 12px 16px 0; } .version-tag { margin-left: 0; display: block; } }
.uc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.uc-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.uc-box.uc-new { border-color: var(--accent); background: var(--accent-soft); }
.uc-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.uc-ver { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.uc-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.uc-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 14px; }
.uc-how { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; margin-bottom: 10px; }
@media (max-width: 480px) { .uc-grid { grid-template-columns: minmax(0, 1fr); } }
#uc-body .form-warn { margin-bottom: 10px; }

/* ---------------------------------------------------------------- v1.7: people, sign-in links, outbox */
.auth-card-solo { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin: 0 auto; }
.auth-card-solo .auth-logo { margin-bottom: 18px; color: var(--text); }
.forgot-link { justify-self: start; margin-top: 4px; font-size: 14px; }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 2px; font-size: 12.5px; color: var(--text-3); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓ "; }
.u-person { display: inline-flex; gap: 10px; align-items: center; }
.u-person .avatar { width: 32px; height: 32px; font-size: 12px; flex: none; }
.u-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.role-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.role-list b { color: var(--text); margin-right: 4px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.data.outbox tr[data-mail] { cursor: pointer; }
@media (max-width: 720px) { .u-actions { justify-content: flex-start; } }

/* ---------------------------------------------------------------- v1.7: appearance */
.look-card { margin-bottom: 16px; }
.look-card h2 { font-size: 17px; margin-bottom: 10px; }
.look-follow { margin-bottom: 14px; }
/* Following the company look: your own choices are set aside, shown with a side rule (never by fading text, which loses contrast). */
.look-dim { border-left: 3px solid var(--border); padding-left: 12px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.preset:hover { border-color: var(--control-border); }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.preset .sub { font-size: 12px; color: var(--text-3); }
.sw { display: flex; gap: 0; border-radius: 6px; overflow: hidden; width: 100%; height: 22px; border: 1px solid var(--border); }
.sw i { flex: 1; }
.sw-custom i { flex: 1; }
.custom-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 14px; }
.custom-row input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.custom-row .code-input { width: 110px; }
.custom-row .hint { flex-basis: 100%; }
.ok-hint { color: var(--ok); }
.look-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 10px 0; }
.look-label { min-width: 96px; font-weight: 600; font-size: 14px; }
.look-seg { margin: 0; }
.look-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.pv-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
body.density-compact main { padding-top: 18px; }
body.density-compact .page-head { margin-bottom: 14px; }
body.density-compact .card-body { padding: 10px 16px 12px; }
body.density-compact .card-pad { padding: 12px 14px; }
body.density-compact th, body.density-compact td { padding-top: 6px; padding-bottom: 6px; }
body.density-compact .stack { gap: 10px; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
.look-saved { margin: -10px 0 14px; font-size: 13px; color: var(--ok); }

/* ---------------------------------------------------------------- v1.9: where values appear on the page */
.pdf-page { position: relative; flex: none; width: 100%; }
.pdf-hl-layer { position: absolute; inset: 0; pointer-events: none; }
.pdf-hl { position: absolute; border-radius: 3px; background: color-mix(in srgb, var(--copper) 22%, transparent); outline: 1.5px solid var(--copper); }
.pdf-hl.on { background: color-mix(in srgb, var(--accent) 24%, transparent); outline: 2px solid var(--accent); animation: hl-pulse 1.2s ease-out 1; }
.pdf-hl span { position: absolute; left: 0; bottom: 100%; margin-bottom: 2px; padding: 0 5px; border-radius: 3px; background: #17212f; color: #fff; font-size: 10.5px; line-height: 15px; white-space: nowrap; }
@keyframes hl-pulse { from { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.src-btn { margin-left: 8px; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--accent-strong); font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap; vertical-align: 1px; }
.src-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.src-all[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.pdf-bar { gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .pdf-hl.on { animation: none; } }
body.reduce-motion .pdf-hl.on { animation: none; }

/* ---------------------------------------------------------------- v1.9: export history */
.ex-history { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.ex-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.ex-steps li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-3); min-width: 0; }
.ex-steps li b { display: block; color: var(--text-2); font-weight: 600; }
.ex-steps li.done b { color: var(--ok); } .ex-steps li.now b { color: var(--text); }
.ex-steps .sub { font-size: 12px; overflow-wrap: anywhere; }
.ex-dot { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; background: var(--surface); }
.ex-steps li.done .ex-dot { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.ex-steps li.now .ex-dot { border-color: var(--accent); }
.ex-dot svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.6; }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ex-sha { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.ex-none { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-3); }
.ex-none svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
@media (max-width: 760px) { .ex-steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- v1.9: watched folder */
.watch-card h2 { font-size: 17px; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.watch-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; justify-content: space-between; }
.watch-card p { margin-bottom: 6px; }
.watch-ignored { margin-top: 8px; font-size: 13.5px; }

/* ---------------------------------------------------------------- v1.9: long lists */
.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.pager-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pager-at { padding: 0 6px; font-variant-numeric: tabular-nums; }
.pager-per { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }
.pager-per select { height: 30px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; padding: 0 6px; }
.list-more { padding: 10px 16px; border-top: 1px solid var(--border); margin: 0; }

/* ---------------------------------------------------------------- v1.9: accessibility pass */
/* A link inside a sentence is underlined, so it never depends on color alone (WCAG 1.4.1). */
main p a:not(.btn), main .prose li a, main .notes li a, .mode-banner a, #dialog p a, .login-foot a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.back-link, .pdf-bar a, .card-head a { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }   /* WCAG 2.2 target size */
.table-wrap[tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* ---------------------------------------------------------------- v1.9.1: made for phones */
.filters-toggle { display: none; }
.table-wrap.scrolls { background: linear-gradient(to left, var(--surface-2), transparent 28px) right / 28px 100% no-repeat local, none; box-shadow: inset -10px 0 8px -8px rgba(15, 23, 42, .18); }

/* Touch: every control is at least 44 pixels, the size Apple and Google recommend for a thumb. */
@media (max-width: 860px), (pointer: coarse) {
  .btn, .btn-sm { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  .icon-btn { width: 44px; height: 44px; }
  .user-btn { min-height: 44px; }
  .field input, .field select, .pager-per select, .num-input, .text-input { height: 44px; min-height: 44px; }
  .segmented button { min-height: 40px; padding: 8px 14px; }
  th button.sort { min-height: 44px; }
  .src-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .back-link, .pdf-bar a, .card-head a, .help-toc a, .toc-home { min-height: 44px; }
  .help-toc a { display: flex; align-items: center; }
  .chip-x { min-width: 36px; min-height: 36px; }
  .order-btns .icon-btn { width: 40px; height: 40px; }
  .map-row .icon-btn { width: 40px; height: 40px; }
  .map-head, .map-row { grid-template-columns: minmax(0, 1fr) 96px 40px; }
  .nav a { min-height: 44px; }
  .nb-names .chip, button.chip { min-height: 40px; padding-left: 14px; padding-right: 14px; }
  .record-step { gap: 8px; }
}

@media (max-width: 640px) {
  /* iPhones zoom the whole page when a field's text is under 16 pixels. Keep fields at 16. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]), select, textarea { font-size: 16px !important; }

  /* ---- page tables become cards: no sideways scrolling, and the amount is always in view */
  table.data, table.data tbody, table.data tfoot { display: block; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.data tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data td { display: block; grid-column: 1 / -1; padding: 0; border: 0; min-width: 0; white-space: normal !important; }
  table.data td:empty { display: none; }
  table.data tbody tr:hover td { background: transparent; }
  table.data tbody tr:active { background: var(--surface-2); }
  table.data .hide-sm { display: block; }
  table.data tfoot .hide-sm { display: none; }
  /* cells other than the first say which column they are */
  table.data:not(.docs) td[data-label]:not(:first-child) { position: relative; padding-left: 116px; min-height: 24px; }
  table.data:not(.docs) td[data-label]:not(:first-child)::before { content: attr(data-label); position: absolute; left: 0; top: 3px; width: 108px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
  table.data:not(.docs) tr { gap: 8px 12px; }
  table.data:not(.docs) td:first-child { font-weight: 550; }
  table.data.audit td:first-child { font-weight: 400; color: var(--text-2); font-size: 13.5px; }
  /* the invoice list: vendor on the left, amount on the right, then the date and the status */
  table.data.docs td:first-child { grid-column: 1; grid-row: 1; }
  table.data.docs td.num { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; white-space: nowrap !important; }
  table.data.docs td.hide-sm { color: var(--text-3); font-size: 13px; }
  table.data.docs td .main-link { display: inline-block; padding: 2px 0; font-size: 15.5px; }
  table.data.docs tr.tfoot td:first-child { grid-column: 1; }
  /* sorting: the column headers become a row of buttons above the cards */
  table.data.sortable thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: block; }
  table.data.sortable thead tr { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; align-items: center; background: var(--th-bg); }
  table.data.sortable thead tr::before { content: "Sort by"; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
  table.data.sortable th { display: block; padding: 0; border: 0; background: none; border-radius: 0; }
  table.data.sortable th button.sort { min-height: 36px; padding: 0 12px; border: 1px solid var(--control-border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 12.5px; text-transform: none; letter-spacing: 0; }
  table.data.sortable th[aria-sort] button.sort { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

  /* ---- filters: two columns, full-width fields, folded behind one button on the Invoices page */
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .filters .field { min-width: 0; }
  .filters .field input, .filters .field select { width: 100%; min-width: 0; }
  .filters .field-grow { grid-column: 1 / -1; }
  #inv-filters .filters-toggle { display: inline-flex; justify-content: center; grid-column: 1 / -1; }
  #inv-filters:not(.open) .field:not(.field-grow), #inv-filters:not(.open) #f-clear { display: none; }
  .filter-summary { flex-wrap: wrap; gap: 4px 12px; }

  /* ---- dialogs rise from the bottom, where thumbs are */
  .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; border-width: 1px 0 0; max-height: 92dvh; overflow-y: auto; }
  .dialog form { padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .dialog-actions .btn { justify-content: center; }

  /* ---- the pager and record steps spread across the width */
  .pager { justify-content: center; text-align: center; }
  .pager-ctl { justify-content: center; }
  .record-nav { row-gap: 8px; }
  .record-step { width: 100%; justify-content: space-between; }
  .record-step .btn { flex: 1; justify-content: center; }
  .record-step .hint { flex: 0 0 auto; }
  .card-head { flex-wrap: wrap; gap: 6px 12px; }
  .team-head { flex-wrap: wrap; gap: 4px 12px; }
  .queue-bar .segmented, .queue-bar .segmented button { flex: 1 1 auto; }
  .queue-bar .segmented { display: flex; }
}

/* ---------------------------------------------------------------- v2.0: working as a team */
.team-note { position: fixed; left: 50%; top: 68px; transform: translateX(-50%); z-index: 60; min-height: 40px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--surface); color: var(--accent-strong); font: inherit; font-weight: 550; font-size: 13.5px; box-shadow: var(--shadow-lg); cursor: pointer; }
.team-note:hover { background: var(--accent-soft); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- v2.1: the setup wizard (setup.html) */
.setup-page { background: var(--bg); }
.setup-wrap { min-height: 100vh; max-width: 980px; margin: 0 auto; padding: var(--s8) var(--s4); display: flex; flex-direction: column; gap: var(--s5); }
.setup-top { display: flex; align-items: center; gap: 12px; }
.setup-brand { font-size: 20px; font-weight: 700; line-height: 1.1; }
.setup-sub { color: var(--text-3); font-size: 13px; }
.setup-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.setup-steps { background: var(--surface-2); border-right: 1px solid var(--border); padding: var(--s6) var(--s5); }
.setup-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.setup-steps li { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 14px; }
.setup-steps .n { display: inline-grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1px solid var(--control-border); font-size: 12.5px; font-weight: 650; background: var(--surface); }
.setup-steps li.now { color: var(--text); font-weight: 600; }
.setup-steps li.now .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.setup-steps li.done { color: var(--text-2); }
.setup-steps li.done .n { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.setup-main { padding: var(--s8); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.setup-main:focus { outline: none; }
.setup-main h1 { font-size: 24px; }
.setup-main h2 { font-size: 16px; }
.setup-main .lede { color: var(--text-2); font-size: 15px; }
.setup-main form { display: flex; flex-direction: column; gap: var(--s4); align-items: flex-start; }
.setup-main form > * { width: 100%; }
.setup-main form > .btn { width: auto; }
.setup-main .field input, .setup-main .field select { width: 100%; }
.setup-main .field .hint { margin-top: 2px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: var(--s2); }
.setup-actions .btn-ghost { margin-right: auto; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.check-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 11px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.check-list li:last-child { border-bottom: 0; }
.check-list svg { width: 20px; height: 20px; margin-top: 1px; }
.check-list li.ok svg, .setup-found svg { color: var(--ok); }
.check-list li.bad svg { color: var(--fail); }
.check-list li.note svg { color: var(--text-3); }
.check-list b { display: block; font-weight: 600; }
.check-list span { display: block; color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; }
.check-list .fix { color: var(--hold); margin-top: 2px; }
.check-list li.bad { background: var(--fail-soft); }
.setup-found { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); font-size: 13.5px; }
.setup-found svg { flex: 0 0 20px; width: 20px; height: 20px; }
.setup-found b, .setup-found span { display: block; overflow-wrap: anywhere; }
.setup-quick { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.setup-quick .btn { height: auto; min-height: 32px; padding: 6px 10px; text-align: left; overflow-wrap: anywhere; white-space: normal; font-weight: 500; }
.setup-admin, .setup-set { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin: 0; display: grid; gap: var(--s3); min-width: 0; }
.setup-admin legend, .setup-set legend { font-weight: 650; padding: 0 6px; }
.setup-cert { display: grid; gap: var(--s3); justify-items: start; padding-top: var(--s2); }
.setup-cert .field { width: 100%; }
.setup-next { border-top: 1px solid var(--border); padding-top: var(--s4); display: grid; gap: var(--s2); }
.setup-credit { text-align: center; color: var(--text-3); font-size: 13px; }
@media (max-width: 720px) {
  .setup-wrap { padding: var(--s4) var(--s3); }
  .setup-card { grid-template-columns: minmax(0, 1fr); }
  .setup-steps { border-right: 0; border-bottom: 1px solid var(--border); padding: var(--s3) var(--s4); }
  .setup-steps ol { display: flex; gap: 6px; justify-content: space-between; }
  .setup-steps li > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .setup-steps li.now > span:last-child { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .setup-main { padding: var(--s5) var(--s4); }
  .setup-actions .btn { flex: 1 1 auto; justify-content: center; }
  .setup-actions .btn-ghost { flex: 0 0 auto; }
}
.setup-coin { width: 44px; height: 44px; flex: 0 0 44px; }

/* ---------------------------------------------------------------- v2.1.1: decisions and why */
.help-why { margin-top: var(--s5); background: var(--surface-2); border-left-color: var(--brand, var(--accent)); }
main .help-note a, main td a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }   /* a link inside a note or a table cell never depends on color alone */

/* ---------- v2.2: the guided tour */
.tour {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 14px; box-shadow: var(--shadow-lg);
}
.tour[hidden] { display: none; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-step { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.tour h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.tour h2:focus { outline: none; }
.tour h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.tour-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text); }
.tour-bar { height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tour-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .2s ease; }
.tour-actions { display: flex; justify-content: flex-end; gap: 10px; }
.tour-close { flex: none; }
.tour-start svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tour-spot { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); scroll-margin: 96px 0 220px; }
.touring .main-col { padding-bottom: 240px; }             /* room to scroll the last part of a page out from under the card */
@media (max-width: 860px) {
  .tour { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 14px 16px 16px; }
  .tour-actions .btn { flex: 1; }
  .touring .main-col { padding-bottom: 280px; }
}
.touring .toast { bottom: auto; top: 76px; }              /* a passing message moves up, so it never covers the tour's buttons */
@media print { .tour { display: none; } }

/* ---------- v2.3: my profile */
.avatar.has-photo { background: var(--surface-2); overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-pop a[role=menuitem] { display: block; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); font: inherit; text-align: left; text-decoration: none; }
.user-pop a[role=menuitem]:hover, .user-pop a[role=menuitem]:focus-visible { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pf-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pf-body { display: flex; flex-direction: column; gap: 18px; }
.pf-photo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pf-avatar { width: 96px; height: 96px; font-size: 32px; }
.pf-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.pf-photo-actions .hint { flex-basis: 100%; margin: 0; }
.pf-photo-actions input:focus-visible + .btn, .pf-photo-actions label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pf-wide { grid-column: 1 / -1; }
.pf-fields textarea { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--control-border); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.pf-fields textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pf-fields .hint, .pf-pw .hint { margin: 2px 0 0; }
.pf-actions { display: flex; justify-content: flex-end; }
.pf-facts, .pf-stats { display: grid; gap: 10px; margin: 0 0 12px; }
.pf-facts > div, .pf-stats > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pf-facts dt, .pf-stats dt { color: var(--text-2); font-size: 13px; }
.pf-facts dd, .pf-stats dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pf-stats dd { font-variant-numeric: tabular-nums; }
.pf-breakdown { width: 100%; margin-bottom: 12px; }
.pf-breakdown .num { text-align: right; }
.pf-pw form { display: flex; flex-direction: column; gap: 12px; }
.pf-pw .look-saved, #pf-saved { margin: 0 0 12px; }
.u-about, .u-backup { display: block; }
@media (max-width: 980px) { .pf-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .pf-fields { grid-template-columns: minmax(0, 1fr); } .pf-actions .btn { width: 100%; } }
