/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: design.md · designed-as-app
 * nav: fixed sidebar (collapsible rail) · footer: none (app) · enrichment: none
 * pre-emit critique: P4 H5 E4 S4 R5 V4
 * Every colour, font and size comes from tokens.css. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--color-paper); color: var(--color-ink);
  font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading);
  font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tracking-display); line-height: 1.2; margin: 0; overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: var(--text-2xl); font-weight: 650; }
h2 { font-size: var(--text-lg); font-weight: 600; margin: var(--space-xl) 0 var(--space-sm); }
h3 { font-size: var(--text-md); font-weight: 600; }
p { margin: 0 0 var(--space-sm); }
a { color: var(--color-accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-hover); }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--color-paper-2); border: var(--rule); border-radius: var(--radius-sm); padding: 0 var(--space-2xs); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--color-paper-2); border: var(--rule); padding: var(--space-sm); border-radius: var(--radius); }
hr { border: 0; border-top: var(--rule); margin: var(--space-lg) 0; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.skip { position: absolute; left: var(--space-sm); top: -3rem; z-index: 100; background: var(--color-ink); color: var(--color-paper); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius); }
.skip:focus { top: var(--space-sm); }
/* [hidden] must win over component display rules (.row is flex, etc.). */
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app shell: fixed sidebar, content scrolls on its own ---------- */
body.app { height: 100dvh; overflow: hidden; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100dvh; }
body[data-sidebar="collapsed"] .shell { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0;
  height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--color-paper-2); border-right: var(--rule); padding: var(--space-sm) var(--space-xs);
}
/* Sections keep their size; a sidebar taller than the window scrolls instead of squashing. */
.sidebar > * { flex-shrink: 0; }
.sb-top { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-2xs) var(--space-xs); min-height: var(--control-h); }
.brand { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; flex: 1; color: var(--color-ink); text-decoration: none; font-weight: 600; }
.brand:hover { color: var(--color-ink); }
.brand-mark {
  flex: none; width: 1.75rem; height: 1.75rem; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-accent-ink); font-size: var(--text-sm); font-weight: 700; letter-spacing: 0;
}
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-switch { padding: 0 var(--space-2xs); }
.sb-switch select { width: 100%; }
.sb-nav { display: flex; flex-direction: column; gap: var(--space-3xs); }
.sb-head { font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-3); padding: var(--space-md) var(--space-xs) var(--space-2xs); white-space: nowrap; }
.sb-item {
  display: flex; align-items: center; gap: var(--space-sm); min-height: 2.125rem; padding: 0 var(--space-xs);
  border-radius: var(--radius); color: var(--color-ink-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.sb-item:hover { background: var(--color-paper-3); color: var(--color-ink); }
.sb-item[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--color-rule); }
.sb-item[aria-current="page"] .icon { color: var(--color-accent); }
.sb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-count { font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 1.25rem; text-align: center; padding: 0 var(--space-2xs); border-radius: var(--radius-sm); background: var(--color-accent-soft); color: var(--color-accent); }
.sb-foot { margin-top: auto; border-top: var(--rule); padding-top: var(--space-xs); display: flex; flex-direction: column; gap: var(--space-3xs); }
.avatar { flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.sb-user { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sb-user small { color: var(--color-ink-3); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; }

body:not([data-sidebar="collapsed"]) .when-collapsed, body[data-sidebar="collapsed"] .when-open { display: none; }
.when-open, .when-collapsed { display: inline-flex; }

/* Collapsed rail: icons only; names stay available to screen readers and as tooltips. */
body[data-sidebar="collapsed"] .sidebar { padding-inline: var(--space-2xs); align-items: center; }
body[data-sidebar="collapsed"] :is(.sb-nav, .sb-foot, .sb-top) { width: 100%; align-items: center; }
body[data-sidebar="collapsed"] .sb-top { flex-direction: column; padding-inline: 0; }
body[data-sidebar="collapsed"] .brand { flex: none; }
body[data-sidebar="collapsed"] :is(.brand-name, .sb-label, .sb-user, .sb-switch) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body[data-sidebar="collapsed"] .sb-head { visibility: hidden; height: var(--space-sm); padding: 0; }
body[data-sidebar="collapsed"] :is(.sb-item, .sb-foot) { justify-content: center; width: 2.5rem; padding: 0; }
body[data-sidebar="collapsed"] .sb-count { position: absolute; transform: translate(0.75rem, -0.65rem); min-width: 1rem; font-size: 0.625rem; }
body[data-sidebar="collapsed"] .sb-item { position: relative; }

.main-col { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.topbar { display: none; }
.main { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: var(--space-lg); }
.main:focus { outline: none; }
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--space-xl) var(--space-xl) var(--space-3xl); }
.page > h1:first-child, .page > .spread:first-child { margin-top: 0; }

/* Phones and small tablets: the sidebar becomes a drawer. */
@media (max-width: 56rem) {
  .shell, body[data-sidebar="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(18rem, 85vw);
    transform: translateX(-100%); transition: transform var(--dur) var(--ease-out); box-shadow: var(--shadow-pop);
  }
  body[data-nav-open] .sidebar { transform: none; }
  body[data-nav-open] .scrim { opacity: 1; pointer-events: auto; }
  body[data-sidebar="collapsed"] .sidebar { padding-inline: var(--space-xs); align-items: stretch; }
  body[data-sidebar="collapsed"] :is(.brand-name, .sb-label, .sb-user, .sb-switch) { position: static; width: auto; height: auto; clip: auto; }
  body[data-sidebar="collapsed"] :is(.sb-item, .sb-foot) { width: auto; justify-content: flex-start; padding: 0 var(--space-xs); }
  body[data-sidebar="collapsed"] .sb-count { position: static; transform: none; }
  body[data-sidebar="collapsed"] .sb-top { flex-direction: row; }
  body[data-sidebar="collapsed"] .sb-head { visibility: visible; height: auto; padding: var(--space-md) var(--space-xs) var(--space-2xs); }
  .sb-toggle { display: none; }
  .topbar {
    display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md);
    border-bottom: var(--rule); background: var(--color-paper); min-height: 3.25rem; flex: none;
  }
  .topbar .brand-name { font-weight: 600; }
  .page { padding: var(--space-lg) var(--space-md) var(--space-2xl); }
}
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--color-scrim); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease-out); }

/* ---------- single-card pages: sign in, sign up, verify ---------- */
body.solo { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: var(--space-2xl) var(--space-md); background: var(--color-paper-2); }
.solo-brand { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-lg); font-weight: 600; color: var(--color-ink); text-decoration: none; }
.solo-card { width: 100%; max-width: 26rem; background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-1); }
.solo-card h1 { font-size: var(--text-xl); margin-bottom: var(--space-xs); }
.solo-card > p.muted:first-of-type { margin-bottom: var(--space-lg); }
.solo-foot { margin-top: var(--space-lg); font-size: var(--text-sm); color: var(--color-ink-3); text-align: center; }
.prose-page { max-width: 42rem; }
.prose-page h2 { margin-top: var(--space-lg); }

/* ---------- page header ---------- */
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm) var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.spread h1 { margin: 0; }
.spread > .row { gap: var(--space-xs); }
.page > h1 { margin-bottom: var(--space-lg); }
.page > h1 + p.muted, .spread + p.muted { margin-top: calc(var(--space-sm) * -1); margin-bottom: var(--space-lg); max-width: 68ch; }

