/* Mercer Desk. The design system of Capital Radar's hub ("The Engine"): a corporate console with one accent colour
   (here Mercer green instead of navy), eyebrow labels, joined stat tiles, underline tabs, tables with mono figures,
   outlined tier squares and a call sheet that slides in. Status colours always sit beside a text label.
   Every text token is checked against the backgrounds it lands on (surface and sunk): 4.5:1 or better. */

:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --sunk: #eef1f4;
  --line: #dfe3e8;
  --line-strong: #c9d0d8;
  --text: #0f1a2a;
  --text-2: #344054;
  --muted: #586374;
  --primary: #003327;
  --primary-hover: #00261d;
  --primary-text: #ffffff;
  --primary-soft: #e3efe9;
  --link: #0b5c45;
  --pos: #17703f;
  --pos-bg: #e6f2ea;
  --warn: #8f5405;
  --warn-bg: #fbf1df;
  --neg: #b3261e;
  --neg-bg: #fbeae8;
  --info: #1f4f8f;
  --info-bg: #e6edf7;
  --focus: #2f7d5f;
  --shadow: 0 1px 2px rgba(15, 26, 42, 0.05), 0 6px 18px -12px rgba(15, 26, 42, 0.22);
  --scrim: rgba(15, 26, 42, 0.4);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0b1210; --surface: #111a17; --sunk: #16221e; --line: #22302b; --line-strong: #31443d;
    --text: #e8efec; --text-2: #c3d0cb; --muted: #97a8a1;
    --primary: #2f8a69; --primary-hover: #3a9a77; --primary-soft: #16302a; --link: #7fd1ae;
    --pos: #5cbd85; --pos-bg: #13301f; --warn: #e3a64c; --warn-bg: #2e2210; --neg: #f0857a; --neg-bg: #351815;
    --info: #8db4ea; --info-bg: #152538; --focus: #6fc7a3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 22px -14px rgba(0, 0, 0, 0.8); --scrim: rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1210; --surface: #111a17; --sunk: #16221e; --line: #22302b; --line-strong: #31443d;
  --text: #e8efec; --text-2: #c3d0cb; --muted: #97a8a1;
  --primary: #2f8a69; --primary-hover: #3a9a77; --primary-soft: #16302a; --link: #7fd1ae;
  --pos: #5cbd85; --pos-bg: #13301f; --warn: #e3a64c; --warn-bg: #2e2210; --neg: #f0857a; --neg-bg: #351815;
  --info: #8db4ea; --info-bg: #152538; --focus: #6fc7a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 22px -14px rgba(0, 0, 0, 0.8); --scrim: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, p { margin: 0; }
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt18 { margin-top: 18px; } .mt24 { margin-top: 24px; }
.booting { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface);
  border-right: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); min-height: 64px; }
.brand img { width: 28px; height: 28px; border-radius: 5px; }
.brand b { display: block; font-size: 15px; font-weight: 600; }
.brand span { display: block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }
.navs { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.navsec { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 1px 0; border-radius: 6px;
  color: var(--text-2); font-size: 14px; }
.nav a:hover { background: var(--sunk); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--primary-soft); color: var(--text); font-weight: 500; }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav .badge { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); }
.nav .badge.hot { color: var(--primary-text); background: var(--primary); border-radius: 9px; padding: 0 6px; }
.foot { border-top: 1px solid var(--line); padding: 12px 16px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk);
  border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); flex: none; }
.who .txt { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rolepill { display: inline-block; font: 500 10px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-top: 2px; }
.iconbtn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--sunk); color: var(--text); }
.signout { display: flex; align-items: center; gap: 8px; margin-top: 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; }
.signout:hover { color: var(--text); }
.maincol { min-width: 0; display: flex; flex-direction: column; }
.menuscrim { display: none; }
.mobilebar { display: none; }
.page { padding: 32px 32px 48px; max-width: 1240px; width: 100%; }
.footer { margin-top: auto; padding: 16px 32px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- page header */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin-bottom: 14px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
.ph h1 { font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.ph .sub { color: var(--text-2); margin-top: 6px; max-width: 760px; }
.ph .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ph .meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; color: var(--text-2); flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--neg); border-color: var(--neg); background: var(--surface); }
.btn.danger:hover { background: var(--neg-bg); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--sunk); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 42px; padding: 0 18px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.good { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 45%, var(--line)); }
.btn.bad { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, var(--line)); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=tel],
input[type=url], select, textarea {
  font: 14px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px;
  height: 36px; padding: 0 10px; min-width: 0; }
textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; width: 100%; }
select { padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.f { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.f input, .f select, .f textarea { text-transform: none; letter-spacing: 0; font-weight: 400; }
.f .hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.formrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.formrow .grow { flex: 1; min-width: 180px; }
.formrow input[type=text] { flex: 1; min-width: 160px; }
.err { color: var(--neg); font-size: 13px; min-height: 18px; }

/* ---------------------------------------------------------------- chips, badges, tiers */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 3px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--surface); white-space: nowrap; }
.chip.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.good { color: var(--pos); background: var(--pos-bg); border-color: color-mix(in srgb, var(--pos) 35%, transparent); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.bad { color: var(--neg); background: var(--neg-bg); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.chip.info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.tag { display: inline-block; font: 500 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line-strong);
  border-radius: 3px; padding: 1px 6px; color: var(--text-2); background: var(--sunk); white-space: nowrap; }
.tier { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; font: 600 12px var(--mono);
  border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); flex: none; }
.tier.S { background: var(--pos); border-color: var(--pos); color: #fff; }
.tier.A { border-color: var(--pos); color: var(--pos); background: var(--pos-bg); }
.tier.B { border-color: var(--info); color: var(--info); background: var(--info-bg); }
.tier.C { border-color: var(--line-strong); color: var(--muted); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { display: inline-flex; gap: 6px; align-items: baseline; padding: 10px 0 11px; color: var(--text-2); font: 14px var(--sans);
  border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.tabs .c { font: 11px var(--mono); color: var(--muted); }

/* ---------------------------------------------------------------- stat tiles, cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.tile { padding: 16px; border-right: 1px solid var(--line); min-width: 0; }
.tile:last-child { border-right: 0; }
.tile .l { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.tile .v { font: 500 22px var(--mono); margin-top: 6px; letter-spacing: -0.02em; }
.tile .v small { font-size: 14px; color: var(--muted); }
.tile .v.txt { font: 600 16px/1.35 var(--sans); letter-spacing: 0; }
.tile .v.pos { color: var(--pos); } .tile .v.neg { color: var(--neg); } .tile .v.info { color: var(--info); } .tile .v.warn { color: var(--warn); }
.tile .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.card.dashed { border-style: dashed; box-shadow: none; }
.card.alert { border-color: color-mix(in srgb, var(--neg) 55%, var(--line)); }
.card.notice { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.ch { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ch h2 { font-size: 14px; font-weight: 600; }
.ch .eyebrow { margin-bottom: 2px; }
.cb { padding: 18px 20px; }
.cb.flush { padding: 0; }
.cb + .cb { border-top: 1px solid var(--line); }
.empty { padding: 36px 20px; text-align: center; color: var(--text-2); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.sectitle { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 10px; }
.sectitle h2 { font-size: 15px; font-weight: 600; }

/* ---------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); background: var(--sunk);
  padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
td.num, th.num { text-align: right; }
.co { display: flex; gap: 10px; align-items: flex-start; }
.co .n { font-weight: 600; color: var(--text); }
.co .d { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.co .d2 { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reason { color: var(--text); max-width: 380px; }
.reason .q { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.line .tel { font: 500 14px var(--mono); color: var(--text); white-space: nowrap; }
.line .sub { font: 12px var(--mono); color: var(--muted); margin-top: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.pager .ctl { display: flex; align-items: center; gap: 10px; }
tr.logged td { opacity: 0.6; }

/* ---------------------------------------------------------------- filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.filters label { display: flex; gap: 10px; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.filters label select, .filters label input { text-transform: none; letter-spacing: 0; font-weight: 400; }
.filters .grow { flex: 1; min-width: 220px; }
.filters .grow input { width: 100%; }

/* ---------------------------------------------------------------- score gauge + bars */
.gauge { display: block; }
.gauge .arc { fill: none; stroke-width: 10; }
.gauge .tick { stroke: var(--text-2); stroke-width: 1; }
.gauge text { fill: var(--muted); font: 9px var(--mono); }
.gauge .needle { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.gauge .hub { fill: var(--text); }
.gauge .big { fill: var(--text); font: 600 26px var(--mono); }
.gauge .of { fill: var(--muted); font: 9px var(--mono); }
.mini { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--mono); }
.parts { display: grid; gap: 12px; }
.part { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 48px; gap: 12px; align-items: center; font-size: 13.5px; }
.part .bar { height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.part .bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.part .v { font: 13px var(--mono); text-align: right; }
.total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.total b { font: 600 17px var(--mono); color: var(--text); letter-spacing: 0; }
.why { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.gaugecap { text-align: center; color: var(--pos); font-weight: 500; font-size: 13px; }
.gaugecap span { display: block; color: var(--muted); font: 11px var(--mono); margin-top: 2px; }
.reasons { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.reasons li { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); }
.reasons b { font: 500 12px var(--mono); color: var(--pos); min-width: 30px; }
.reasons b.neg { color: var(--muted); }
.hbars { display: grid; }
.hbar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 120px; gap: 14px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hbar:last-child { border-bottom: 0; }
.hbar .bar { height: 5px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: var(--pos); border-radius: 3px; }
.hbar .bar i.alt { background: var(--primary); }
.hbar .v { font: 12.5px var(--mono); text-align: right; color: var(--text-2); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }

/* ---------------------------------------------------------------- timeline, people, lists */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tl li:last-child { border-bottom: 0; }
.tl .when { color: var(--muted); font: 12px var(--mono); padding-top: 2px; }
.tl p { color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }
.seat { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.seat:last-child { border-bottom: 0; }
.seat .k { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
.seat .n { font-weight: 600; }
.seat .t { color: var(--text-2); font-size: 13px; }
.seat .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.box { font-size: 13px; color: var(--text-2); background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.quote { border-left: 3px solid var(--primary); background: var(--sunk); padding: 10px 14px; border-radius: 0 4px 4px 0; color: var(--text); font-size: 14px; }
.list .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.checkrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.checkrow:last-child { border-bottom: 0; }
.checkrow .note { color: var(--muted); font-size: 12.5px; }
.state { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); margin-top: 1px; }
.state.ok { background: var(--pos); border-color: var(--pos); color: #fff; }
.state .i { width: 12px; height: 12px; stroke-width: 2.5; }

/* ---------------------------------------------------------------- email */
.mailrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: start; }
.mailrow:last-child { border-bottom: 0; }
.mailrow .who { gap: 8px; flex-wrap: wrap; }
.mailrow .subj { font-weight: 500; margin-top: 6px; }
.mailrow .prev { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.mailrow .mside { text-align: right; display: grid; gap: 6px; justify-items: end; align-content: start; }
.mailrow .mside .num { font-size: 12px; color: var(--muted); }
.letter { white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: var(--surface); }
.envelope { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; font-size: 13.5px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--sunk); }
.envelope dt { color: var(--text-2); }
.envelope dd { margin: 0; }
.tplgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.preview { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.preview .ps { background: var(--sunk); padding: 10px 12px; font-weight: 500; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.preview .pb { padding: 12px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }

/* ---------------------------------------------------------------- toggle */
.toggle { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; inset: 0; z-index: 1; }
.toggle span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 11px; transition: background 0.15s; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + span { background: var(--pos); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:disabled { cursor: not-allowed; }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- pipelines board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; min-height: 160px; }
.col.won { border-color: color-mix(in srgb, var(--pos) 45%, var(--line)); }
.colh { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--line); }
.colh span { font: 11px var(--mono); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; margin: 8px; padding: 10px; font-size: 13px; display: grid; gap: 6px; }
.dcard a { font-weight: 600; color: var(--text); }
.dcard .m { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--text-2); font-size: 12px; }
.dcard select { height: 30px; font-size: 12.5px; }
.colempty { color: var(--muted); font-size: 12.5px; padding: 14px 12px; }

/* ---------------------------------------------------------------- call sheet (drawer) */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .scrimx { position: absolute; inset: 0; background: var(--scrim); }
.drawer .panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px -20px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; }
.drawer .dh { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer .dh h2 { font-size: 18px; font-weight: 600; }
.drawer .db { padding: 18px 22px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.bigtel { display: flex; align-items: center; gap: 10px; font: 600 22px var(--mono); color: var(--text); }
.bigtel:hover { text-decoration: none; color: var(--primary); }
.outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sheetsec .k { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }

/* ---------------------------------------------------------------- search */
.topsearch { position: relative; }
.topsearch input { width: 100%; padding-left: 32px; }
.topsearch .i { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.results { display: none; position: absolute; left: 0; right: 0; top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); z-index: 40; overflow: hidden; }
.results.open { display: block; }
.results a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: var(--text); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.hl { background: var(--sunk); text-decoration: none; }
.results .none { padding: 12px; color: var(--muted); font-size: 13px; }
.sidesearch { padding: 12px 12px 0; }

/* ---------------------------------------------------------------- login, dialog, toast */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(400px, 100%); padding: 28px; margin: 0; }
.login .brand { border: 0; padding: 0 0 18px; min-height: 0; }
.login h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.login form { display: grid; gap: 14px; }
.login .hint { color: var(--muted); font-size: 12.5px; }
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: min(460px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--scrim); }
dialog .dh { padding: 16px 20px; font-weight: 600; border-bottom: 1px solid var(--line); }
dialog .db { padding: 16px 20px; display: grid; gap: 10px; color: var(--text-2); }
dialog .df { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: var(--sunk); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--text);
  color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 13.5px; transition: all 0.2s; z-index: 80; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--neg); color: #fff; }
#livebox { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: grid; gap: 8px; width: min(320px, calc(100% - 32px)); }
.livecard { background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--primary); border-radius: 8px;
  padding: 12px 14px; box-shadow: var(--shadow); }
.livecard.ring { border-left-color: var(--pos); }
body:has(.drawer.open) #livebox { right: calc(min(520px, 100%) + 16px); }   /* beside the call sheet, never over its buttons */
@media (max-width: 900px) { body:has(.drawer.open) #livebox { right: 64px; left: 16px; top: 12px; bottom: auto; width: auto; } }
.secret { font: 15px var(--mono); background: var(--sunk); border: 1px dashed var(--line-strong); padding: 10px 12px; border-radius: 4px; margin-top: 8px; word-break: break-all; }
.skel { height: 52px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--surface), var(--sunk), var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .why { grid-template-columns: 1fr; } .tplgrid { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.menu .side { transform: none; }
  .shell.menu .menuscrim { display: block; }
  .menuscrim { position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .mobilebar img { width: 24px; height: 24px; border-radius: 4px; }
  .page { padding: 20px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { border-bottom: 1px solid var(--line); }
  .ph { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .hbar { grid-template-columns: 100px 1fr 90px; padding: 10px 14px; }
  td, th { padding: 10px 12px; }
  .kv { grid-template-columns: 1fr; }
  .footer { flex-direction: column; padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Smartsheet colors on the deal board (store.STAGE_COLOR) */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.sw.white { background: #ffffff; }
.sw.purple { background: #8b6cc4; }
.sw.yellow { background: #f0c93a; }
.sw.blue { background: #4c86c6; }
.sw.green { background: #3e9a5c; }
.colh b { font-weight: 600; }
a.signout { text-decoration: none; }
