/* DealDesk — one small design system: tokens, layout, components. */
:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #fafbfc; --ink: #18202c; --ink-2: #3a4452; --muted: #6a7381;
  --line: #e3e6eb; --line-2: #eef0f3;
  --brand: #24508f; --brand-ink: #fff; --brand-soft: #e9eff9;
  --ok: #17784a; --ok-bg: #e6f4ec; --ok-line: #c3e4d1;
  --warn: #8a5a00; --warn-bg: #fdf3dc; --warn-line: #f1dca6;
  --bad: #b42318; --bad-bg: #fdecea; --bad-line: #f5c6c1;
  --info: #24508f; --info-bg: #eaf0fa; --info-line: #cddbf1;
  --idle: #5b6472; --idle-bg: #eef0f3;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --focus: 0 0 0 3px rgba(36, 80, 143, .25);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
code { font: 12.5px var(--mono); background: var(--line-2); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
h1 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h2 { margin: 0 0 var(--s3); font-size: 15px; font-weight: 650; }
h3 { margin: var(--s4) 0 var(--s2); font-size: 14px; font-weight: 600; }
p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }
ul { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 var(--s5); height: 56px; display: flex; align-items: center; gap: var(--s5); }
.brand { font-weight: 700; font-size: 16px; color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: var(--s1); flex: 1; min-width: 0; }
.nav a { color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--line-2); }
.count { font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); line-height: 18px; }
.account > summary { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); padding: 4px 6px 4px 4px;
  border-radius: 99px; }
.account > summary:hover { background: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 650;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center; text-transform: uppercase; }
.account .team-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head { padding: 8px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-2); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; }
.menu-label { padding: 6px 12px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
main { max-width: 1180px; margin: 0 auto; padding: var(--s5) var(--s5) var(--s7); }

/* ------------------------------------------------------------ page parts */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s5); }
.page-head .sub { margin-top: 2px; color: var(--muted); font-size: 14px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: inline-block; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; font-size: 14px; color: var(--ink-2); margin-top: var(--s2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.actions form, .inline-form { margin: 0; display: inline; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s4);
  box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.card .lead { color: var(--muted); font-size: 14px; margin-bottom: var(--s4); }
.empty { text-align: center; padding: var(--s7) var(--s5); }
.empty p { color: var(--muted); max-width: 520px; margin: var(--s2) auto var(--s4); }
.narrow { max-width: 460px; margin: var(--s7) auto; }
.grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.grid > .card { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.cols > .card { margin-bottom: 0; }
.stack-gap { margin-bottom: var(--s4); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 550;
  line-height: 20px; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); border-color: #d3d8df; text-decoration: none; }
.btn:focus-visible { box-shadow: var(--focus); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #1d4479; border-color: #1d4479; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: var(--surface); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { font-size: 13px; padding: 3px 10px; line-height: 20px; }
.btn.icon { padding: 3px 8px; font-size: 16px; line-height: 20px; letter-spacing: 1px; }
button:disabled, .btn:disabled { opacity: .55; cursor: default; }

/* ------------------------------------------------------- pills and badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--idle-bg); color: var(--idle); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok, .st-done, .st-manual_done { background: var(--ok-bg); color: var(--ok); }
.pill.warn, .st-needs_attention, .st-duplicate, .st-partial { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .st-failed { background: var(--bad-bg); color: var(--bad); }
.pill.info, .st-provisioning, .st-parsing, .st-received { background: var(--info-bg); color: var(--info); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--r-sm); background: var(--idle-bg);
  color: var(--idle); white-space: nowrap; }
.src-slack { background: #f4ebf7; color: #5d2266; }
.src-email { background: var(--info-bg); color: var(--info); }
.chip { display: inline-block; background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 1px 10px; font-size: 12.5px;
  font-weight: 500; margin: 2px 4px 2px 0; }

/* ----------------------------------------------------------------- alerts */
.alert { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r);
  margin-bottom: var(--s4); font-size: 14px; border: 1px solid transparent; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert code { background: rgba(255, 255, 255, .7); }
.alert .grow { flex: 1; min-width: 0; }
.alert.block { display: block; }

/* ----------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: var(--surface-2); }
.table input[size], .table select { width: auto; }
.table td { min-width: 0; }
.table .title { font-weight: 600; color: var(--ink); }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; width: 120px; margin-bottom: 4px; }
.bar div { height: 100%; background: var(--ok); border-radius: 99px; }

/* ------------------------------------------------------------------ forms */
label { display: block; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s3); min-width: 0; }
.field > span, .field-label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--s4); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1 1 200px; }
.form-row .field.fit { flex: 0 1 auto; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); padding: 7px 10px; border: 1px solid #d5dae1;
  border-radius: var(--r-sm); width: 100%; max-width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[disabled], select[disabled], textarea[disabled], fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea {
  background: var(--surface-2); color: var(--ink-2); }
input[type=file] { font-size: 13px; max-width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; vertical-align: -3px; }
textarea { line-height: 1.5; }
textarea.mono { font: 13px/1.55 var(--mono); padding: 12px; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Toggle switch: <button class="switch on"> or <input type=checkbox class="switch"> */
.switch { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #cfd5dd; border: 0; padding: 0; cursor: pointer;
  flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(16px); }
input[type=checkbox].switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; margin: 0; vertical-align: middle; }
input[type=checkbox].switch:checked { background: var(--ok); }
input[type=checkbox].switch:checked::after { transform: translateX(16px); }
input[type=checkbox].switch:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------ details / groups */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.disclose > summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; padding: 2px 0; }
.disclose > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.disclose[open] > summary::before { transform: rotate(45deg); }
.disclose > summary:hover { color: var(--ink); }
.disclose[open] > summary { margin-bottom: var(--s2); }
.card > details.section > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.card > details.section > summary h2 { margin: 0; }
.card > details.section > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.card > details.section[open] > summary::after { transform: rotate(225deg); }
.card > details.section[open] > summary { margin-bottom: var(--s4); }
.group { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: var(--s2); background: var(--surface); }
.group > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 8px 12px; font-size: 14px;
  font-weight: 600; }