/* ---------- surfaces ---------- */
.card { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-md); box-shadow: var(--shadow-1); min-width: 0; }
.card > h2:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; list-style: none; display: flex; gap: var(--space-xs); align-items: baseline; flex-wrap: wrap; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "›"; color: var(--color-ink-3); transition: transform var(--dur-short) var(--ease-out); display: inline-block; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: var(--space-md); }
.grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-bottom: var(--space-md); }
.cols { display: grid; gap: var(--space-lg); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.cols.wide { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); }
@media (max-width: 64rem) { .cols, .cols.wide { grid-template-columns: minmax(0, 1fr); } }

/* Stat tiles */
.stats { display: grid; gap: var(--space-sm); grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); margin-bottom: var(--space-xl); }
.stat { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-2xs); box-shadow: var(--shadow-1); }
.stat b { font-size: var(--text-2xl); font-weight: 650; letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; line-height: 1.1; order: 2; }
.stat span { color: var(--color-ink-2); font-size: var(--text-sm); order: 1; }
.stat a { color: inherit; }
.stat.attention b { color: var(--color-bad); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); margin-bottom: var(--space-md); }
.tablewrap > table { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: var(--rule); vertical-align: middle; }
th { background: var(--color-paper-2); font-weight: 500; color: var(--color-ink-2); font-size: var(--text-sm); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr:not(:first-child) { transition: background-color var(--dur-short) var(--ease-out); }
table tr:not(:first-child):hover td { background: var(--color-paper-2); }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
td.muted, td .muted { color: var(--color-ink-3); }

/* ---------- forms ---------- */
label { display: block; margin: 0 0 var(--space-md); font-weight: 500; font-size: var(--text-sm); color: var(--color-ink); }
label > :is(input, select, textarea) { display: block; width: 100%; margin-top: var(--space-2xs); }
label > .small { display: block; font-weight: 400; margin-top: var(--space-2xs); }
input, select, textarea, button { font: inherit; color: inherit; }
:is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], input[type=date], select, textarea) {
  min-height: var(--control-h); padding: 0 var(--space-sm); background: var(--color-surface); color: var(--color-ink);
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius); box-shadow: var(--shadow-1);
  outline: 2px solid transparent; outline-offset: 1px;
}
textarea { padding: var(--space-xs) var(--space-sm); min-height: 6rem; font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.6; resize: vertical; }
textarea.prose, .thread + form textarea { font-family: var(--font-body); font-size: var(--text-base); }
select:not([multiple]) { padding-right: var(--space-xl); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--color-ink-3) 50%), linear-gradient(135deg, var(--color-ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding: var(--space-2xs); }
::placeholder { color: var(--color-ink-3); opacity: 1; }
:is(input, select, textarea):hover:not(:disabled) { border-color: var(--color-ink-3); }
:is(input, select, textarea):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-focus); }
:is(input, select, textarea):disabled { background: var(--color-paper-2); color: var(--color-ink-3); cursor: not-allowed; }
:is(input, select, textarea):user-invalid { border-color: var(--color-bad); }
label.check { display: flex; align-items: center; gap: var(--space-xs); font-weight: 400; font-size: var(--text-base); margin-bottom: var(--space-sm); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-accent); flex: none; cursor: pointer; }
label.check > input { display: inline-block; width: 1rem; margin: 0; }
fieldset { border: var(--rule); border-radius: var(--radius); padding: var(--space-sm) var(--space-md); margin: 0 0 var(--space-sm); }
legend { font-weight: 600; font-size: var(--text-sm); padding: 0 var(--space-2xs); }
.fieldgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0 var(--space-md); }
.fieldgrid .span2 { grid-column: 1 / -1; }

/* ---------- buttons ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); white-space: nowrap;
  min-height: var(--control-h); padding: 0 var(--space-md); border-radius: var(--radius); border: 1px solid transparent;
  background: var(--color-accent); color: var(--color-accent-ink); font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
button:hover, .btn:hover { background: var(--color-accent-hover); color: var(--color-accent-ink); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, button[aria-busy="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
button[aria-busy="true"]::after { content: ""; width: 0.8em; height: 0.8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
:is(button, .btn).secondary { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-rule-strong); box-shadow: var(--shadow-1); }
:is(button, .btn).secondary:hover { background: var(--color-paper-2); border-color: var(--color-ink-3); color: var(--color-ink); }
button.danger { background: var(--color-surface); color: var(--color-bad); border-color: color-mix(in oklch, var(--color-bad) 35%, var(--color-rule)); }
button.danger:hover { background: var(--color-bad-soft); color: var(--color-bad); }
button.link, button.danger-link { background: none; border: 0; min-height: 0; padding: 0; color: var(--color-accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button.link:hover { background: none; color: var(--color-accent-hover); }
.danger-link, button.link.danger-link { color: var(--color-bad) !important; }
button.icon, .icon-btn { min-height: 2rem; width: 2rem; padding: 0; background: transparent; color: var(--color-ink-2); border: 1px solid transparent; }
button.icon:hover, .icon-btn:hover { background: var(--color-paper-3); color: var(--color-ink); }
.wide { width: 100%; }

/* ---------- layout helpers ---------- */
.row { display: flex; gap: var(--space-sm); align-items: flex-end; flex-wrap: wrap; }
.row > label { margin: 0; flex: 1 1 10rem; min-width: 0; }
.row > label.check { flex: 0 1 auto; margin: 0; align-self: center; }
.row > :is(button, .btn, a) { flex: none; }
form.row, .card.row { align-items: flex-end; }
.inline { display: inline; }
.muted { color: var(--color-ink-2); }
.small { font-size: var(--text-sm); }
.rowitem { margin-bottom: var(--space-xs); align-items: center; }
.rowitem > :is(input, select) { flex: 1 1 8rem; min-width: 0; }

/* ---------- feedback ---------- */
.flash, .banner {
  display: flex; gap: var(--space-xs); align-items: flex-start; padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-lg);
  border-radius: var(--radius); border: 1px solid color-mix(in oklch, var(--color-ok) 30%, transparent);
  background: var(--color-ok-soft); color: var(--color-ink); overflow-wrap: anywhere;
}
.flash::before, .banner::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-top: 0.45rem; background: var(--color-ok); }
.flash.warn, .banner.warn { background: var(--color-warn-soft); border-color: color-mix(in oklch, var(--color-warn) 35%, transparent); }
.flash.warn::before, .banner.warn::before { background: var(--color-warn); }
.flash.error { background: var(--color-bad-soft); border-color: color-mix(in oklch, var(--color-bad) 35%, transparent); }
.flash.error::before { background: var(--color-bad); }
.flash.small { margin: var(--space-xs) 0 0; padding: var(--space-xs) var(--space-sm); }
.empty { text-align: center; padding: var(--space-2xl) var(--space-md) !important; color: var(--color-ink-2); }

/* Status badges: a dot and a word, never colour alone. */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 500; white-space: nowrap; line-height: 1.5;
  background: var(--color-paper-3); color: var(--color-ink-2); text-decoration: none;
}
.badge::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; opacity: 0.8; }
.s-delivered, .s-ok, .s-received, .s-closed, .s-completed, .s-on { background: var(--color-ok-soft); color: var(--color-ok); }
.s-failed, .s-dead, .s-error, .s-urgent { background: var(--color-bad-soft); color: var(--color-bad); }
.s-blocked, .s-pending, .s-high, .s-unparsed, .s-exited { background: var(--color-warn-soft); color: var(--color-warn); }
.s-sent, .s-open, .s-active, .s-normal { background: var(--color-info-soft); color: var(--color-info); }
a.badge:hover { filter: brightness(0.97); }
.tag { display: inline-block; background: var(--color-accent-soft); color: var(--color-accent); border-radius: var(--radius-sm); padding: 0 var(--space-2xs); font-size: var(--text-xs); font-weight: 500; margin: 1px 2px 1px 0; }

