/* Lead Desk — tokens first. Dark follows the system; data-theme overrides it. */
:root {
  --bg: #f3f3f1; --surface: #ffffff; --raised: #fafaf9; --sunk: #ebebe8;
  --line: #e1e1dd; --line-strong: #cfcfca;
  --text: #17181a; --muted: #5d6066; --faint: #8a8d92;
  --accent: #e2511f; --accent-ink: #ffffff; --accent-soft: #fbe6dd; --accent-text: #b63d12;
  --ok: #2f7d4f; --ok-soft: #e0efe5; --warn: #9a6a00; --warn-soft: #f6ecd2; --danger: #b3261e;
  --ours: #f6f4f1;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06);
  --chart: #e2511f; --grid: #ebebe8;
  --r: 6px; --r-sm: 4px;
  --sans: 'Onest', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e0f; --surface: #141517; --raised: #1a1b1e; --sunk: #0a0a0b;
    --line: #232428; --line-strong: #303237;
    --text: #ecebe8; --muted: #a2a4a9; --faint: #6f7277;
    --accent: #ff6b3d; --accent-ink: #1a0b05; --accent-soft: #2e1a12; --accent-text: #ff8a63;
    --ok: #5dbb83; --ok-soft: #14271c; --warn: #e0b04a; --warn-soft: #2a220f; --danger: #ff6b61;
    --ours: #17191c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .35);
    --chart: #f25c2c; --grid: #222327;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e0f; --surface: #141517; --raised: #1a1b1e; --sunk: #0a0a0b;
  --line: #232428; --line-strong: #303237;
  --text: #ecebe8; --muted: #a2a4a9; --faint: #6f7277;
  --accent: #ff6b3d; --accent-ink: #1a0b05; --accent-soft: #2e1a12; --accent-text: #ff8a63;
  --ok: #5dbb83; --ok-soft: #14271c; --warn: #e0b04a; --warn-soft: #2a220f; --danger: #ff6b61;
  --ours: #17191c;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .35);
  --chart: #f25c2c; --grid: #222327;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell */
.shell { display: grid; grid-template-columns: 224px 1fr; height: 100dvh; }
.rail { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark { width: 22px; height: 22px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 2px; }
.brand-mark i { display: block; background: var(--text); border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 100%; } .brand-mark i:nth-child(2) { height: 70%; } .brand-mark i:nth-child(3) { height: 42%; background: var(--accent); }
.brand b { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.mode { margin-left: auto; font: 500 11px var(--mono); padding: 2px 6px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }
.mode.live { background: var(--ok-soft); color: var(--ok); }
.nav { padding: 6px 10px; display: grid; gap: 1px; }
.nav-h { font-size: 12px; color: var(--faint); padding: 14px 10px 6px; }
.nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); cursor: pointer; color: var(--muted); }
.nav button:hover { background: var(--raised); color: var(--text); }
.nav button[aria-current="true"] { background: var(--sunk); color: var(--text); font-weight: 500; }
.nav button svg { width: 16px; height: 16px; flex: none; }
.nav .n { margin-left: auto; font: 12px var(--mono); color: var(--faint); }
.nav .n.hot { color: var(--accent-text); font-weight: 500; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin: 0 4px; border: 1.5px solid var(--faint); }
.rail-foot { margin-top: auto; padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--faint); }
.rail-foot button { all: unset; cursor: pointer; padding: 4px; border-radius: var(--r-sm); display: grid; }
.rail-foot button:hover { color: var(--text); }
.rail-foot svg { width: 16px; height: 16px; }

.main { min-width: 0; min-height: 0; display: grid; }
.split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; min-height: 0; }