.group > summary .n { color: var(--muted); font-weight: 500; margin-left: auto; }
.group > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s; }
.group[open] > summary::after { transform: rotate(225deg); }
.group[open] > summary { border-bottom: 1px solid var(--line-2); }
.group-body { padding: 4px 12px 8px; }
.danger-zone { border-top: 1px solid var(--line-2); margin-top: var(--s4); padding-top: var(--s3); }

/* ---------------------------------------------------- overflow menu */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; max-width: min(320px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 4px 0; }
.menu-panel > a, .menu-panel > form > button, .menu-panel .item { display: block; width: 100%; text-align: left; padding: 7px 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.menu-panel > a:hover, .menu-panel > form > button:hover, .menu-panel .item:hover { background: var(--line-2); text-decoration: none; }
.menu-panel > form { margin: 0; }
.menu-panel .item.danger, .menu-panel > form > button.danger { color: var(--bad); }
.menu-panel .item.current { font-weight: 600; }
.menu-panel .item.current::after { content: " ✓"; color: var(--ok); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.menu-panel .pad { padding: 8px 12px; white-space: normal; font-size: 13px; }
.menu-panel .pad p { margin-bottom: var(--s2); }
.menu-panel details > summary.item::after { content: " …"; }

/* ------------------------------------------------------ settings layout */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; }
.subnav a { padding: 7px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; font-weight: 500; display: flex;
  justify-content: space-between; align-items: center; gap: var(--s2); }
.subnav a:hover { background: var(--line-2); text-decoration: none; }
.subnav a.on { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand), var(--shadow); }
.subnav-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 6px; }