/* ---------- specific components ---------- */
.perms { columns: 2 22rem; column-gap: var(--space-md); }
.perms fieldset { break-inside: avoid; }
.perms .small { color: var(--color-ink-3); font-family: var(--font-mono); font-size: var(--text-xs); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.chips button { min-height: 1.75rem; padding: 0 var(--space-xs); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; background: var(--color-accent-soft); color: var(--color-accent); border: 0; }
.chips button:hover { background: var(--color-accent); color: var(--color-accent-ink); }
.preview { width: 100%; min-height: 32rem; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-canvas-email); }
.bubble { background: var(--color-ok-soft); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm); padding: var(--space-sm) var(--space-md); max-width: 26rem; white-space: pre-wrap; }
.thread { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-lg); }
.msg { max-width: min(70%, 36rem); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.msg.in { background: var(--color-surface); border: var(--rule); align-self: flex-start; border-bottom-left-radius: var(--radius-sm); }
.msg.out { background: var(--color-accent-soft); align-self: flex-end; border-bottom-right-radius: var(--radius-sm); }
.msg .meta { display: block; font-size: var(--text-xs); color: var(--color-ink-3); margin-top: var(--space-2xs); }
.msg-body { white-space: pre-wrap; }
#gjs { height: 70vh; border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.pager { margin-top: var(--space-md); gap: var(--space-md); align-items: center; }
.colrow { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1.4fr 0.5fr 0.6fr auto; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); }
.colrow input[type=text] { width: 100%; }
.coldelete { padding: 0 var(--space-md) var(--space-sm); }
@media (max-width: 64rem) { .colrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Workflow steps */
.steps { list-style: none; padding: 0; margin: 0 0 var(--space-md); display: flex; flex-direction: column; gap: 0; }
.step { position: relative; background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md) var(--space-md); box-shadow: var(--shadow-1); }
.step + .step { margin-top: var(--space-lg); }
.step + .step::before { content: ""; position: absolute; left: calc(var(--space-md) + 0.8rem); top: calc(var(--space-lg) * -1); height: var(--space-lg); border-left: 2px dashed var(--color-rule-strong); }
.step-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); flex-wrap: wrap; }
.step-head select { width: auto; font-weight: 600; }
.step-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-ink); display: grid; place-items: center; font-weight: 600; font-size: var(--text-xs); flex: none; }
.step-tools { margin-left: auto; display: flex; gap: var(--space-3xs); }
.step-body .row > label { flex: 1 1 12rem; }
.runlog { margin: var(--space-xs) 0 0; padding-left: var(--space-lg); }
.runlog li { margin-bottom: var(--space-3xs); }
details > summary { cursor: pointer; }

/* Onboarding wizard */
.wizard { list-style: none; display: flex; gap: var(--space-xs); padding: 0; margin: 0 0 var(--space-xl); flex-wrap: wrap; }
.wizard li { flex: 1 1 10rem; }
.wizard a { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius); border: var(--rule); color: var(--color-ink-2); text-decoration: none; font-weight: 500; background: var(--color-surface); }
.wizard a span { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-paper-3); font-size: var(--text-xs); flex: none; }
.wizard li.on a { border-color: var(--color-accent); color: var(--color-ink); box-shadow: 0 0 0 1px var(--color-accent); }
.wizard li.on a span, .wizard li.done a span { background: var(--color-accent); color: var(--color-accent-ink); }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.dash-head p { margin: var(--space-2xs) 0 0; color: var(--color-ink-2); }
.bar { height: 0.375rem; border-radius: var(--radius-pill); background: var(--color-paper-3); overflow: hidden; min-width: 4rem; }
.bar > i { display: block; height: 100%; background: var(--color-accent); border-radius: inherit; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .sidebar, .scrim { transition: opacity 120ms linear !important; }
}


/* Count beside a page title */
.spread h1 .small, .count { display: inline-block; vertical-align: middle; margin-left: var(--space-xs); padding: 0 var(--space-xs); border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; }

/* Filters: search takes the room */
.filters { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-bottom: var(--space-md); }
.filters input[type=search] { flex: 1 1 16rem; min-width: 0; }
.filters :is(select, input[type=text]) { flex: 0 1 11rem; min-width: 0; }

/* Bulk bar: appears once rows are ticked */
.bulkbar { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; padding: var(--space-xs) var(--space-sm); margin-bottom: var(--space-sm);
  border: 1px solid var(--color-accent); background: var(--color-accent-soft); border-radius: var(--radius-lg); }
.bulkbar b { margin-right: var(--space-xs); font-weight: 600; }
.bulkbar :is(select, input) { width: auto; min-width: 9rem; }

/* Rows whose fields are naturally short (a number and a unit) keep their size. */
.row.compact > label { flex: 0 0 auto; }

/* Theme toggle: offer the other mode. Follows data-theme, else the device setting. */
.theme-toggle { margin: 0; display: inline; }
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: contents; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .theme-toggle .to-dark { display: none; }
  :root[data-theme="system"] .theme-toggle .to-light { display: contents; }
}
.solo-foot .theme-toggle .sb-label { margin-left: var(--space-2xs); }
.solo-foot .theme-toggle .icon { width: 14px; height: 14px; }
.theme-options { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.theme-options label { display: flex; align-items: center; gap: var(--space-xs); margin: 0; padding: var(--space-xs) var(--space-md); border: var(--rule); border-radius: var(--radius); background: var(--color-surface); cursor: pointer; font-weight: 500; }
.theme-options label:has(input:checked) { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }

/* Settings / integration cards */
.settings-stack { display: flex; flex-direction: column; gap: var(--space-md); }
.setting { margin: 0; }
.setting > header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-md); }
.setting > header h2 { margin: 0; font-size: var(--text-md); }
.setting > header p { margin: var(--space-3xs) 0 0; }
.provider { display: flex; gap: var(--space-sm); align-items: flex-start; min-width: 0; }
.logo { flex: none; width: 2.5rem; height: 2.5rem; border-radius: var(--radius); display: grid; place-items: center; background: var(--color-accent-soft); color: var(--color-accent); }
.how { margin: 0 0 var(--space-md); padding-left: var(--space-lg); color: var(--color-ink-2); }
.how li { margin-bottom: var(--space-xs); }
.copyfield { display: flex; gap: var(--space-xs); align-items: center; margin-top: var(--space-2xs); max-width: 100%; }
.copyfield code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: var(--space-2xs) var(--space-xs); }
.copyfield button { min-height: 2rem; padding: 0 var(--space-sm); }
.savebar { position: sticky; bottom: 0; padding: var(--space-sm) 0; background: linear-gradient(transparent, var(--color-paper) 40%); }
label > .check { display: flex; gap: var(--space-xs); align-items: center; margin-top: var(--space-xs); font-weight: 400; }
label > .check input { width: 1rem; margin: 0; }

/* Connections */
.conn-list { display: flex; flex-direction: column; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); margin-bottom: var(--space-xl); }
.conn { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-bottom: var(--rule); flex-wrap: wrap; }
.conn:last-child { border-bottom: 0; }
.conn-main { flex: 1 1 16rem; min-width: 0; }
.conn-main b { display: block; }
.conn-main span { color: var(--color-ink-2); font-size: var(--text-sm); }
.conn-actions { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.conn-actions form { margin: 0; }
.conn-group { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); margin: var(--space-lg) 0 var(--space-xs); }
.conn .unavailable { font-size: var(--text-sm); color: var(--color-ink-3); text-align: right; max-width: 18rem; }