/* Lead list */
.list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.list-head { padding: 16px 16px 10px; display: grid; gap: 10px; }
.list-head h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; display: flex; align-items: baseline; gap: 8px; }
.list-head h1 .mono { color: var(--faint); font-weight: 400; }
.list-head p { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.search { position: relative; }
.search input { width: 100%; padding: 8px 10px 8px 32px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.search input::placeholder { color: var(--faint); }
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 14px; height: 14px; color: var(--faint); }
.search kbd { position: absolute; right: 8px; top: 50%; translate: 0 -50%; }
kbd { font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; background: var(--surface); }
.rows { overflow-y: auto; flex: 1; padding: 0 8px 16px; }
.row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; padding: 11px 10px 12px; border-radius: var(--r); cursor: pointer; position: relative; }
.row + .row { box-shadow: inset 0 1px 0 var(--line); }
.row:hover { background: var(--surface); }
.row[aria-selected="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.row[aria-selected="true"] + .row { box-shadow: none; }
.row-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.row-when { font: 12px var(--mono); color: var(--faint); text-align: right; }
.row-sub { grid-column: 1 / -1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-why { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 4px; }
.row-why.hot { color: var(--accent-text); font-weight: 500; }
.row-why.warn { color: var(--warn); }
.row-why.calm { color: var(--muted); }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 10px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.meter i.on { background: var(--text); }
.meter.won i.on { background: var(--ok); }
.meter.lost i { background: var(--line); }

/* Workspace */
.ws { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.ws-head { padding: 18px 24px 0; display: grid; gap: 14px; }
.ws-top { display: flex; align-items: flex-start; gap: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); font-weight: 600; flex: none; }
.who { min-width: 0; flex: 1; }
.who h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.who .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; margin-top: 4px; }
.who .meta a { text-decoration: none; } .who .meta a:hover { text-decoration: underline; }
.btn.back { display: none; }
.track { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--raised); }
.track button { all: unset; box-sizing: border-box; flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.track button + button { border-left: 1px solid var(--line); }
.track button:hover { color: var(--text); background: var(--surface); }
.track button.past { color: var(--text); }
.track button.past::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--text); }
.track button[aria-pressed="true"] { color: var(--text); font-weight: 600; background: var(--surface); }
.track button[aria-pressed="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.track.won button[aria-pressed="true"]::after, .track.won button.past::after { background: var(--ok); }
.track button .k { font: 10px var(--mono); color: var(--faint); margin-right: 6px; }

.next { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); }
.next.calm { background: var(--raised); border: 1px solid var(--line); }
.next.good { background: var(--ok-soft); }
.next-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.next.calm .next-ico { background: var(--sunk); color: var(--muted); }
.next.good .next-ico { background: var(--ok); color: var(--surface); }
.next-ico svg { width: 15px; height: 15px; }
.next-txt { flex: 1; min-width: 0; }
.next-txt b { display: block; font-weight: 600; }
.next-txt span { color: var(--muted); font-size: 13px; }
.next .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 -24px; padding: 0 24px; }
.tabs button { all: unset; cursor: pointer; padding: 10px 0 11px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--text); font-weight: 500; }
.tabs .n { font: 11px var(--mono); color: var(--faint); }
.pane { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 24px; }
.pane.convo { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Buttons & fields */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 12px; border-radius: var(--r); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--raised); border-color: var(--faint); }
.btn:active { translate: 0 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; translate: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn svg { width: 14px; height: 14px; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .7; }
.btn[aria-busy="true"]::before { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 1turn; } }
.field { display: grid; gap: 5px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.input, textarea.input, select.input { width: 100%; border: 1px solid var(--line); background: var(--raised); border-radius: var(--r); padding: 8px 10px; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid2 .full { grid-column: 1 / -1; }
.section-h { font-size: 15px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.section-p { margin: 0 0 18px; color: var(--muted); font-size: 13px; max-width: 60ch; }

/* Conversation */
.msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 640px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.msg.ours { align-self: flex-end; background: var(--ours); border-color: transparent; }
.msg header { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.msg header b { color: var(--text); font-weight: 600; }
.msg header .mono { margin-left: auto; color: var(--faint); }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }
.msg .body a { color: var(--accent-text); }
.msg.quoted .body { max-height: 12em; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
.day { align-self: center; font: 11px var(--mono); color: var(--faint); }
.composer { border-top: 1px solid var(--line); padding: 12px 24px 16px; background: var(--surface); display: grid; gap: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { all: unset; box-sizing: border-box; flex: none; font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.composer textarea { min-height: 110px; max-height: 40vh; }
.composer-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.composer-foot .spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }
.missing { color: var(--warn); font-size: 12.5px; }

/* Order + warm-up */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; position: relative; }
.step + .step { border-top: 1px solid var(--line); }
.step .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font: 11px var(--mono); color: var(--faint); margin-top: 1px; background: var(--surface); }
.step.done .dot { background: var(--text); border-color: var(--text); color: var(--surface); }
.step.due .dot { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.over .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step b { font-weight: 500; } .step.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.step .when { font-size: 12.5px; color: var(--muted); }
.step.over .when, .step.due .when { color: var(--accent-text); font-weight: 500; }
.step .acts { display: flex; gap: 6px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--raised); }
.card + .card { margin-top: 14px; }
.timeline { display: flex; gap: 0; margin: 4px 0 18px; }
.timeline div { flex: 1; font-size: 12.5px; color: var(--faint); padding-top: 10px; border-top: 2px solid var(--line); }
.timeline div.on { color: var(--text); border-color: var(--text); }
.timeline div.cur { color: var(--accent-text); border-color: var(--accent); font-weight: 500; }
.timeline div + div { margin-left: 4px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.log li .mono { color: var(--faint); }

/* Full-width views */
.page { overflow-y: auto; padding: 22px 28px 40px; min-height: 0; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.page-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); min-height: 200px; display: flex; flex-direction: column; }
.col.drop { border-color: var(--accent); background: var(--accent-soft); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
.col-h .mono { color: var(--faint); font-weight: 400; margin-left: auto; }
.col-b { padding: 8px; display: grid; gap: 8px; }
.kc { all: unset; box-sizing: border-box; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 11px; cursor: grab; box-shadow: 0 1px 1px rgb(0 0 0 / .03); }
.kc:hover { border-color: var(--line-strong); }
.kc b { font-weight: 500; font-size: 13.5px; }
.kc .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc .why { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.kc.dragging { opacity: .4; }
.col-empty { font-size: 12.5px; color: var(--faint); padding: 14px 6px; text-align: center; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 14px; background: var(--raised); border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:hover td { background: var(--raised); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.tag.hot { background: var(--accent-soft); color: var(--accent-text); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.settings { max-width: 760px; display: grid; gap: 28px; }
.tpl { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.tpl-h { display: flex; gap: 10px; align-items: center; }
.tpl-h .input { max-width: 240px; font-weight: 500; }
.vars { font: 12px var(--mono); color: var(--faint); }
.banner { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--text); font-size: 13px; margin-bottom: 18px; }
.banner b { color: var(--warn); }

/* Analytics */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { all: unset; cursor: pointer; padding: 7px 12px; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text); background: var(--sunk); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 2px; }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-v { font-size: 30px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat:first-child .stat-v { color: var(--text); }
.stat:first-child { border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--chart); }
.stat-n { font-size: 12.5px; color: var(--faint); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.charts .card + .card { margin-top: 0; }
.chart-card { background: var(--surface); }
.cols { display: grid; grid-template-columns: repeat(8, 1fr); height: 200px; align-items: end; border-bottom: 1px solid var(--line-strong); background: repeating-linear-gradient(to top, transparent 0 49px, var(--grid) 49px 50px); padding-top: 18px; }
.colw { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; cursor: default; }
.colw .bar { width: min(24px, 60%); background: var(--chart); border-radius: 4px 4px 0 0; }
.colw .cap { font-size: 11.5px; color: var(--text); margin-bottom: 4px; }
.colw .tick { position: absolute; bottom: -22px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.colw.hover { background: var(--raised); }
.chart-card .cols { margin-bottom: 26px; }
.funnel { display: grid; gap: 10px; }
.frow { display: grid; grid-template-columns: 96px 1fr 30px 40px; gap: 10px; align-items: center; font-size: 13px; border-radius: var(--r-sm); }
.frow.hover { background: var(--raised); }
.fl { color: var(--muted); }
.ftrack { height: 20px; display: flex; align-items: center; }
.fbar { height: 16px; min-width: 2px; background: var(--chart); border-radius: 0 4px 4px 0; }
.fn { text-align: right; color: var(--text); }
.fp { text-align: right; color: var(--faint); }
.tbl tfoot td { background: var(--raised); border-top: 1px solid var(--line-strong); }
.tip { position: fixed; z-index: 40; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); border-radius: var(--r); padding: 8px 10px; font-size: 12.5px; display: grid; gap: 1px; pointer-events: none; }
.tip b { font-weight: 600; }
.earn { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.earn b { color: var(--text); font-size: 18px; margin-left: 4px; }

/* States */
.empty { display: grid; place-items: center; text-align: center; padding: 48px 24px; color: var(--muted); gap: 6px; height: 100%; align-content: center; }
.empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.empty svg { width: 28px; height: 28px; color: var(--faint); margin-bottom: 6px; }
.skel { background: linear-gradient(90deg, var(--sunk), var(--raised), var(--sunk)); background-size: 200% 100%; animation: sh 1.2s linear infinite; border-radius: var(--r-sm); height: 12px; }
@keyframes sh { to { background-position: -200% 0; } }
.skel-row { display: grid; gap: 8px; padding: 14px 10px; }
.err { color: var(--danger); font-size: 13px; }
#toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--r); font-size: 13px; box-shadow: var(--shadow); transition: opacity .18s, translate .18s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; translate: -50% 0; }
#toast.bad { background: var(--danger); color: #fff; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; box-shadow: var(--shadow); }
.login h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

/* Modal */
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0; width: min(620px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.dlg-h { padding: 18px 20px 0; } .dlg-h h3 { margin: 0; font-size: 17px; }
.dlg-b { padding: 14px 20px; max-height: 60vh; overflow: auto; }
.dlg-f { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.mailprev { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: #fff; color: #1b1c1d; }

/* Tab bar (phone) */
.tabbar { display: none; }

@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(280px, 330px) 1fr; }
  .ws-head, .pane { padding-left: 20px; padding-right: 20px; }
  .tabs { margin: 0 -20px; padding: 0 20px; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { display: none; }
  .tabbar { display: flex; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { all: unset; flex: 1; display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--faint); padding: 6px 0; position: relative; cursor: pointer; min-height: 44px; }
  .tabbar button[aria-current="true"] { color: var(--text); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--accent); color: var(--accent-ink); font: 500 10px var(--mono); padding: 0 5px; border-radius: 99px; }
  .split { grid-template-columns: 1fr; }
  .split.has-lead .list { display: none; }
  .split:not(.has-lead) .ws { display: none; }
  .btn.back { display: inline-flex; margin-left: -8px; }
  .list { border-right: 0; }
  .list-head { padding: 16px 16px 10px; }
  .rows { padding: 0 8px 16px; }
  .row { padding: 12px 10px; }
  .ws-head { padding: 12px 16px 0; gap: 12px; }
  .pane { padding: 16px; }
  .tabs { margin: 0 -16px; padding: 0 16px; gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .track { overflow-x: auto; scrollbar-width: none; }
  .track button { padding: 9px 12px; flex: none; }
  .msgs { padding: 16px; }
  .composer { padding: 10px 16px 12px; }
  .next { flex-wrap: wrap; }
  .next .actions { width: 100%; justify-content: flex-start; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 32px; }
  .board { grid-template-columns: repeat(6, 78vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .tbl .hide-sm { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-v { font-size: 24px; }
  .charts { grid-template-columns: 1fr; }
  .colw:nth-child(odd) .tick { visibility: hidden; }
  .frow { grid-template-columns: 84px 1fr 26px 36px; }
  .ws-top .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