/* ------------------------------------------------------------ deal page */
.steps { list-style: none; margin: 0; padding: 0; }
.step { border-top: 1px solid var(--line-2); padding: 10px 0; }
.step:first-child { border-top: 0; padding-top: 0; }
.step-row { display: flex; align-items: center; gap: var(--s3); }
.step-main { flex: 1; min-width: 0; }
.step-label { font-weight: 600; font-size: 14.5px; }
.step-status { font-size: 13px; color: var(--muted); }
.step.st-failed .step-status, .step.is-failed .step-status { color: var(--bad); }
.step-actions { display: flex; gap: 6px; flex: none; }
.step-actions form { margin: 0; }
.step-sub { margin: var(--s2) 0 0 36px; }
.dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--idle-bg); color: var(--idle); }
.dot.st-done, .dot.st-manual_done { background: var(--ok-bg); color: var(--ok); }
.dot.st-failed { background: var(--bad-bg); color: var(--bad); }
.dot.st-simulated { background: var(--idle-bg); color: var(--muted); }
.dot.st-running, .dot.st-pending { background: var(--info-bg); color: var(--info); }
.check { width: 24px; height: 24px; flex: none; border: 2px solid #c2c8d0; border-radius: 7px; background: var(--surface); cursor: pointer;
  color: #fff; font-weight: 700; padding: 0; font-size: 13px; line-height: 1; }
.check:hover { border-color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { padding: 4px 0; font-size: 13.5px; display: flex; gap: var(--s2); align-items: baseline; }
.doc-list li .saved { font-size: 12px; color: var(--ok); }
/* Deal page: a stage tracker, quick links, then the deal (main) beside its documents (sidebar) */
.dot.st-idle { background: var(--idle-bg); color: var(--muted); }
.dot.st-waiting { background: var(--surface); border: 2px solid var(--line); }
.doc-list li.doc { align-items: center; }
.doc-list .dot { width: 18px; height: 18px; font-size: 11px; }
.doc-list .dot .spinner { width: 11px; height: 11px; }
.doc-list li.doc a, .doc-list li.doc span:last-child { min-width: 0; overflow-wrap: anywhere; }

.stepper { list-style: none; margin: 0 0 var(--s3); padding: var(--s3) var(--s4); display: flex; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.stepper-step { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); position: relative; }
.stepper-step + .stepper-step::before { content: ""; flex: 0 0 var(--s5); height: 2px; border-radius: 2px; background: var(--line); }
.stepper-step.is-done + .stepper-step::before { background: var(--ok-line); }
.stepper-text { min-width: 0; }
.stepper-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.stepper-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper-step.is-waiting .stepper-title { color: var(--muted); }
.stepper-step.is-current .stepper-sub { color: var(--info); }
.stepper-step.is-failed .stepper-sub { color: var(--bad); }

.quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s4); }
.quick-item { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 550; color: var(--ink-2);
  padding: 2px 4px 2px 10px; border-radius: var(--r-sm); background: var(--line-2); }
.quick-item.is-failed { color: var(--bad); background: var(--bad-bg); }
.quick-item form { margin: 0; }
.quick-note { margin: 0; font-size: 13px; color: var(--muted); }

.deal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.deal-layout.has-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.deal-layout > .card { margin-bottom: 0; }
.summary { margin: 0 0 var(--s4); color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.note.warn { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-sm);
  padding: 6px 10px; font-size: 13px; margin-top: var(--s2); }
.deal-main > .note.warn { margin: 0 0 var(--s4); }
.missing-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 8px 12px; margin-bottom: var(--s4);
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r); }
.missing-strip .missing-title { font-size: 13px; font-weight: 600; color: var(--warn); margin-right: 6px; }
.missing-strip .chip { background: var(--surface); margin: 2px 0; }
.fact-sec + .fact-sec { margin-top: var(--s5); }
.sec-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  margin: 0 0 var(--s2); padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); margin: 0; font-size: 14px; }
.dl-grid > div { padding: 7px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.dl-grid dt { font-size: 12.5px; color: var(--muted); }
.dl-grid dd { margin: 0; overflow-wrap: anywhere; }
.sellers { list-style: none; margin: var(--s2) 0 var(--s2); padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2); }
.seller { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px;
  display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.seller a { overflow-wrap: anywhere; }
.seller-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.deal-main > details.disclose.fact-sec { display: block; margin-top: var(--s5); }
.tech { display: block; margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line-2); }
.tech h3 { font-size: 13px; margin: var(--s3) 0 0; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton p { margin: 0 0 4px; }
.sk-line, .sk-head { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2) 0%, var(--line) 50%, var(--line-2) 100%);
  background-size: 200% 100%; animation: sk-move 1.4s linear infinite; }