/* Sidebar: the nav scrolls inside the sidebar; the footer stays pinned at the bottom. */
.sidebar { overflow: hidden; }
.sidebar > .sb-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-inline: calc(var(--space-xs) * -1); padding-inline: var(--space-xs); }
.sb-foot { margin-top: 0; flex-direction: row; align-items: center; gap: var(--space-2xs); }
.sb-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius); color: var(--color-ink); text-decoration: none; font-weight: 500; }
.sb-me:hover, .sb-me[aria-current="page"] { background: var(--color-paper-3); color: var(--color-ink); }
.sb-tools { display: flex; gap: var(--space-3xs); }
.sb-tools form { margin: 0; }
.sb-tools .theme-toggle .sb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body[data-sidebar="collapsed"] .sb-foot { flex-direction: column; width: 100%; }
body[data-sidebar="collapsed"] .sb-me { flex: none; padding: var(--space-2xs); }
body[data-sidebar="collapsed"] .sb-tools { flex-direction: column; }
@media (max-width: 56rem) { .sidebar { overflow: hidden; } }

/* No initial badge: the rail shows only the expand button at the top. */
body[data-sidebar="collapsed"] .brand { display: none; }
.brand { padding-left: var(--space-xs); }

/* Optional-field hint stays on the label's line. */
.opt { color: var(--color-ink-3); font-weight: 400; font-size: var(--text-sm); margin-left: var(--space-2xs); }
.hint { display: block; color: var(--color-ink-3); font-weight: 400; font-size: var(--text-sm); margin-top: var(--space-2xs); }

/* Inline validation */
.field-error { display: flex; gap: var(--space-2xs); align-items: center; margin-top: var(--space-2xs); color: var(--color-bad); font-size: var(--text-sm); font-weight: 500; }
.field-error::before { content: "!"; flex: none; width: 1rem; height: 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-bad); color: var(--color-surface); font-size: 0.6875rem; font-weight: 700; }
[aria-invalid="true"] { border-color: var(--color-bad) !important; }
[aria-invalid="true"]:focus-visible { outline-color: var(--color-bad); }
.form-actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; margin-top: var(--space-sm); }

/* Column picker (lists) */
.colpick { margin: var(--space-sm) 0; padding: var(--space-sm) var(--space-md); }
.colpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0 var(--space-md); margin: var(--space-xs) 0; }
.colpick-grid label.check { margin-bottom: var(--space-xs); }

/* Rows of labelled fields line up by their tops, so an error under one field never moves the
 * others; buttons and checkboxes sit level with the inputs (one label line + its gap down). */
.row:has(> label:not(.check)) { align-items: flex-start; }
.row:has(> label:not(.check)) > :is(button, .btn, label.check) { margin-top: calc(var(--text-sm) * var(--leading) + var(--space-2xs)); }
.row:has(> label:not(.check)) > label.check { min-height: var(--control-h); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2xs) var(--space-md); margin: var(--space-md) 0 0; }
dt { font-weight: 500; } dd { margin: 0; }

/* Tables: sortable headers, pager, filter bar */
.th-sort { display: inline-flex; align-items: center; gap: var(--space-2xs); color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.on { color: var(--color-ink); }
.th-arrow { display: inline-flex; opacity: 0.45; }
.th-sort.on .th-arrow, .th-sort:hover .th-arrow { opacity: 1; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin: var(--space-sm) 0 var(--space-lg); }
.pager-links { display: flex; gap: var(--space-3xs); align-items: center; flex-wrap: wrap; }
.pg { min-width: 2.25rem; height: 2.25rem; padding: 0 var(--space-xs); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); color: var(--color-ink-2); text-decoration: none; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
a.pg:hover { background: var(--color-paper-3); color: var(--color-ink); }
.pg.on { background: var(--color-surface); border-color: var(--color-rule-strong); color: var(--color-ink); font-weight: 600; box-shadow: var(--shadow-1); }
.pg.disabled { opacity: 0.35; }
.pg.gap { min-width: 1.25rem; padding: 0; }
.filterbar { margin-bottom: var(--space-md); }
.filter-top { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; }
.filter-top input[type=search] { flex: 1 1 18rem; min-width: 0; }
.filter-rows { display: flex; flex-direction: column; gap: var(--space-2xs); margin-top: var(--space-xs); }
.filter-rows:empty { display: none; }
.filter-row { display: flex; gap: var(--space-xs); align-items: center; margin: 0; flex-wrap: wrap; padding: var(--space-2xs) var(--space-xs); background: var(--color-paper-2); border-radius: var(--radius); }
.filter-row select, .filter-row input { flex: 0 1 12rem; min-width: 0; }
.filter-row input { flex: 1 1 12rem; }
td.check, th.check { width: 2.5rem; }
.segmented { display: inline-flex; gap: var(--space-3xs); padding: var(--space-3xs); background: var(--color-paper-2); border: var(--rule); border-radius: var(--radius); margin-bottom: var(--space-md); flex-wrap: wrap; }
.segmented a { padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-sm); color: var(--color-ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.segmented a:hover { color: var(--color-ink); background: var(--color-paper-3); }
.segmented a[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-1); }

/* Inbox */
.convo-list { display: flex; flex-direction: column; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: var(--space-md); }
.convo-list > .empty.card { margin: 0; border: 0; box-shadow: none; }
.convo { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); border-bottom: var(--rule); color: inherit; text-decoration: none; }
.convo:last-child { border-bottom: 0; }
a.convo:hover { background: var(--color-paper-2); }
.convo.waiting .convo-top b::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--color-accent); margin-right: var(--space-xs); vertical-align: middle; }
.convo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3xs); }
.convo-top { display: flex; justify-content: space-between; gap: var(--space-sm); }
.convo-last { color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-sm); }
.msg.email { max-width: min(80%, 44rem); }
.msg-subject { display: flex; gap: var(--space-2xs); align-items: center; margin-bottom: var(--space-3xs); }
.composer .segmented { margin-bottom: var(--space-md); }
.btn.disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Core screens (claude.ai/design "Core Screens"): dashboard, contacts, contact, import, lists ---------- */
/* Message states: an icon says which, so the dot goes. Queued is neutral, read is the accent, dry run is dashed. */
.badge.has-icon::before { display: none; }
.badge .icon { width: 12px; height: 12px; }
.s-queued, .s-sending { background: var(--color-paper-2); color: var(--color-ink-2); box-shadow: inset 0 0 0 1px var(--color-rule); }
.s-read { background: var(--color-accent-soft); color: var(--color-accent-text); }
.s-dry_run { background: transparent; color: var(--color-ink-2); outline: 1px dashed var(--color-rule-strong); outline-offset: -1px; }

