/* Neuromancer Sales. Dark by default, Geist, one accent (green). Hairlines instead of cards.
   Radius scale: 4 (kbd, box), 6 (controls), 8 (panels, popovers). Spacing on a 4px grid. */
:root {
  --bg: #0f1012; --side: #0b0c0d; --surface: #141517; --raised: #1a1b1e; --sunken: #121315;
  --hover: rgb(255 255 255 / .04); --active: rgb(255 255 255 / .08); --sel: rgb(67 194 154 / .09);
  --ink: #e9eaeb; --ink-2: #a8abb0; --ink-3: #7e8289;
  --line: rgb(255 255 255 / .07); --line-strong: rgb(255 255 255 / .14);
  --accent: #43c29a; --accent-hover: #5dd1ab; --on-accent: #06231a; --accent-soft: rgb(67 194 154 / .14);
  --warn: #e6b866; --warn-soft: rgb(230 184 102 / .13);
  --bad: #f09a94; --bad-soft: rgb(240 154 148 / .13); --bad-solid: #c4403a;
  --focus: #43c29a;
  --shadow-pop: 0 0 0 1px rgb(255 255 255 / .06), 0 12px 36px rgb(0 0 0 / .55);
  --r-s: 4px; --r-m: 6px; --r-l: 8px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --side-w: 232px;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbfbfa; --side: #f4f4f2; --surface: #ffffff; --raised: #ffffff; --sunken: #f4f4f2;
  --hover: rgb(0 0 0 / .04); --active: rgb(0 0 0 / .07); --sel: rgb(11 107 80 / .08);
  --ink: #17181a; --ink-2: #51565c; --ink-3: #6a7077;
  --line: rgb(0 0 0 / .08); --line-strong: rgb(0 0 0 / .16);
  --accent: #0b6b50; --accent-hover: #095741; --on-accent: #ffffff; --accent-soft: rgb(11 107 80 / .11);
  --warn: #8a5200; --warn-soft: rgb(138 82 0 / .1); --bad: #a8231b; --bad-soft: rgb(168 35 27 / .09); --bad-solid: #a8231b;
  --focus: #0b6b50;
  --shadow-pop: 0 0 0 1px rgb(0 0 0 / .06), 0 12px 32px rgb(20 22 25 / .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.5 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.9375rem; line-height: 1.35; font-weight: 600; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: from-font; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: var(--r-s); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 0.8125rem; line-height: 1.45; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.st { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; color: var(--ink-3); }
svg.st-research { color: var(--warn); } svg.st-ready { color: var(--accent); } svg.st-assigned { color: var(--accent); }
svg.st-review { color: var(--ink-2); } svg.st-rejected { color: var(--ink-3); } svg.st-suppressed { color: var(--bad); }
kbd { font: 500 11px/1 var(--mono); display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-s); background: var(--active); color: var(--ink-2); }

/* Buttons and fields (rep view uses these at touch size, admin overrides below) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-m);
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font-weight: 500; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 120ms, border-color 120ms, color 120ms;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--hover); border-color: var(--ink-3); } }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); } }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .btn.quiet:hover { background: var(--hover); border-color: transparent; color: var(--ink); } }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: 0.8125rem; gap: 6px; }
.btn.lg { min-height: 56px; font-size: 1.0625rem; border-radius: var(--r-l); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; padding: 0; }
.iconbtn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-m); background: transparent; color: var(--ink-2); flex: none; transition: background-color 120ms, color 120ms; }
@media (hover: hover) and (pointer: fine) { .iconbtn:hover:not(:disabled) { background: var(--hover); color: var(--ink); } }
.iconbtn:disabled { opacity: .35; cursor: default; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-m); background: var(--sunken); font-size: 1rem; /* 16px stops iOS zoom */
  transition: border-color 120ms, box-shadow 120ms;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: var(--active); color: var(--ink-2); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.tagbtn { min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-size: 0.8125rem; transition: background-color 120ms, border-color 120ms, transform 120ms var(--ease); }
.tagbtn:active { transform: scale(0.97); }
.tagbtn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.pad { padding: 24px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.mark { width: 20px; height: 20px; border-radius: 5px; background: var(--ink); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 5px 5px 5px 9px; background: var(--bg); border-radius: 1px; }
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.av { --h: 200; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: hsl(var(--h) 22% 30%); color: hsl(var(--h) 30% 88%); font-size: 10px; font-weight: 600; flex: none; }
.av.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
:root[data-theme="light"] .av { background: hsl(var(--h) 30% 82%); color: hsl(var(--h) 40% 22%); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 6px; } .bars i:nth-child(3) { height: 8px; } .bars i:nth-child(4) { height: 10px; } .bars i:nth-child(5) { height: 12px; }
.bars i.on { background: var(--ink-2); }

/* Auth screens */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.auth-card h1 { font-size: 1.375rem; }
.gbtn { min-height: 44px; gap: 12px; }

/* Toasts: bottom-left, clear of the sidebar on desktop */
.toasts { position: fixed; left: calc(var(--side-w) + 16px); bottom: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; z-index: 100; pointer-events: none; max-width: calc(100% - 32px); }
body.rep .toasts { left: 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: min(460px, 100%); background: var(--raised); color: var(--ink); padding: 9px 12px 9px 14px; border-radius: var(--r-l); box-shadow: var(--shadow-pop); font-size: 13px; animation: toast-in 200ms var(--ease); transition: opacity 160ms, transform 160ms; }
.toast.out { opacity: 0; transform: translateY(4px); }
.toast.bad { color: var(--bad); }
.toast-undo { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 2px 4px; border-radius: var(--r-s); font-size: 13px; }
.toast-undo:hover { background: var(--hover); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Admin shell ===== */
body.admin { font-size: 13px; line-height: 1.45; overflow: hidden; }
body.admin .btn { min-height: 28px; padding: 0 10px; font-size: 13px; gap: 6px; border-radius: var(--r-m); }
body.admin .btn.lg { min-height: 36px; }
body.admin input[type="text"], body.admin input[type="email"], body.admin input[type="search"], body.admin input[type="url"], body.admin select, body.admin textarea { min-height: 32px; padding: 5px 10px; font-size: 13px; }
body.admin textarea { min-height: 88px; }
body.admin .check { min-height: 28px; }
body.admin h1 { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
body.admin h2 { font-size: 14px; }
body.admin h3 { font-size: 12px; font-weight: 500; color: var(--ink-3); }
body.admin .chip { font-size: 11.5px; min-height: 20px; }
body.admin .tagbtn { min-height: 24px; font-size: 12px; padding: 0 10px; }
body.admin .label, body.admin .field > label { font-size: 12px; }
body.admin .facts { font-size: 13px; }
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; min-height: 0; overflow-y: auto; }
.ws { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.side-search { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-m); background: transparent; color: var(--ink-3); font-size: 13px; text-align: left; }
.side-search span:first-of-type { flex: 1; }
.side-k { display: inline-flex; gap: 2px; }
@media (hover: hover) { .side-search:hover { background: var(--hover); color: var(--ink-2); } }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: var(--r-m); text-decoration: none; color: var(--ink-2); font-size: 13px; }
.side-nav a > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav .cnt { font-style: normal; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-nav a svg.i { color: var(--ink-3); }
@media (hover: hover) { .side-nav a:hover { background: var(--hover); color: var(--ink); } }
.side-nav a[aria-current] { background: var(--active); color: var(--ink); }
.side-nav a[aria-current] svg.i { color: var(--ink); }
.side-sec { padding: 14px 8px 4px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 2px; border-top: 1px solid var(--line); }
.side-foot .av { width: 22px; height: 22px; font-size: 11px; }
.side-me { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.side-scrim { display: none; }
.view { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100dvh; overflow: hidden; outline: none; }
.vhead { flex: none; border-bottom: 1px solid var(--line); background: var(--bg); }
.vh-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; }
.vh-count { color: var(--ink-3); font-size: 12px; }
.vh-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; margin-left: -6px; }
.vbody { flex: 1; min-height: 0; overflow: auto; }
.search { display: flex; align-items: center; gap: 6px; height: 28px; width: 220px; padding: 0 6px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-m); color: var(--ink-3); transition: border-color 120ms, width 160ms var(--ease); }
.search:focus-within { border-color: var(--focus); width: 280px; }
.search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; min-height: 0 !important; height: 26px; padding: 0 !important; box-shadow: none !important; outline: none; color: var(--ink); font-size: 13px; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within kbd { display: none; }

/* Filter chips */
.fbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; min-height: 36px; }
.fchip { display: inline-flex; align-items: stretch; height: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-m); font-size: 12px; overflow: hidden; }
.fchip > * { display: inline-flex; align-items: center; padding: 0 7px; }
.fk { color: var(--ink-2); }
.fo { color: var(--ink-3); padding: 0 !important; }
.fv, .fx { border: 0; background: transparent; color: var(--ink); }
.fv { font-weight: 500; }
.fx { color: var(--ink-3); padding: 0 5px; border-left: 1px solid var(--line); }
.fx svg { width: 12px; height: 12px; }
@media (hover: hover) { .fv:hover, .fx:hover { background: var(--hover); } .fx:hover { color: var(--ink); } }
.fadd, .fclear { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border: 1px dashed var(--line-strong); border-radius: var(--r-m); background: transparent; color: var(--ink-3); font-size: 12px; }
.fadd:has(span:empty) { padding: 0 5px; }
.fclear { border: 0; }
@media (hover: hover) { .fadd:hover, .fclear:hover { background: var(--hover); color: var(--ink); } }