.sk-head { width: 30%; height: 10px; margin-top: var(--s3); }
@keyframes sk-move { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.docs-side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding: var(--s4); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: 2px; }
.side-head h2 { margin: 0; }
.side-head form { margin: 0; }
.side-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.bar.wide { width: 100%; margin-bottom: var(--s3); }
.side-note { font-size: 13px; color: var(--muted); margin: 0 0 var(--s3); }
.side-note.bad { color: var(--bad); }
.docs-side .group { border-color: var(--line-2); }
@media (max-width: 900px) {
  .deal-layout.has-side { grid-template-columns: minmax(0, 1fr); }
  .docs-side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .stepper { flex-direction: column; gap: var(--s2); }
  .stepper-step + .stepper-step::before { display: none; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .sk-line, .sk-head { animation: none; } }
.events { list-style: none; padding: 0; margin: var(--s3) 0 0; font-size: 13.5px; }
.events li { padding: 4px 0; display: flex; gap: var(--s3); border-top: 1px solid var(--line-2); }
.events li:first-child { border-top: 0; }
.events time { color: var(--muted); flex: none; min-width: 72px; font-variant-numeric: tabular-nums; }
.ev-warn { color: var(--warn); } .ev-error { color: var(--bad); }
pre { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--line-2);
  padding: 10px 12px; border-radius: var(--r-sm); margin: var(--s2) 0 0; }
pre.message { max-height: 420px; overflow: auto; margin-top: 0; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- list rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line-2); }
.rows > li:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .name { font-weight: 550; font-size: 14.5px; overflow-wrap: anywhere; }
.rows .sub { font-size: 13px; color: var(--muted); }
.rows.off .name, .rows > li.off .name { color: var(--muted); }

/* ------------------------------------------------------ service cards */
.service-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.service-head h2 { margin: 0; font-size: 16px; }
.service p.what { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s4); font-size: 14px; margin: var(--s3) 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.copy-line { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.copy-line code { font-size: 13px; padding: 4px 8px; }
.channel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px var(--s3); margin: var(--s2) 0 var(--s3); }