/* Page header: breadcrumb or date above the title, a meta line under it, actions on the right. */
.page-head { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-lg); }
.page-head h1 { line-height: 2rem; font-weight: 600; }
.page-head .row { gap: var(--space-xs); align-items: center; }
.eyebrow, .sub { font-size: var(--text-sm); color: var(--color-ink-3); margin: 0; }
.eyebrow a { color: var(--color-ink-3); }
.panel { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); min-width: 0; margin-bottom: var(--space-md); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); border-bottom: var(--rule); }
.panel-head h2 { margin: 0; font-size: var(--text-md); }
.panel-head a { font-size: var(--text-sm); font-weight: 500; }
.panel-body { padding: var(--space-md); }
.panel h2 { margin-top: 0; font-size: var(--text-md); }
.panel-body > h2 { margin-bottom: var(--space-sm); }
.split { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.split > .main-part { flex: 999 1 32rem; min-width: 0; }
.split > .side-part { flex: 1 1 20rem; min-width: 0; }

/* Dashboard */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-2xs) 1.25rem; }
.checklist a { display: flex; align-items: center; gap: 0.625rem; min-height: var(--control-h); color: var(--color-accent-text); text-decoration: none; }
.checklist a:hover { text-decoration: underline; }
.checklist .tick { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--color-rule-strong); color: var(--color-accent-ink); }
.checklist .done a { color: var(--color-ink-3); text-decoration: line-through; }
.checklist .done .tick { border-color: var(--color-accent); background: var(--color-accent); }
.setup-head { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); align-items: center; margin-bottom: var(--space-sm); }
.setup-head h2 { margin: 0; font-size: var(--text-md); }
.setup-head .bar { flex: 1 1 7.5rem; max-width: 12.5rem; }
.setup-head form { margin: 0 0 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); gap: var(--space-sm); margin-bottom: 1.25rem; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 0.875rem var(--space-md); background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); color: var(--color-ink); text-decoration: none; }
a.tile:hover { border-color: var(--color-rule-strong); color: var(--color-ink); }
.tile span { font-size: var(--text-sm); color: var(--color-ink-2); }
.tile b { font-size: 1.5rem; line-height: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile small { font-size: var(--text-xs); color: var(--color-ink-3); }
.tile.bad b { color: var(--color-bad); }
.feed-row { display: flex; align-items: center; gap: var(--space-sm); min-height: 2.5rem; padding: var(--space-xs) var(--space-md); border-top: var(--rule); color: var(--color-ink); text-decoration: none; }
.panel-head + .feed-row { border-top: 0; }
a.feed-row:hover { background: var(--color-paper-2); color: var(--color-ink); }
.feed-row > .icon { color: var(--color-ink-3); }
.feed-main { flex: 1; min-width: 0; }
.feed-main b, .feed-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-main b { font-weight: 500; }
.feed-main small, .feed-time { font-size: var(--text-xs); color: var(--color-ink-3); }
.feed-time { width: 3.5rem; text-align: right; flex: none; }
.pipe { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 3rem; gap: 0.625rem; align-items: center; min-height: var(--control-h); color: var(--color-ink); text-decoration: none; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.pipe:hover { background: var(--color-paper-2); color: var(--color-ink); }
.pipe .bar { height: 8px; }
.pipe b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; color: var(--color-ink-2); }

/* A status is a small square swatch and its name. The swatch colour follows the status's place in Settings. */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sw, var(--color-ink-3)); }
.sw0 { --sw: var(--color-info); } .sw1 { --sw: var(--color-ink-3); } .sw2 { --sw: var(--color-accent); } .sw3 { --sw: var(--color-warn); } .sw4 { --sw: var(--color-ok); }
.none { color: var(--color-ink-3); }
.cell-sub { display: block; font-size: var(--text-xs); color: var(--color-ink-3); font-weight: 400; }
tr:has(.pick:checked) td { background: var(--color-accent-soft); }
.search-box { position: relative; flex: 1 1 16rem; max-width: 22.5rem; display: flex; }
.search-box .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--color-ink-3); pointer-events: none; }
.search-box input { width: 100%; padding-left: 2rem !important; }
.filter-top .push { margin-left: auto; }

/* Empty and error states */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-xs); padding: var(--space-2xl) 1.25rem; }
.empty-state .ring { width: 44px; height: 44px; border-radius: 50%; background: var(--color-paper-2); display: grid; place-items: center; color: var(--color-ink-2); }
.empty-state b { font-size: var(--text-md); }
.empty-state p { color: var(--color-ink-2); max-width: 22.5rem; margin: 0; }
.empty-state .row { justify-content: center; margin-top: 6px; align-items: center; }

/* Contact page */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; padding: 0.625rem 0.875rem; border-radius: var(--radius-lg); margin-bottom: var(--space-md); }
.notice > div { flex: 1 1 15rem; }
.notice.warn { background: var(--color-warn-soft); color: var(--color-warn); }
.notice.bad { background: var(--color-bad-soft); color: var(--color-bad); font-size: var(--text-sm); }
.notice form { margin: 0; }
.notice button { min-height: 1.75rem; padding: 0 0.625rem; background: transparent; color: inherit; border: 1px solid currentColor; }
.notice button:hover { background: transparent; color: inherit; }
.checks { display: flex; flex-direction: column; gap: var(--space-2xs); font-size: var(--text-sm); margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; gap: var(--space-xs); align-items: center; }
.checks .warn { color: var(--color-warn); } .checks .ok { color: var(--color-ok); }
.send-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.send-row select { flex: 1 1 15rem; width: auto; }
.timeline { list-style: none; margin: 0; padding: var(--space-xs) var(--space-md) var(--space-md); }
.timeline > li { display: flex; gap: var(--space-sm); padding: 0.625rem 0; border-bottom: var(--rule); }
.timeline > li:last-child { border-bottom: 0; }
.tl-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--color-paper-2); color: var(--color-ink-2); }
.tl-dot.out { background: var(--color-accent-soft); color: var(--color-accent-text); }
.tl-dot.bad { background: var(--color-bad-soft); color: var(--color-bad); }
.tl-dot.warn { background: var(--color-warn-soft); color: var(--color-warn); }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
.tl-top { display: flex; flex-wrap: wrap; gap: 6px 0.625rem; align-items: center; }
.tl-top > b { font-weight: 500; }
.tl-top > time { margin-left: auto; font-size: var(--text-xs); color: var(--color-ink-3); }
.tl-body { font-size: var(--text-sm); color: var(--color-ink-2); overflow-wrap: anywhere; }
.tl-actions { display: flex; gap: var(--space-xs); align-items: center; font-size: var(--text-sm); }
.tl-actions form { margin: 0; }
.tl-actions button { min-height: 1.75rem; padding: 0 0.625rem; font-size: var(--text-sm); }
.side-part .fieldgrid { grid-template-columns: minmax(0, 1fr); }
.side-part label { font-size: var(--text-xs); color: var(--color-ink-2); }
.side-part label.check { font-size: var(--text-base); color: var(--color-ink); min-height: var(--control-h); margin: 0; }
.side-part fieldset { border: 0; border-top: var(--rule); border-radius: 0; padding: 0.625rem 0 0; margin: 0 0 var(--space-sm); }
.side-part legend { font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); padding: 0; margin-bottom: var(--space-2xs); }
.side-part h2 { font-size: var(--text-base); margin: 0; }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 0.625rem; border-radius: var(--radius-pill); background: var(--color-paper-2); border: var(--rule); font-size: var(--text-sm); color: var(--color-ink); text-decoration: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: var(--space-xs) 0; }
.chip-row form { margin: 0; display: inline-flex; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 11rem; padding: var(--space-2xs); background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.menu-pop form { margin: 0; }
.menu-pop :is(a, button) { width: 100%; justify-content: flex-start; min-height: var(--control-h); padding: 0 var(--space-xs); background: transparent; color: var(--color-ink); border: 0; font-weight: 400; text-decoration: none; display: flex; align-items: center; border-radius: var(--radius-sm); }
.menu-pop :is(a, button):hover { background: var(--color-paper-2); color: var(--color-ink); }
.menu-pop button.danger { color: var(--color-bad); }

/* Import */
.steps-bar { list-style: none; margin: 0 0 var(--space-md); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs) 1.25rem; font-size: var(--text-sm); color: var(--color-ink-3); }
.steps-bar li { display: flex; gap: 6px; align-items: center; }
.steps-bar [aria-current] { font-weight: 600; color: var(--color-ink); }
.match td { vertical-align: top; }
.match select { width: 100%; }
.field-note { margin-top: var(--space-2xs); font-size: var(--text-xs); color: var(--color-ink-3); display: flex; gap: 6px; align-items: center; }
.field-note.bad { color: var(--color-bad); }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.two-up > * { margin: 0; }
.two-up fieldset { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); padding: 0.875rem var(--space-md); }
.two-up legend { float: left; width: 100%; font-size: var(--text-base); margin-bottom: var(--space-2xs); padding: 0; }
.two-up fieldset .hint { clear: both; margin: 0 0 var(--space-2xs); }
.two-up label.check { min-height: var(--control-h); margin: 0; }
.foot-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: space-between; align-items: center; }