/* Lead list */
.lmain { position: relative; flex: 1; min-height: 0; display: flex; }
.llist { flex: 1; min-width: 0; overflow: auto; outline: none; padding-bottom: 96px; scroll-padding-top: 34px; }
.lskel { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.lskel .skeleton { height: 28px; }
.gh { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; height: 34px; padding: 0 16px 0 12px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grp:first-child .gh { border-top: 0; }
.gt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 0 0 4px; border: 0; background: none; color: var(--ink); text-align: left; }
.gt b { font-weight: 500; }
.gt .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chev { display: inline-grid; transition: transform 140ms var(--ease); color: var(--ink-3); }
.chev.open { transform: rotate(90deg); }
.chev svg { width: 14px; height: 14px; }
.gh-act { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--ink-3); font-size: 12px; opacity: 0; transition: opacity 120ms, background-color 120ms; }
.gh:hover .gh-act, .gh-act:focus-visible { opacity: 1; }
@media (hover: none) { .gh-act { opacity: 1; } }
.bl-short { display: none; }
.gh-act:hover { background: var(--hover); color: var(--ink); }
.gh .cb { position: relative; left: auto; top: auto; transform: none; width: 20px; }
.lrow { position: relative; display: grid; grid-template-columns: 52px minmax(0, 2.4fr) minmax(0, 1.3fr) 44px 72px minmax(0, 1.2fr) 24px 36px; align-items: center; column-gap: 12px; height: 36px; padding: 0 16px 0 12px; cursor: default; user-select: none; }
.lrow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .lrow:hover { background: var(--hover); } }
.lrow.sel { background: var(--sel); }
.lrow.foc { background: var(--active); box-shadow: inset 2px 0 0 var(--accent); }
.lrow.foc.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lc { position: relative; display: flex; align-items: center; height: 100%; overflow: visible !important; }
.lc .lst { margin-left: 26px; display: grid; }
.cb { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: none; opacity: 0; transition: opacity 100ms; }
.box { width: 14px; height: 14px; border: 1.5px solid var(--ink-3); border-radius: var(--r-s); display: grid; place-items: center; transition: background-color 100ms, border-color 100ms; }
.box svg { width: 12px; height: 12px; fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
@media (hover: hover) { .lrow:hover .cb, .gh:hover .cb { opacity: 1; } .cb:hover .box { border-color: var(--ink); } }
.llist.has-sel .cb, .lrow.sel .cb, .gh.all .cb, .gh.some .cb { opacity: 1; }
@media (hover: none) { .cb { opacity: 1; } }
.lrow.sel .box, .gh.all .box, .gh.some .box { background: var(--accent); border-color: var(--accent); }
.lrow.sel .box svg, .gh.all .box svg { opacity: 1; }
.gh.some .box::after { content: ""; width: 6px; height: 2px; border-radius: 1px; background: var(--on-accent); }
.lo .av.none { visibility: hidden; } 
.lb { display: flex; align-items: baseline; gap: 10px; }
.lb b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.lb i { font-style: normal; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.lt, .ll, .lp { color: var(--ink-2); }
.lt { text-transform: capitalize; }
.lg { display: flex; align-items: center; }
.lu { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.lo { display: flex; justify-content: center; }
.empty { text-align: center; padding: 64px 24px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { color: var(--ink); }

/* Bulk action bar */
.bulk { position: absolute; left: 50%; bottom: 20px; z-index: 8; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 2px; max-width: calc(100% - 24px); padding: 5px; background: var(--raised); border-radius: 10px; box-shadow: var(--shadow-pop); transition: opacity 160ms, transform 200ms var(--ease); }
.bulk.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bulk-n { padding: 0 10px 0 8px; white-space: nowrap; color: var(--ink-2); }
.bulk-n b { color: var(--ink); font-weight: 600; }
.bulk-n.warn { color: var(--bad); }
.sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 4px; flex: none; }
.bb { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--ink); font-size: 13px; white-space: nowrap; transition: background-color 100ms; }
.bb svg.i { color: var(--ink-3); }
@media (hover: hover) { .bb:hover:not(:disabled) { background: var(--active); } }
.bb:disabled { opacity: .35; cursor: default; }
.bb.danger { color: var(--bad); } .bb.danger svg.i { color: var(--bad); }
.bb.solid { background: var(--bad-solid); color: #fff; }
.bb.solid kbd { background: rgb(255 255 255 / .18); color: #fff; }
@media (hover: hover) { .bb.solid:hover:not(:disabled) { background: var(--bad-solid); filter: brightness(1.1); } }
.bb.sq { width: 28px; padding: 0; justify-content: center; }

/* Tooltips with the shortcut */
@media (hover: hover) {
  [data-tip] { position: relative; }
  [data-tip]:hover::after { content: attr(data-tip) "   " attr(data-kbd); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 90; padding: 4px 8px; border-radius: var(--r-m); background: var(--raised); box-shadow: var(--shadow-pop); color: var(--ink); font: 400 12px/1.3 "Geist", sans-serif; white-space: pre; pointer-events: none; animation: tip 120ms 350ms backwards; }
  .bulk [data-tip]:hover::after, .side-foot [data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); }
  .side-foot [data-tip]:hover::after { left: auto; right: 0; transform: none; }
  .vh-right [data-tip]:hover::after { left: auto; right: 0; transform: none; }
}
@keyframes tip { from { opacity: 0; } }

/* Popover and command menu */
.pop { position: fixed; z-index: 60; max-width: calc(100vw - 16px); background: var(--raised); border-radius: var(--r-l); box-shadow: var(--shadow-pop); padding: 4px; opacity: 0; transform: translateY(2px); transition: opacity 110ms, transform 140ms var(--ease); outline: none; }
.pop.in { opacity: 1; transform: none; }
.pop-q { padding: 2px 2px 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-q input[type="text"], .pop-q input[type="text"]:focus-visible { width: 100%; box-shadow: none; border: 0; background: transparent; outline: none; min-height: 28px; padding: 0 8px; font-size: 13px; color: var(--ink); }
.pop-list { max-height: min(340px, 52vh); overflow: auto; }
.pop-sec { padding: 8px 8px 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.pop-item, .cmd-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 8px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.pop-item.on, .cmd-item.on { background: var(--active); }
.pop-item.dis { opacity: .4; }
.pop-ic { display: inline-grid; place-items: center; width: 18px; flex: none; color: var(--ink-3); }
.pop-l { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pop-l small { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-r { color: var(--ink-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pop-r.hint { color: var(--accent); }
.pop-ck { width: 16px; color: var(--accent); display: inline-grid; place-items: center; flex: none; }
.pop-empty { padding: 14px 8px; color: var(--ink-3); text-align: center; }
.pop-foot { padding: 8px 10px 6px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--warn); font-size: 12px; }
.cmd-wrap { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 13vh 12px 0; }
.cmd-scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .5); animation: fade 120ms ease-out; }
.cmd { position: relative; width: min(600px, 100%); max-height: min(520px, 70vh); display: flex; flex-direction: column; background: var(--raised); border-radius: 10px; box-shadow: var(--shadow-pop); overflow: hidden; animation: cmd-in 160ms var(--ease); }
@keyframes cmd-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
.cmd-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.cmd-in input[type="text"], .cmd-in input[type="text"]:focus-visible { flex: 1; box-shadow: none; padding: 0; border: 0; background: transparent; outline: none; height: 46px; font-size: 14px; color: var(--ink); }
.cmd-list { overflow: auto; padding: 4px; flex: 1; }
.cmd-k { display: inline-flex; gap: 3px; }
.cmd-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.cmd-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* Peek panel */
.peek { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line-strong); overflow: auto; transform: translateX(16px); opacity: 0; visibility: hidden; transition: transform 180ms var(--ease), opacity 140ms, visibility 0s 180ms; }
.peek.open { transform: none; opacity: 1; visibility: visible; transition: transform 200ms var(--ease), opacity 140ms; }
.ph { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 10px 16px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ph-top { display: flex; align-items: center; gap: 2px; }
.ph-st { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.ph h2 { font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ph-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.ph-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pb { padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.psec { border-top: 1px solid var(--line); padding-top: 16px; }
.psec h3 { margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.9375rem; margin: 0; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { display: inline-flex; align-items: center; gap: 4px; }
.contact { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Grade */
.grade-wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 28px; }
.group-title { font-size: 12px; font-weight: 500; color: var(--ink-3); margin: 24px 0 6px; text-transform: capitalize; }
.group-title:first-child { margin-top: 0; }
.plist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pitem { display: grid; grid-template-columns: minmax(0, 1fr) 120px 56px; align-items: center; gap: 16px; height: 38px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.pitem strong { font-weight: 500; }
.pitem .num { text-align: right; }
@media (hover: hover) { .pitem:hover { background: var(--hover); } }
.meter { height: 3px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 300ms var(--ease); }
.lead-title { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; }
body.admin h1.lead-title, body.admin h2.lead-title { font-size: 22px; }
.gcard { display: flex; flex-direction: column; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale button, .decide button { min-height: 44px; border-radius: var(--r-m); border: 1px solid var(--line-strong); background: transparent; font-size: 16px; font-weight: 600; transition: transform 120ms var(--ease), background-color 120ms, border-color 120ms; }
@media (hover: hover) { .scale button:hover, .decide button:hover { background: var(--hover); } }
.scale button:active, .decide button:active { transform: scale(0.97); }
.scale button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.decide { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
.decide button { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.decide button.approve[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.decide button.reject[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.decide button.next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (hover: hover) { .decide button.next:hover { background: var(--accent-hover); } }
.decide button.next kbd { background: rgb(0 0 0 / .16); color: inherit; }
.gprog { align-items: center; }
.savestate { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); min-height: 24px; }
.savestate.err { color: var(--bad); font-weight: 500; }
.savestate .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.savestate.saved .dot { background: var(--accent); }
.savestate.saving .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.legend { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; justify-content: center; }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend em { font-style: normal; margin-left: 4px; color: var(--ink-2); }
.legend-to { margin: 0 2px; }

/* Team */
.team-wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 32px; }
.tsurface { overflow-x: auto; }
.tform { max-width: 520px; padding-top: 24px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th.num, td.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.biz { font-weight: 500; }

.skeleton { background: linear-gradient(90deg, var(--active), var(--hover), var(--active)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-m); min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { padding: 12px 16px; border-radius: var(--r-m); background: var(--warn-soft); color: var(--warn); font-size: 0.9375rem; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* ===== Rep: Today (touch sized, same tokens) ===== */
body.rep main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 96px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; min-height: 52px; display: flex; align-items: center; gap: 24px; }
.me { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 0.875rem; color: var(--ink-2); }
.today { max-width: 640px; margin: 0 auto; }
.today-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 32px 0 12px; }
.section-title:first-of-type { margin-top: 0; }
.section-title .n { color: var(--ink-3); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 12px; }
.lead-card.overdue { box-shadow: inset 3px 0 0 var(--warn); }
.lead-card h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.due { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.due.overdue { color: var(--warn); }
.contact-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.contact-actions .btn { min-width: 0; }
.brief { background: var(--sunken); border-radius: var(--r-m); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 0.9375rem; }
.brief p { overflow-wrap: anywhere; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.outcomes .btn { min-height: 56px; white-space: normal; text-align: center; line-height: 1.2; padding: 0 8px; }
.outcomes .btn.span2 { grid-column: span 2; }
.recent { display: flex; flex-direction: column; gap: 8px; font-size: 0.875rem; }
.recent li { display: flex; gap: 8px; justify-content: space-between; }
.recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
details > summary { cursor: pointer; font-size: 0.875rem; color: var(--ink-2); min-height: 40px; display: flex; align-items: center; gap: 8px; font-weight: 500; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-m); background: var(--active); font-weight: 600; }
details[open] > summary::before { content: "\2212"; }
.sheet { display: flex; flex-direction: column; gap: 12px; background: var(--sunken); border-radius: var(--r-m); padding: 16px; animation: fade 160ms ease-out; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
body.rep .empty { padding: 48px 24px; }
body.rep .surface.empty { background: var(--surface); }
@media (max-width: 480px) {
  .contact-actions .btn:not(.primary) { width: 56px; padding: 0; }
  .contact-actions .btn:not(.primary) span { display: none; }
}

/* ===== Narrow screens: sidebar becomes a menu ===== */
@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: 264px; transform: translateX(-100%); visibility: hidden; transition: transform 200ms var(--ease), visibility 0s 200ms; box-shadow: var(--shadow-pop); }
  body.side-open .side { transform: none; visibility: visible; transition: transform 200ms var(--ease); }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgb(0 0 0 / .5); opacity: 0; pointer-events: none; transition: opacity 160ms; }
  body.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .toasts { left: 12px; }
  body.has-bulk .toasts { bottom: 76px; }
  .vh-row { flex-wrap: wrap; }
  .vh-right { width: 100%; margin-left: 0; }
  .search { flex: 1; width: auto; }
  .search:focus-within { width: auto; }
  .search kbd { display: none; }
  .vh-right .btn:not(#l-backlog) span { display: none; }
  .bl-long { display: none; }
  .vh-right .bl-short { display: inline; }
  .vh-right .btn:not(#l-backlog) { padding: 0 8px; }
  .fbar { padding: 0 12px 8px; }
  .lrow { grid-template-columns: 44px minmax(0, 1fr) 40px 24px; padding: 0 12px 0 8px; column-gap: 8px; height: 44px; }
  .lt, .ll, .lp, .lu { display: none; }
  .lb { flex-direction: column; gap: 0; align-items: stretch; }
  .lb i { font-size: 12px; flex: none; }
  .lc .lst { margin-left: 24px; }
  .gh { padding-left: 8px; }
  .bulk { bottom: 12px; padding: 4px; gap: 0; }
  .bb span { display: none; }
  .bb { padding: 0 8px; height: 32px; }
  .bulk-n { padding: 0 6px; }
  .bulk-n.warn { white-space: normal; max-width: 120px; line-height: 1.2; }
  .peek { width: 100%; z-index: 9; }
  .grid2 { grid-template-columns: 1fr; }
  .grade-wrap { padding: 16px 12px 24px; }
  .pitem { grid-template-columns: minmax(0, 1fr) 72px 44px; gap: 12px; }
  .decide { grid-template-columns: 1fr 1fr; }
  .decide .next { grid-column: 1 / -1; }
  .legend { justify-content: flex-start; padding: 8px 12px; gap: 4px 12px; }
  .team-wrap { padding: 12px 12px 32px; }
  .lead-title, body.admin .lead-title { font-size: 20px; }
  body.rep main { padding: 16px 16px 96px; }
  .me .btn span, .me .name { display: none; }
  .me .btn { padding: 0 8px; }
  .topbar-in { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-delay: 0s !important; }
}