/* ------------------------------------------------------------- phones */
@media (max-width: 900px) {
  .grid, .cols { grid-template-columns: minmax(0, 1fr); }
  .settings { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .subnav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .subnav-title { display: none; }
  .subnav a { padding: 5px 10px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); }
  .subnav a.on { box-shadow: none; border-color: var(--brand); color: var(--brand); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .top-in { padding: 0 var(--s4); gap: var(--s3); height: 52px; }
  .brand { display: none; }
  .nav { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 7px; font-size: 13.5px; }
  .count { padding: 0 5px; }
  .account .team-name { display: none; }
  main { padding: var(--s4) var(--s4) var(--s6); }
  .card { padding: var(--s4); border-radius: var(--r); }
  .page-head { flex-wrap: wrap; margin-bottom: var(--s4); }
  h1 { font-size: 20px; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table.stack-sm td { padding: 2px 0; border: 0; }
  .step-sub { margin-left: 0; }
  .step-row { flex-wrap: wrap; }
}
.narrow h1 { margin-bottom: var(--s3); }
.narrow.prose { max-width: 720px; }
.prose h2 { margin-top: var(--s5); }
.prose ul { padding-left: 20px; margin-bottom: var(--s3); }

/* ------------------------------------------------- slide-over drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100vw); background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 var(--s4) var(--s5); }
.drawer-body h3 { margin-top: var(--s4); }
.drawer-body pre.message { max-height: 40vh; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 49; background: transparent; }
@media (max-width: 640px) {
  .drawer-backdrop { background: rgba(16, 24, 40, .35); }
  body.drawer-open { overflow: hidden; }
}

/* ----------------------------------------------- listening indicator */
.intake > summary.intake-sum { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2);
  padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.intake > summary.intake-sum:hover { background: var(--line-2); }
.intake .spinner { width: 11px; height: 11px; color: var(--info); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b8bfc9; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.live-dot.warn { background: #d18b00; box-shadow: 0 0 0 3px var(--warn-bg); }
.intake-panel { min-width: 260px; }
.intake-ways { list-style: none; margin: 0; padding: 4px 12px; }
.intake-ways li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; overflow-wrap: anywhere; }
.intake-ways .live-dot { position: relative; top: -1px; }
.way-name { font-size: 14px; font-weight: 600; }
.warn-text { color: var(--warn); }
@media (max-width: 640px) {
  .intake .intake-word { display: none; }
  .intake > summary.intake-sum { padding: 8px; }
  .intake-panel { position: fixed; top: 58px; left: var(--s4); right: var(--s4); min-width: 0; max-width: none; }
}

/* ------------------------------------------------ live deals list */
.stage { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--info); white-space: nowrap; }
.stage .spinner { width: 12px; height: 12px; }
@keyframes row-new { from { background: var(--info-bg); } to { background: transparent; } }
.table tbody tr.row-new { animation: row-new 3s ease-out; }

/* ------------------------------------- sign-in, invite and notice pages */
body.signed-out { background: radial-gradient(ellipse 120% 80% at 50% 0%, var(--brand-soft) 0%, var(--bg) 100%) fixed; min-height: 100vh; }
.auth { min-height: calc(100vh - 72px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4);
  padding: var(--s5) 0; }
.signed-in .auth { min-height: 0; padding-top: var(--s7); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: var(--s6) var(--s6) var(--s5); text-align: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: var(--s5); color: var(--ink); }
.auth-brand:hover { text-decoration: none; }
.auth-word { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.logo-mark { flex: none; display: block; }
.auth-title { font-size: 21px; margin-bottom: var(--s2); }
.auth-sub { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0 auto var(--s5); max-width: 320px; }
.auth-meta { color: var(--ink-2); font-size: 14px; margin: 0 0 var(--s5); overflow-wrap: anywhere; }
.auth-msg { color: var(--ink-2); font-size: 14.5px; margin: var(--s3) 0 var(--s5); overflow-wrap: anywhere; }
.auth-hint { color: var(--muted); font-size: 12.5px; margin: var(--s3) 0 0; overflow-wrap: anywhere; }
.auth-card .alert { text-align: left; margin: 0; }
.auth-foot { font-size: 12.5px; }
.auth-foot a { color: var(--muted); }
/* Google's sign-in button (light theme): white, #747775 outline, #1f1f1f text, the "G" at 18px. */
.gsi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 40px; padding: 0 16px; width: 100%;
  max-width: 280px; background: #fff; border: 1px solid #747775; border-radius: 20px; color: #1f1f1f;
  font: 500 14px/20px Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; letter-spacing: .25px;
  transition: background .15s, box-shadow .15s; }
.gsi-btn:hover { text-decoration: none; background: #f8f9fa; box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); }
.gsi-btn:focus-visible { box-shadow: var(--focus); border-radius: 20px; }
.doc-brand { display: flex; width: fit-content; margin: var(--s4) auto 0; }
.doc-brand .auth-word { font-size: 17px; }
.prose { line-height: 1.65; }
.prose p, .prose li { color: var(--ink-2); }
.prose h1 { margin-bottom: var(--s4); }
.prose li + li { margin-top: 6px; }
@media (max-width: 640px) {
  .auth { min-height: calc(100vh - 48px); justify-content: flex-start; padding-top: var(--s6); }
  .auth-card { padding: var(--s5) var(--s4); }
}
.signed-in .auth-card .auth-brand { display: none; }