/* Lists */
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); min-height: 2.5rem; padding: 0.625rem var(--space-md); border-top: var(--rule); }
.list-row:first-child { border-top: 0; }
.list-row > div { flex: 1 1 15rem; min-width: 0; }
.list-row > div a { font-weight: 500; color: var(--color-ink); }
.list-row .n { width: 7rem; font-variant-numeric: tabular-nums; color: var(--color-ink-2); }
.list-row .when { width: 9rem; font-size: var(--text-sm); color: var(--color-ink-3); }
.reach { border: var(--rule); border-radius: var(--radius-lg); padding: var(--space-sm) 0.875rem; background: var(--color-paper-2); display: flex; flex-direction: column; gap: 6px; margin: var(--space-md) 0; }
.reach > b { font-weight: 600; }
.reach-why { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--text-sm); }
.reach-why a { color: var(--color-warn); display: flex; gap: 6px; align-items: center; }

/* Dense record tables: one line a row (40px), the table scrolls sideways inside its card instead. */
.stack-sm td, .stack-sm th { white-space: nowrap; padding: 6px var(--space-sm); }
.stack-sm td:has(> .cell-sub) { padding-block: 4px; }
.stack-sm tr:not(:first-child) { height: 2.5rem; }

/* Phones: a wide table becomes stacked rows, the tick keeps a 44px target. */
@media (max-width: 56rem) {
  .stack-sm table, .stack-sm tbody { display: block; }
  .stack-sm tr:first-child:has(th) { display: none; }
  .stack-sm tr { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-xs); align-items: center; padding: 0.625rem var(--space-sm); border-bottom: var(--rule); }
  .stack-sm tr:last-child { border-bottom: 0; }
  .stack-sm td { border: 0; padding: 0; white-space: normal; }
  .stack-sm tr:not(:first-child) { height: auto; }
  .stack-sm td.check { width: 44px; height: 44px; display: grid; place-items: center; margin: -6px 0 0 -8px; }
  .stack-sm td:nth-child(2) { flex: 1 1 calc(100% - 60px); }
  .stack-sm td:empty { display: none; }
  .stack-sm td:not(.check):not(:nth-child(2)) { font-size: var(--text-sm); color: var(--color-ink-2); }
}

/* ---------- Sidebar and site banners (claude.ai/design "Sidebar") ---------- */
.sidebar { background: var(--color-surface); padding: 0; gap: 0; }
.sb-top { height: 56px; min-height: 56px; padding: 0 var(--space-sm); gap: 10px; border-bottom: var(--rule); }
.org-mark { width: 30px; height: 30px; flex: none; border-radius: var(--radius); background: var(--color-accent); color: var(--color-accent-ink); display: grid; place-items: center; font-weight: 600; font-size: var(--text-xs); letter-spacing: .02em; }
.sb-org { flex: 1; min-width: 0; color: var(--color-ink); text-decoration: none; }
.sb-org > summary { display: flex; align-items: center; gap: var(--space-2xs); cursor: pointer; color: var(--color-ink-3); }
.sb-org-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.sb-org-name b { font-size: var(--text-base); font-weight: 600; color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-org-name small { font-size: var(--text-xs); color: var(--color-ink-3); }
.sb-org .menu-pop { left: 0; right: auto; min-width: 14rem; }
.sb-org .menu-pop button[aria-current] { font-weight: 600; color: var(--color-accent-text); }
.sb-top .sb-toggle { width: 32px; min-height: 32px; color: var(--color-ink-3); }
.sidebar > .sb-nav { padding: var(--space-2xs) var(--space-xs) var(--space-sm); margin: 0; gap: 1px; }
.sb-head { padding: 14px 10px 4px; font-weight: 500; }
.sb-item { min-height: 32px; gap: 10px; padding: 0 10px; border-radius: var(--radius); font-weight: 400; color: var(--color-ink-2); }
.sb-item:hover { background: var(--color-paper-3); }
.sb-item[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 600; box-shadow: none; }
.sb-item[aria-current="page"] .icon { color: inherit; }
.sb-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink-2); display: grid; place-items: center; }
.sb-item[aria-current="page"] .sb-count { background: var(--color-accent); color: var(--color-accent-ink); }
.sb-foot { flex-direction: column; align-items: stretch; gap: var(--space-2xs); padding: 10px var(--space-xs); border-top: var(--rule); }
.sb-me { padding: 6px; }
.sb-me .avatar { width: 28px; height: 28px; font-size: 11px; }
.sb-user { font-size: var(--text-sm); }
.sb-tools { gap: var(--space-2xs); }
.sb-tools > form { flex: 1; display: flex; }
.sb-tools .sb-tool { flex: 1; min-height: 32px; padding: 0 var(--space-xs); gap: var(--space-xs); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 400; box-shadow: none; border-color: var(--color-rule); }
.sb-tools .theme-toggle .sb-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
body[data-sidebar="collapsed"] .org-mark { display: none; }
body[data-sidebar="collapsed"] :is(.sb-org, .sb-tools .sb-label) { display: none; }
body[data-sidebar="collapsed"] .sb-top { flex-direction: row; justify-content: center; }
body[data-sidebar="collapsed"] .sb-tools { flex-direction: column; width: 100%; }
body[data-sidebar="collapsed"] .sb-foot { padding-inline: var(--space-2xs); }
body[data-sidebar="collapsed"] .sb-count { position: absolute; top: 2px; right: 2px; transform: none; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; background: var(--color-accent); color: var(--color-accent-ink); }
@media (max-width: 56rem) { .sb-item, .sb-tools .sb-tool { min-height: 44px; } }

/* Full-width notices above the page: platform admin, paused, dry run. */
.site-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: var(--space-xs) var(--space-xl); border-bottom: var(--rule); font-size: var(--text-sm); }
.site-banner > div { flex: 1 1 14rem; }
.site-banner b { font-weight: 600; }
.site-banner form { margin: 0; }
.site-banner button { min-height: 28px; padding: 0 10px; background: transparent; color: inherit; border: 1px solid currentColor; }
.site-banner button:hover { background: transparent; color: inherit; }
.site-banner a { color: inherit; font-weight: 500; text-decoration: underline; }
.site-banner.warn { background: var(--color-warn-soft); color: var(--color-warn); }
.site-banner.info { background: var(--color-info-soft); color: var(--color-info); }
.site-banner.quiet { background: var(--color-paper-2); color: var(--color-ink-2); font-size: var(--text-xs); padding-block: 6px; }
@media (max-width: 56rem) { .site-banner { padding-inline: var(--space-md); } }

