/* Self-hosted fonts (SIL Open Font Licence): nothing loads from Google. */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans.e35fad09c70b.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-400.814fe1615d4d.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-500.6708425c446b.woff2") format("woff2"); }
/* Everything below this line up to "Portal additions" is the locked mock-up's stylesheet (D31). */
:root {
  --ground: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #131A26;
  --ink-2: #394356;
  --muted: #687184;
  --line: #E1E5EC;
  --line-strong: #CAD1DC;
  --accent: #2E4A9E;
  --accent-hover: #243C85;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAEFFB;
  --accent-line: #C8D3F1;
  --hero: #17265C;
  --hero-2: #213478;
  --hero-ink: #F5F7FF;
  --hero-muted: #B2BDE0;
  --hero-line: rgba(255,255,255,.16);
  --seg-ns: rgba(255,255,255,.34);
  --seg-wait: #F2B658;
  --seg-done: #5CC690;
  --ok: #16794B;
  --ok-soft: #E2F3E9;
  --warn: #9A5B00;
  --warn-soft: #FFF0D2;
  --bad: #B42318;
  --bad-soft: #FDEBE9;
  --ai-mark: #C8D3F1;
  --shadow: 0 1px 2px rgba(19,26,38,.05), 0 8px 24px rgba(19,26,38,.06);
  --shadow-hover: 0 2px 4px rgba(19,26,38,.07), 0 12px 32px rgba(19,26,38,.10);
  --radius: 12px;
  --font-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0D121A; --surface: #141B26; --surface-2: #19212E;
    --ink: #E8ECF2; --ink-2: #C4CBD7; --muted: #8F99AB;
    --line: #253042; --line-strong: #324056;
    --accent: #93AAF3; --accent-hover: #AFC0F7; --accent-ink: #0D121A;
    --accent-soft: #1B2644; --accent-line: #33457A;
    --hero: #17224B; --hero-2: #1F2D5E; --hero-ink: #F0F3FF; --hero-muted: #A7B3D9; --hero-line: rgba(255,255,255,.12);
    --ok: #5CC690; --ok-soft: #12301F; --warn: #F2B658; --warn-soft: #33260E;
    --bad: #F2877C; --bad-soft: #3A1715; --ai-mark: #33457A;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0D121A; --surface: #141B26; --surface-2: #19212E;
  --ink: #E8ECF2; --ink-2: #C4CBD7; --muted: #8F99AB;
  --line: #253042; --line-strong: #324056;
  --accent: #93AAF3; --accent-hover: #AFC0F7; --accent-ink: #0D121A;
  --accent-soft: #1B2644; --accent-line: #33457A;
  --hero: #17224B; --hero-2: #1F2D5E; --hero-ink: #F0F3FF; --hero-muted: #A7B3D9; --hero-line: rgba(255,255,255,.12);
  --ok: #5CC690; --ok-soft: #12301F; --warn: #F2B658; --warn-soft: #33260E;
  --bad: #F2877C; --bad-soft: #3A1715; --ai-mark: #33457A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; left: -9999px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
svg.i { width: 14px; height: 14px; flex: none; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--hero); display: grid; place-items: center; }
.brand .mark svg { width: 18px; height: 18px; color: #fff; transform: rotate(12deg); }
.brand small { display: block; font-weight: 500; letter-spacing: .01em; text-transform: none; color: var(--muted); font-size: 12px; line-height: 1.2; }
.nav { display: flex; gap: 4px; }
.nav a, .nav span { padding: 6px 11px; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav span { color: var(--muted); cursor: not-allowed; }
.search { position: relative; flex: 1; max-width: 480px; margin-left: auto; }
.search input { width: 100%; padding: 9px 38px 9px 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; background: var(--surface); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 6px; max-height: 70vh; overflow: auto; }
.results .label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 6px 10px 4px; font-weight: 600; }
.result { display: grid; grid-template-columns: auto 1fr auto; gap: 0 12px; align-items: center; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.result.sel, .result:hover { background: var(--accent-soft); }
.result .r-name { font-weight: 600; }
.result .r-name mark { background: transparent; color: var(--accent); }
.result .r-meta { color: var(--muted); font-size: 12.5px; }
.result .r-count { font-size: 12.5px; color: var(--ink-2); }
.results .empty { padding: 12px; color: var(--muted); }
.user { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10.5px; }

.mockbar { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mockbar-inner { max-width: 1280px; margin: 0 auto; padding: 7px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.mockbar strong { color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 3px 11px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.mockbar .spacer { flex: 1; }

/* ---------- Layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 72px; display: grid; gap: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.005em; }
.section-head .hint { color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); line-height: 1.5; }
.pill svg.i { width: 12px; height: 12px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.plain { background: transparent; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 16px; color: var(--hero-ink); background: linear-gradient(135deg, var(--hero) 0%, var(--hero-2) 100%); padding: 26px 28px 24px; display: grid; gap: 22px; }
.hero .bgstar { position: absolute; right: -60px; top: -70px; width: 340px; height: 340px; color: #fff; opacity: .06; transform: rotate(18deg); pointer-events: none; }
.hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 24px; position: relative; }
.hero h1 { font-size: 28px; font-weight: 650; letter-spacing: -.015em; }
.hero .sub { color: var(--hero-muted); margin-top: 2px; }
.hero .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.btn.onhero { background: rgba(255,255,255,.1); border-color: var(--hero-line); color: var(--hero-ink); }
.btn.onhero:hover { background: rgba(255,255,255,.18); }
.hero .syncing { display: inline-flex; align-items: center; gap: 8px; color: var(--hero-ink); font-weight: 600; background: rgba(255,255,255,.1); border: 1px solid var(--hero-line); border-radius: 9px; padding: 7px 13px; }
.bignums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.bignum { padding: 2px 20px; border-left: 1px solid var(--hero-line); display: grid; gap: 2px; }
.bignum:first-child { border-left: 0; padding-left: 0; }
.bignum .v { font-size: 36px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bignum .v small { font-size: 18px; font-weight: 600; margin-left: 2px; color: var(--hero-muted); }
.bignum .k { color: var(--hero-muted); font-size: 13px; }
.pipeline { position: relative; display: grid; gap: 9px; padding-top: 18px; border-top: 1px solid var(--hero-line); }
.pipeline .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.pipeline .title { font-weight: 600; }
.pipeline .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--hero-muted); font-size: 13px; }
.pipeline .legend b { color: var(--hero-ink); font-variant-numeric: tabular-nums; }
.pipeline .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.pbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.1); gap: 2px; }
.pbar span { display: block; height: 100%; }

/* ---------- Attention lanes ---------- */
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.lane { display: grid; gap: 10px; }
.lane-head { display: flex; align-items: center; gap: 9px; padding: 0 2px; }
.lane-head .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.lane-head .ico svg { width: 14px; height: 14px; }
.lane.fix .ico { background: var(--bad-soft); color: var(--bad); }
.lane.chase .ico { background: var(--warn-soft); color: var(--warn); }
.lane.review .ico { background: var(--accent-soft); color: var(--accent); }
.lane-head h3 { font-size: 14.5px; font-weight: 650; }
.lane-head .n { margin-left: auto; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; display: grid; gap: 7px; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.acard:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.acard .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acard .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard .detail { color: var(--ink-2); font-size: 13.5px; }
.acard .foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.acard .foot .go { margin-left: auto; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.lane-empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.lane-empty svg { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .acard, .acard:hover { transition: none; transform: none; } }

/* ---------- Client table ---------- */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19,26,38,.1); }
.tabs .c { color: var(--muted); font-weight: 500; margin-left: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .c { opacity: .7; margin-left: 3px; font-variant-numeric: tabular-nums; }
.filter { margin-left: auto; position: relative; }
.filter input { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); width: 220px; max-width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
th button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
th button:hover { color: var(--ink); }
td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.cell-client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tile { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; flex: none; }
.tile.lg { width: 56px; height: 56px; border-radius: 15px; font-size: 19px; }
.c-name { font-weight: 650; }
.c-sub { color: var(--muted); font-size: 12.5px; }
.who { display: inline-flex; align-items: center; gap: 7px; }
.progress { display: grid; gap: 5px; min-width: 130px; }
.progress .t { font-size: 13px; color: var(--ink-2); }
.progress .t b { color: var(--ink); font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track .fill { height: 100%; background: var(--ok); border-radius: 3px; }
.synccell { display: grid; gap: 4px; justify-items: start; }

/* ---------- Client page ---------- */
.crumbs { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.chead { overflow: hidden; }
.chead-main { padding: 22px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 20px; align-items: center; }
.chead h1 { font-size: 27px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.chead .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.facts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.fact { display: grid; gap: 1px; }
.fact .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.fact .v { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.ring { display: grid; justify-items: center; gap: 4px; }
.ring svg { width: 84px; height: 84px; }
.ring .rt { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.3; }
.syncbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 13px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }
.syncbar .when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.syncbar .when strong { font-weight: 650; }
.syncbar .actions { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.accent { background: var(--accent); }
.steps { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; color: var(--muted); }
.step { display: inline-flex; align-items: center; gap: 7px; }
.step.done { color: var(--ok); font-weight: 550; }
.step.now { color: var(--accent); font-weight: 650; }
.spin { width: 13px; height: 13px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.hero .spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.inline-edit { display: inline-flex; gap: 6px; align-items: center; }
.inline-edit input, .inline-edit select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
.inline-edit input { width: 130px; }

.notice { display: flex; align-items: flex-start; gap: 11px; padding: 12px 16px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ink); }
.notice > svg { color: var(--ok); margin-top: 3px; width: 16px; height: 16px; flex: none; }
.notice.bad { background: var(--bad-soft); } .notice.bad > svg { color: var(--bad); }
.notice.warn { background: var(--warn-soft); } .notice.warn > svg { color: var(--warn); }
.notice .x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; align-items: start; }
.aside { display: grid; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); }
.itemtools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.group { overflow: hidden; }
.group-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.group-head h2 { font-size: 15px; font-weight: 650; }
.group-head .hint { color: var(--muted); font-size: 13px; }
.group-head .n { margin-left: auto; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 14px; padding: 16px 18px; border-top: 1px solid var(--line); align-items: start; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; margin-top: 1px; transition: border-color .12s, background .12s, color .12s; }
.tick svg.i { width: 14px; height: 14px; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick.received { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick.not_needed { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.tick.ghost { border-style: dashed; cursor: default; }
.item .body { display: grid; gap: 3px; min-width: 0; }
.item .title { font-weight: 650; font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; line-height: 1.35; }
.item .sub { color: var(--ink-2); }
.item .why { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.item .why .wl { font-weight: 650; color: var(--ink-2); margin-right: 6px; }
.item .why strong { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.item.s-received .title, .item.s-not_needed .title { color: var(--muted); font-weight: 600; }
.item.s-received .sub, .item.s-not_needed .sub { color: var(--muted); }
.item .by { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item.s-received .by { color: var(--ok); }
.item.dropped { opacity: .62; }
.item.dropped .title span.t { text-decoration: line-through; text-decoration-color: var(--muted); }
.more { position: relative; }
.morebtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.morebtn:hover, .morebtn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-hover); padding: 4px; min-width: 200px; z-index: 5; display: grid; }
.menu button { text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; font-weight: 550; }
.menu button:hover { background: var(--surface-2); }
.reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); margin-top: 3px; }
.reasons .q { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.group-empty { padding: 18px 20px; color: var(--muted); }

details.unclassified > summary { padding: 14px 20px; cursor: pointer; font-weight: 650; color: var(--ink-2); }
details.unclassified[open] > summary { border-bottom: 1px solid var(--line); }
.mini { width: 100%; border-collapse: collapse; min-width: 0; }
.mini td, .mini th { padding: 9px 20px; background: transparent; }
.mini tbody tr { cursor: default; }
.mini tbody tr:hover td { background: transparent; }

.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 650; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; display: grid; gap: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; position: relative; padding-bottom: 12px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .node { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); margin-top: 2px; display: grid; place-items: center; }
.timeline li.done .node { border-color: var(--ok); background: var(--ok); color: #fff; }
.timeline li.done .node svg { width: 10px; height: 10px; }
.timeline li.now .node { border-color: var(--accent); }
.timeline li.now .node::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.timeline .tl-t { font-weight: 600; }
.timeline .tl-s { color: var(--muted); font-size: 12.5px; }
.bigwait { display: flex; align-items: baseline; gap: 8px; }
.bigwait .v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.bigwait .k { color: var(--muted); }
.draft-meta { color: var(--muted); font-size: 12.5px; }
.stale { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-weight: 650; font-size: 13px; }
.stale .btn { margin-left: auto; }
.email { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 14px 16px; display: grid; gap: 11px; font-size: 13.5px; }
.email .subj { font-weight: 650; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.email .subj span { color: var(--muted); font-weight: 500; }
.email p { margin: 0; white-space: pre-wrap; }
.email .ai { border-left: 3px solid var(--ai-mark); padding-left: 10px; }
.email ol { margin: 0; padding-left: 22px; display: grid; gap: 5px; }
.email ol li small { display: block; color: var(--muted); font-size: 12.5px; }
.legend-ai { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.legend-ai i { width: 3px; height: 14px; background: var(--ai-mark); display: inline-block; border-radius: 2px; flex: none; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-hover); z-index: 50; display: flex; gap: 8px; align-items: center; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .aside { position: static; }
  .lanes { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .mockbar-inner, main { padding-left: 16px; padding-right: 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { display: none; }
  .user span.name { display: none; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 23px; }
  .bignums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .bignum:nth-child(3) { border-left: 0; padding-left: 0; }
  .bignum .v { font-size: 28px; }
  .chead-main { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .ring { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; gap: 12px; }
  .ring svg { width: 60px; height: 60px; }
  .facts { grid-column: 1 / -1; }
  .syncbar { padding: 12px 18px; }
  .syncbar .actions { margin-left: 0; }
  .filter { margin-left: 0; flex-basis: 100%; }
  .filter input { width: 100%; }
}

/* ---------- Portal additions ---------- */
.w0 { width: 0%; }
.w1 { width: 1%; }
.w2 { width: 2%; }
.w3 { width: 3%; }
.w4 { width: 4%; }
.w5 { width: 5%; }
.w6 { width: 6%; }
.w7 { width: 7%; }
.w8 { width: 8%; }
.w9 { width: 9%; }
.w10 { width: 10%; }
.w11 { width: 11%; }
.w12 { width: 12%; }
.w13 { width: 13%; }
.w14 { width: 14%; }
.w15 { width: 15%; }
.w16 { width: 16%; }
.w17 { width: 17%; }
.w18 { width: 18%; }
.w19 { width: 19%; }
.w20 { width: 20%; }
.w21 { width: 21%; }
.w22 { width: 22%; }
.w23 { width: 23%; }
.w24 { width: 24%; }
.w25 { width: 25%; }
.w26 { width: 26%; }
.w27 { width: 27%; }
.w28 { width: 28%; }
.w29 { width: 29%; }
.w30 { width: 30%; }
.w31 { width: 31%; }
.w32 { width: 32%; }
.w33 { width: 33%; }
.w34 { width: 34%; }
.w35 { width: 35%; }
.w36 { width: 36%; }
.w37 { width: 37%; }
.w38 { width: 38%; }
.w39 { width: 39%; }
.w40 { width: 40%; }
.w41 { width: 41%; }
.w42 { width: 42%; }
.w43 { width: 43%; }
.w44 { width: 44%; }
.w45 { width: 45%; }
.w46 { width: 46%; }
.w47 { width: 47%; }
.w48 { width: 48%; }
.w49 { width: 49%; }
.w50 { width: 50%; }
.w51 { width: 51%; }
.w52 { width: 52%; }
.w53 { width: 53%; }
.w54 { width: 54%; }
.w55 { width: 55%; }
.w56 { width: 56%; }
.w57 { width: 57%; }
.w58 { width: 58%; }
.w59 { width: 59%; }
.w60 { width: 60%; }
.w61 { width: 61%; }
.w62 { width: 62%; }
.w63 { width: 63%; }
.w64 { width: 64%; }
.w65 { width: 65%; }
.w66 { width: 66%; }
.w67 { width: 67%; }
.w68 { width: 68%; }
.w69 { width: 69%; }
.w70 { width: 70%; }
.w71 { width: 71%; }
.w72 { width: 72%; }
.w73 { width: 73%; }
.w74 { width: 74%; }
.w75 { width: 75%; }
.w76 { width: 76%; }
.w77 { width: 77%; }
.w78 { width: 78%; }
.w79 { width: 79%; }
.w80 { width: 80%; }
.w81 { width: 81%; }
.w82 { width: 82%; }
.w83 { width: 83%; }
.w84 { width: 84%; }
.w85 { width: 85%; }
.w86 { width: 86%; }
.w87 { width: 87%; }
.w88 { width: 88%; }
.w89 { width: 89%; }
.w90 { width: 90%; }
.w91 { width: 91%; }
.w92 { width: 92%; }
.w93 { width: 93%; }
.w94 { width: 94%; }
.w95 { width: 95%; }
.w96 { width: 96%; }
.w97 { width: 97%; }
.w98 { width: 98%; }
.w99 { width: 99%; }
.w100 { width: 100%; }
.pbar .ns { background: var(--seg-ns); } .pbar .wait { background: var(--seg-wait); } .pbar .done { background: var(--seg-done); }
.sw.ns { background: var(--seg-ns); } .sw.wait { background: var(--seg-wait); } .sw.done { background: var(--seg-done); }
.ring .bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring .fg { fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round; }
.ring .pct { fill: var(--ink); font-family: var(--font-ui); font-size: 17px; font-weight: 700; }
.grid-gap { display: grid; gap: 14px; }
.cols-main { display: grid; gap: 16px; min-width: 0; }
.user form { display: inline; }
.user .linkbtn { color: var(--muted); font-weight: 550; }
.result { color: var(--ink); }
.result:hover { text-decoration: none; }
.results[hidden] { display: none; }
td a.rowlink { color: inherit; display: contents; }
tbody tr.clickable a { color: inherit; }
.acard { color: inherit; }
.acard:hover { text-decoration: none; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.menu form { display: grid; }
.menu button { width: 100%; }
form.inline { display: inline; }
.flash { max-width: 1280px; margin: 16px auto 0; padding: 0 24px; display: grid; gap: 10px; }
.htmx-request .spin-on-load { display: inline-block; }
.toast[hidden] { display: none; }
.email-source { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 18px; }
.auth-card .brand { justify-content: flex-start; }
.auth-card h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field input, .field select { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .help { color: var(--muted); font-size: 12.5px; }
.code-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.qr { display: grid; justify-items: center; gap: 8px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr img { width: 190px; height: 190px; image-rendering: pixelated; }
.secret { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); text-align: center; word-break: break-all; }
.errors { margin: 0; padding-left: 18px; color: var(--bad); }

/* Settings */
.settings { display: grid; gap: 20px; }
.settings .panel > .card-body { gap: 16px; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row-form .field { min-width: 180px; flex: 1; }
.mini select, .mini input { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); max-width: 100%; }
.linkbox { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.linkbox code { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
.table-controls { display: contents; }
.tabs a { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; font-weight: 600; color: var(--ink-2); }
.tabs a:hover { text-decoration: none; background: var(--surface); }
.tabs a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19,26,38,.1); }
a.chip:hover { text-decoration: none; }
th a.thlink { color: inherit; }
th a.thlink:hover { color: var(--ink); text-decoration: none; }
.c-name a { color: inherit; }
#client { display: grid; gap: 24px; }
.itemtools a.chip .c { opacity: .7; margin-left: 3px; }
.menu a.menulink { padding: 8px 10px; border-radius: 7px; font-weight: 550; color: var(--ink); }
.menu a.menulink:hover { background: var(--surface-2); text-decoration: none; }
.item > form { display: contents; }