/* Tabs: links under a hairline (?status=open), the current one underlined in the accent. */
.tabs { display: flex; gap: var(--space-2xs); border-bottom: var(--rule); overflow-x: auto; margin-bottom: var(--space-md); }
.tabs a { display: flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--color-ink-2); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--color-ink); }
.tabs a[aria-current] { border-bottom-color: var(--color-accent); color: var(--color-ink); font-weight: 600; }
.tabs a span { font-size: var(--text-xs); color: var(--color-ink-3); font-weight: 400; }
/* Pill filters (inbox: Waiting / Mine / All). */
.pills { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.pills a { height: 28px; display: flex; align-items: center; padding: 0 10px; border-radius: var(--radius-pill); color: var(--color-ink-2); font-size: var(--text-sm); text-decoration: none; }
.pills a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.pills a[aria-current] { background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 600; }
/* Row list: a card of flex rows (messages, tickets, members, columns, orgs). */
.rows { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-md); }
.rows > .r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 2.5rem; padding: var(--space-xs) var(--space-md); border-top: var(--rule); color: var(--color-ink); text-decoration: none; }
.rows > .r:first-child { border-top: 0; }
a.r:hover, .rows > .r.hover:hover { background: var(--color-paper-2); color: var(--color-ink); }
.rows > .r form { margin: 0; }
.rows .grow { flex: 1 1 14rem; min-width: 0; }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.btn.sm, button.sm { min-height: 28px; padding: 0 10px; font-size: var(--text-sm); }
.round { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--color-paper-3); display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-2); }
.tile-icon { width: 32px; height: 32px; flex: none; border-radius: var(--radius); background: var(--color-paper-2); border: var(--rule); display: grid; place-items: center; color: var(--color-ink-2); }

/* ---------- Rich text: a formatting toolbar over free-text boxes (client/rich-text.ts) ---------- */
.rt { margin-top: var(--space-2xs); border: 1px solid var(--color-rule-strong); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow-1); min-width: 0; flex: 1; font-weight: 400; }
.rt:focus-within { outline: 2px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-focus); }
.rt-source { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
label:has(> .rt-source[aria-invalid="true"]) .rt, .rt-source[aria-invalid="true"] + .rt { border-color: var(--color-bad); }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-bottom: var(--rule); background: var(--color-paper-2); border-radius: var(--radius) var(--radius) 0 0; }
.rt-btn { min-height: 26px; min-width: 28px; padding: 0 6px; background: transparent; color: var(--color-ink-2); border: 1px solid transparent; font-size: var(--text-sm); font-weight: 400; line-height: 1; box-shadow: none; }
.rt-btn:hover { background: var(--color-paper-3); color: var(--color-ink); }
.rt-btn[aria-pressed="true"] { background: var(--color-accent-soft); color: var(--color-accent-text); border-color: color-mix(in oklch, var(--color-accent) 30%, transparent); }
.rt-btn code { font-size: var(--text-xs); background: none; border: 0; padding: 0; }
.rt-area { padding: var(--space-xs) var(--space-sm); outline: none; font-size: var(--text-base); line-height: var(--leading); color: var(--color-ink); overflow-wrap: anywhere; max-height: 24rem; overflow-y: auto; }
.rt-area > * { margin: 0 0 var(--space-xs); }
.rt-area > :last-child { margin-bottom: 0; }
.rt-area ul, .rt-area ol, .rich-out ul, .rich-out ol { padding-left: 1.4em; }
.rt-area blockquote, .rich-out blockquote { margin-left: 0; padding-left: var(--space-sm); border-left: 3px solid var(--color-rule-strong); color: var(--color-ink-2); }
.rt.is-empty .rt-area[data-placeholder] > p:first-child::before { content: var(--ph); color: var(--color-ink-3); float: left; height: 0; pointer-events: none; }
.rich-out > * { margin: 0 0 var(--space-xs); }
.rich-out > :last-child { margin-bottom: 0; }
@media (max-width: 56rem) { .rt-btn { min-height: 36px; min-width: 36px; } }
.site-banner.visiting { background: var(--color-accent-soft); color: var(--color-accent-text); }

/* ---------- One shape for marks: pills ----------
 * Badges, counts, chips, filter pills and tags are pills. Circles mean people (avatars), the
 * switch knob, the spinner, status dots and progress bars. Step numbers are circles too. */
:root { --radius-mark: var(--radius-pill); }
.badge::before, .flash::before, .banner::before, .convo.waiting .convo-top b::before,
.hist li::before, .dot, .st::before { border-radius: 50%; }
.sb-count, body[data-sidebar="collapsed"] .sb-count, .chip, .pills a, .ib-sys, .tag,
.field-error::before { border-radius: var(--radius-mark); }
.step-num, .step-n, .tl-dot, .checklist .tick, .wizard a span, .auth-icon { border-radius: 50%; }
.empty-state .ring { border-radius: var(--radius-lg); }

/* =====================================================================================
 * Adab design system v2 (design.md): light canvas, white cards, one confident blue,
 * sunflower for delight, Bricolage Grotesque titles over Figtree. Overrides the rules
 * above where the shape or weight changed; colours already come from tokens.css.
 * ===================================================================================== */

/* Type */
body { font-feature-settings: normal; }
h1 { font-weight: 700; }
h2 { font-weight: 700; }
h3 { font-weight: 650; }
.page-head h1, .spread h1, .page > h1 { font-size: var(--text-2xl); line-height: 2.25rem; font-weight: 700; }
.panel-head h2, .panel h2, .card > h2:first-child, .setting > header h2 { font-family: var(--font-body); letter-spacing: 0; font-size: var(--text-md); font-weight: 700; }
.eyebrow, .sub { color: var(--color-ink-2); font-size: var(--text-base); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
:is(.btn, .sb-item, .sb-me, .tile, .feed-row, .convo, .r, .pg, .tabs a, .pills a, .segmented a, .wizard a, .checklist a, .menu-pop a, .chip, .site-banner a, .badge, .solo-brand, .site a):hover { text-decoration: none; }

/* Buttons: verb first, 600 weight, a small lift on hover */
button, .btn { font-weight: 600; border-radius: var(--radius); }
button:not(.link):not(.danger-link):not(.icon):not(.icon-btn):not(.rt-btn):not(.secondary):not(.danger):hover,
.btn:not(.secondary):hover { box-shadow: 0 6px 16px -8px color-mix(in oklch, var(--color-accent) 70%, transparent); }
:is(button, .btn).secondary { box-shadow: none; }
.btn.dark, button.dark { background: var(--color-ink); color: var(--color-surface); }
.btn.dark:hover, button.dark:hover { background: color-mix(in oklch, var(--color-ink) 85%, var(--color-accent)); color: var(--color-surface); }
.btn.sm, button.sm { min-height: 32px; padding: 0 12px; }

/* Inputs: one height with buttons, a soft blue ring on focus */
:is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], input[type=date], select, textarea) {
  box-shadow: none; border-radius: var(--radius);
}
:is(input, select, textarea):focus-visible, .rt:focus-within {
  outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px var(--color-accent-soft);
}
input[type=checkbox], input[type=radio] { width: 1.0625rem; height: 1.0625rem; }

/* Surfaces: white cards on the canvas, borders not shadows; floating things get the shadow */
.card, .panel, .stat, .tile, .tablewrap, .rows, .conn-list, .convo-list, .step, .two-up fieldset { border-radius: var(--radius-lg); box-shadow: none; }
.tile, .stat { padding: 1.125rem; gap: var(--space-2xs); transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur-short); }
a.tile:hover, .stat:has(a):hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--color-rule); }
.tile span, .stat span { font-size: var(--text-base); font-weight: 500; color: var(--color-ink-2); }
.tile b, .stat b { font-family: var(--font-display); font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; letter-spacing: var(--tracking-display); }
.tile small { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-3); }
.tile.good small { color: var(--color-ok); }
.tile.bad small { color: var(--color-bad); }
.tile.bad b { color: var(--color-ink); }
.tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: var(--space-md); }
.panel-head { padding: var(--space-md) 1.25rem; border-bottom: 0; }
.panel-body { padding: 1.25rem; }
.feed-row { border-top: 0; border-radius: var(--radius); margin: 0 var(--space-xs); padding: var(--space-xs) var(--space-sm); min-height: 3rem; }
.panel-head + .feed-row { margin-top: 0; }
.panel > .feed-row:last-child { margin-bottom: var(--space-xs); }

/* Tables: a quiet head, roomy rows */
th { background: color-mix(in oklch, var(--color-paper-2) 50%, var(--color-surface)); font-weight: 600; color: var(--color-ink-2); }
table tr:not(:first-child):hover td { background: color-mix(in oklch, var(--color-paper-2) 55%, var(--color-surface)); }
tr:has(.pick:checked) td { background: var(--color-accent-soft); }

/* Marks */
.badge { padding: 0.1875rem 0.625rem; font-weight: 600; }
.tag { padding: 0.125rem 0.5rem; font-weight: 600; background: var(--color-info-soft); color: var(--color-info); }
.count, .spread h1 .small { border-radius: var(--radius-pill); background: transparent; color: var(--color-ink-3); font-family: var(--font-body); font-size: var(--text-md); padding: 0; }
.pills a { height: 32px; padding: 0 14px; font-weight: 600; border: 1px solid var(--color-rule-strong); background: var(--color-surface); color: var(--color-ink-2); }
.pills a:hover { background: var(--color-paper-2); }
.pills a[aria-current] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-surface); }
.segmented { border: 0; border-radius: var(--radius); padding: 3px; }
.segmented a { border-radius: 8px; font-weight: 600; }
.tabs a { font-weight: 600; height: 2.75rem; padding: 0 14px; }
.tabs a[aria-current] { color: var(--color-accent-text); }
.bulkbar { background: var(--color-ink); color: var(--color-surface); border: 0; border-radius: var(--radius-lg); padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md); box-shadow: var(--shadow-pop); }
.bulkbar :is(select, input) { background-color: var(--color-surface); color: var(--color-ink); }
.flash, .banner { border-radius: var(--radius-lg); }
.flash.warn, .banner.warn { background: var(--color-sun-soft); border-color: var(--color-sun-rule); }
.flash.warn::before, .banner.warn::before { background: var(--color-sun); }

/* Sidebar: white, an initial square for the charity, blue for where you are */
.sidebar { background: var(--color-surface); }
.sb-top { height: 64px; min-height: 64px; border-bottom: 0; padding: var(--space-sm) var(--space-sm) var(--space-2xs); }
.org-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--color-sun); color: #1b1d2a; font-weight: 700; font-size: var(--text-xs); }
.sb-org, .sb-org > summary { display: flex; align-items: center; gap: 10px; }
a.sb-org, .sb-org > summary { padding: 6px; margin: -6px; border-radius: var(--radius); }
a.sb-org:hover, .sb-org > summary:hover { background: var(--color-paper-2); }
.sb-org-name b { font-weight: 700; }
.sidebar > .sb-nav { padding: var(--space-xs) var(--space-sm) var(--space-sm); gap: 2px; }
.sb-head { padding: 16px 12px 6px; font-weight: 600; color: var(--color-ink-3); }
.sb-item { min-height: 40px; padding: 0 12px; gap: 12px; border-radius: var(--radius); font-weight: 500; color: var(--color-ink-2); }
.sb-item:hover { background: var(--color-paper-2); color: var(--color-ink); }
.sb-item[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 600; }
.sb-count { min-width: 22px; height: 20px; padding: 0 7px; background: var(--color-accent); color: var(--color-accent-ink); font-weight: 700; }
.sb-item[aria-current="page"] .sb-count { background: var(--color-accent); color: var(--color-accent-ink); }
.sb-foot { padding: var(--space-sm); gap: var(--space-xs); }
.sb-me .avatar { width: 32px; height: 32px; background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 700; }
.sb-me:hover, .sb-me[aria-current="page"] { background: var(--color-paper-2); }
.sb-tools .sb-tool { min-height: 36px; border-radius: var(--radius); }
.avatar, .round { background: var(--color-accent-soft); color: var(--color-accent-text); font-weight: 700; }

/* Pages */
.page { padding: 1.75rem var(--space-xl) var(--space-3xl); }
.page-head { margin-bottom: 1.375rem; }
.main { background: var(--color-paper); }
.topbar { background: var(--color-surface); }

/* Home (dashboard) */
.hello-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); padding: var(--space-md) 1.125rem; margin-bottom: 1.375rem; border-radius: var(--radius-lg); background: var(--color-sun-soft); border: 1px solid var(--color-sun-rule); }
.hello-banner .ring-count { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-sun); color: #1b1d2a; font-weight: 700; font-size: var(--text-sm); }
.hello-banner > div { flex: 1 1 18rem; display: flex; flex-direction: column; gap: 2px; }
.hello-banner b { font-size: var(--text-md); }
.hello-banner span { color: var(--color-sun-ink); }
.hello-banner form { margin: 0; }
.hello-banner .checklist { grid-column: 1 / -1; flex-basis: 100%; }
.attn { display: flex; align-items: center; gap: var(--space-sm); padding: 10px var(--space-sm); margin: 0 var(--space-xs); border-radius: var(--radius); color: var(--color-ink); }
.attn:hover { background: var(--color-paper-2); color: var(--color-ink); }
.attn .ic { flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius); display: grid; place-items: center; }
.attn .ic.blue { background: var(--color-info-soft); color: var(--color-info); }
.attn .ic.sun { background: var(--color-warn-soft); color: var(--color-warn); }
.attn .ic.bad { background: var(--color-bad-soft); color: var(--color-bad); }
.attn .ic.ok { background: var(--color-ok-soft); color: var(--color-ok); }
.attn > span:not(.ic):not(.badge) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attn small { color: var(--color-ink-3); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-empty { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) 1.25rem 1.25rem; color: var(--color-ink-2); }
.attn-empty .ic { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-ok-soft); color: var(--color-ok); flex: none; }

/* Single-card pages get the Adab mark */
.solo-brand { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.02em; }
.solo-brand, .brand-logo { position: relative; }
.solo-brand::before, .brand-logo::before { content: ""; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--color-accent); }
.solo-brand::after, .brand-logo::after { content: ""; position: absolute; left: 19px; top: 50%; margin-top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--color-sun); border: 2px solid var(--color-surface); }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.3125rem; letter-spacing: -0.02em; color: var(--color-ink); }

@media (max-width: 56rem) {
  .page { padding: var(--space-lg) var(--space-md) var(--space-2xl); }
  .sb-item { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  a.tile:hover, .stat:has(a):hover { transform: none; }
}
/* Money and counts use Figtree: Bricolage's pound sign reads too much like an ampersand. */
.tile b, .stat b { font-family: var(--font-body); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.site-banner.sun { background: var(--color-sun-soft); color: var(--color-sun-ink); }
