/* Rep console. A quiet, warm-neutral tool: hairlines instead of shadows,
   sentence-case labels, and colour only where it carries meaning (on a call,
   voicemail, hang up, errors). Dark mode follows the system. Text meets WCAG AA. */
:root {
  --bg: #fbfaf9;
  --side: #f5f4f1;
  --hover: #efeeea;
  --text: #1d1c1a;
  --muted: #67635c;
  --line: #e6e3de;
  --line-strong: #d1cdc6;
  --ink: #1d1c1a;
  --on-ink: #ffffff;
  --link: #2b5d88;
  --accent: #3d7a64;
  --green: #1e7a4c;
  --amber: #965800;
  --red: #b3261e;
  --red-solid: #c4352b;
  --disabled-bg: #efeeea;
  --disabled-ink: #9b978f;
  --notice: #faf3e6;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171615;
    --side: #1d1c1a;
    --hover: #262522;
    --text: #ebe9e5;
    --muted: #a9a59e;
    --line: #2d2b28;
    --line-strong: #403d39;
    --ink: #ebe9e5;
    --on-ink: #171615;
    --link: #93b9dc;
    --accent: #7fb39c;
    --green: #6bc795;
    --amber: #e2a55a;
    --red: #f08a80;
    --red-solid: #c4352b;
    --disabled-bg: #24221f;
    --disabled-ink: #716d66;
    --notice: #2a2318;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--link); }
code { font-family: var(--mono); font-size: 0.88em; }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 14px; }
.hint.warn { color: var(--amber); }
.strong { font-weight: 600; }
.error { color: var(--red); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---- controls ---- */
.btn, select, input, textarea { font: inherit; color: var(--text); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover:not(:disabled) { background: var(--ink); opacity: 0.88; }
.btn.hangup:not(:disabled) { background: var(--red-solid); border-color: var(--red-solid); color: #fff; }
.btn.hangup:hover:not(:disabled) { background: var(--red-solid); opacity: 0.9; }
.btn.danger-outline { color: var(--red); }
.btn.block { width: 100%; }
.btn:disabled {
  background: var(--disabled-bg);
  border-color: transparent;
  color: var(--disabled-ink);
  cursor: not-allowed;
}
.textbtn {
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.textbtn:hover { color: var(--text); background: var(--hover); }
.textbtn[aria-pressed="true"] { color: var(--red); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
kbd {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); }
.appbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; font-size: 15px; margin-right: 20px; }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs button {
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 10px;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ink); font-weight: 550; }
.stats { font-size: 14px; color: var(--muted); margin-right: 8px; white-space: nowrap; }
.stats span { color: var(--text); font-variant-numeric: tabular-nums; }
.line-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.line-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.line-btn:disabled { cursor: default; }
.line-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--disabled-ink); }
.line-btn.ready .line-dot { background: var(--green); }
.line-btn.listen .line-dot { background: var(--amber); }
.line-btn.offline:not(:disabled) { color: var(--link); }

/* ---- call bar ---- */
.callbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 transparent;
}
.callbar[data-state="live"] { box-shadow: inset 0 -2px 0 var(--green); }
.callbar[data-state="voicemail"] { box-shadow: inset 0 -2px 0 var(--amber); }
.callbar[data-state="error"] { box-shadow: inset 0 -2px 0 var(--red); }
.callstate { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.state { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.callbar[data-state="live"] .state { color: var(--green); }
.callbar[data-state="voicemail"] .state { color: var(--amber); }
.callbar[data-state="error"] .state { color: var(--red); }
.callbar[data-state="idle"] .state { color: var(--muted); }
.timer { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.timer:empty { display: none; }
.who { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.callmsg { font-size: 14px; color: var(--muted); min-width: 0; }
.callmsg.error { color: var(--red); }
.call-actions { display: flex; gap: 8px; }
.call-actions .btn { height: 40px; padding: 0 18px; font-size: 15px; }
.linemsg { padding: 8px 24px; font-size: 14px; background: var(--notice); color: var(--amber); border-bottom: 1px solid var(--line); }
.linemsg.error { color: var(--red); }
.linemsg.info { color: var(--muted); background: var(--side); }

/* ---- dialer ---- */
.dialer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100vh - 113px);
}
.main-col { padding: 36px 48px 64px; min-width: 0; max-width: 1000px; }
.eyebrow:empty { display: none; }
.eyebrow { font-size: 14px; color: var(--muted); }
.eyebrow.ringing, .eyebrow.dialing { color: var(--text); }
.eyebrow.live { color: var(--green); }
.eyebrow.pulled { color: var(--amber); }
.lead-name { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin-top: 4px; overflow-wrap: anywhere; }
.lead-role { font-size: 17px; color: var(--muted); margin-top: 2px; }
.contact { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 14px; font-size: 15px; color: var(--muted); }
.contact .phone { color: var(--text); font-variant-numeric: tabular-nums; }
.contact span:empty { display: none; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 32px;
  margin: 20px 0 0;
  font-size: 15px;
}
.facts:empty { display: none; }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.lead-notes { margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--line-strong); color: var(--text); white-space: pre-wrap; }
.empty { margin-top: 14px; display: grid; gap: 14px; justify-items: start; color: var(--muted); max-width: 480px; }

.script { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.script-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.script-head h2 { font-size: 16px; font-weight: 650; }
.byline { font-size: 13px; color: var(--muted); }
.opener-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.opener {
  font-size: 19px;
  line-height: 1.5;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  margin-bottom: 20px;
}
.summary { color: var(--muted); margin-bottom: 22px; font-size: 15px; }
.script h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.talk { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 6px; font-size: 16px; }
.talk li::marker { color: var(--muted); }
.script details { border-top: 1px solid var(--line); margin-top: 18px; }
.script summary { cursor: pointer; padding: 12px 0 8px; font-size: 15px; font-weight: 650; }
.script details ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; }
.objections { margin: 0 0 6px; display: grid; gap: 2px; }
.objections dt { font-weight: 550; margin-top: 10px; }
.objections dt:first-child { margin-top: 0; }
.objections dd { margin: 0; color: var(--muted); }

/* ---- side: outcome and up next ---- */
.side {
  background: var(--side);
  border-left: 1px solid var(--line);
  padding: 28px 24px 48px;
  min-width: 0;
}
.side h2 { font-size: 15px; font-weight: 650; margin-bottom: 10px; }
.outcome { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.outcomes { display: grid; gap: 2px; }
.outcomes button {
  font: inherit;
  font-size: 15px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.outcomes button .n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.outcomes button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--hover); }
.outcomes button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.outcomes button[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }
.outcomes button.dnc { color: var(--red); }
.outcomes button.dnc[aria-pressed="true"] { background: var(--red-solid); color: #fff; }
.outcomes button:disabled { color: var(--disabled-ink); cursor: default; }
.outcomes button:disabled .n { color: var(--disabled-ink); }
.notes-label { display: block; font-size: 14px; color: var(--muted); margin: 16px 0 6px; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  padding: 8px 10px;
  font-size: 15px;
}
textarea { resize: vertical; display: block; }
.outcome .btn.block { margin-top: 12px; height: 40px; font-size: 15px; }
.outcome .hint { margin-top: 10px; font-size: 13px; }
.upnext { padding-top: 22px; }
.upcoming { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.upcoming .name { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming .sub { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming li.none { color: var(--muted); font-size: 14px; }
.upnext .hint { margin-top: 16px; font-size: 13px; }

/* ---- other tabs ---- */
.page { max-width: 1180px; padding: 36px 48px 72px; display: grid; gap: 28px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; }
.page-head .hint { margin-top: 6px; max-width: 640px; font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }

/* Call list */
.import-result { font-size: 15px; }
.problems { font-size: 14px; padding: 10px 14px; border-radius: 6px; background: var(--notice); color: var(--amber); }
.problems p { margin-bottom: 4px; }
.problems ul { margin: 0; padding-left: 18px; }
.table-wrap { overflow-x: auto; }
.table-wrap.boxed { border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td select { width: auto; } /* 100% of an auto-width cell squeezes it to nothing */
td.actions { white-space: normal; }
td.actions .textbtn { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.leads tbody tr:hover td { background: var(--side); }
.leads td.name { font-weight: 550; }
.leads td.phone { font-variant-numeric: tabular-nums; }
.leads td.actions { text-align: right; padding-top: 4px; padding-bottom: 4px; }
tr.blocked td { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Setup: what a section is for on the left, its fields on the right */
.setting {
  display: grid;
  grid-template-columns: 260px minmax(0, 560px);
  gap: 16px 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.setting-about h2 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.setting-fields { display: grid; gap: 16px; align-content: start; }
.setting-fields .row { margin-top: 4px; }
.rec-time { font-variant-numeric: tabular-nums; color: var(--red); }
audio { width: 100%; max-width: 420px; }

/* Diagnostics */
.diag-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; }
.diag-block { padding-top: 22px; border-top: 1px solid var(--line); }
.diag-grid .diag-block + .diag-block { margin-top: 28px; }
.diag-block h2 { font-size: 16px; font-weight: 650; margin-bottom: 10px; }
.diag-block > .hint { margin-bottom: 12px; }
.diag-block fieldset { border: 0; padding: 0; margin: 4px 0 14px; display: flex; gap: 20px; flex-wrap: wrap; }
.diag-block legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.diag-block .field { margin-bottom: 12px; }
label.radio { display: inline-flex; align-items: center; gap: 6px; }
label.radio input { width: auto; margin: 0; }
.big { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.02em; }
.big.good { color: var(--green); }
.big.slow { color: var(--amber); }
.big.bad { color: var(--red); }
.big:empty { display: none; }
.big + #headlineLabel { margin-top: 6px; }
#amdLine:empty { display: none; }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; display: grid; font-size: 14px; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline li.pending { color: var(--muted); }
.timeline li .t { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.meter-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); margin-top: 10px; }
.meter-row > span:first-child { width: 70px; }
.meter { flex: 1; height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--green); transition: width 60ms linear; }
.db { width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.recent { list-style: none; padding: 0; margin: 0; font-size: 13px; font-family: var(--mono); color: var(--muted); }
.recent li { padding: 3px 0; }
.recent .fail { color: var(--red); }
pre { font-family: var(--mono); font-size: 12px; max-height: 280px; overflow: auto; white-space: pre-wrap; margin: 8px 0 0; color: var(--muted); }
details summary { cursor: pointer; }
.diag-block details summary { color: var(--muted); margin-top: 14px; font-size: 14px; }

dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); max-width: 460px; width: calc(100% - 32px); padding: 24px; }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog h2 { font-size: 17px; font-weight: 650; margin-bottom: 14px; }
dialog form { margin-top: 20px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.keys dd { margin: 0; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  max-width: calc(100% - 32px);
  z-index: 10;
}
.toast[data-kind="error"] { background: var(--red-solid); color: #fff; }

/* ---- narrower screens ---- */
@media (max-width: 1200px) {
  .dialer { grid-template-columns: minmax(0, 1fr) 300px; }
  .main-col { padding: 28px 32px 56px; }
  .brand { display: none; }
}
@media (max-width: 1080px) {
  .stats { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .setting { grid-template-columns: minmax(0, 1fr); }
  .diag-grid { grid-template-columns: minmax(0, 1fr); }
  .diag-grid > div { margin-top: 28px; }
  .page { padding: 28px 32px 56px; }
}
@media (max-width: 860px) {
  .dialer { grid-template-columns: minmax(0, 1fr); }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .who { display: none; }
}
@media (max-width: 600px) {
  .appbar { padding: 0 12px; overflow-x: auto; }
  .callbar { padding: 10px 16px; }
  .main-col { padding: 20px 16px 40px; }
  .lead-name { font-size: 24px; }
  .opener { font-size: 17px; }
  .page { padding: 20px 16px 40px; }
}

/* ---- sign-in and account pages ---- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.auth-card h1 { font-size: 22px; font-weight: 650; }
.auth-card .brand { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 12px; }

/* ---- who's signed in ---- */
.usermenu { position: relative; }
.usermenu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  display: grid;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  z-index: 20;
}
.usermenu-list p { padding: 6px 8px; color: var(--muted); font-size: 13px; }
.usermenu-list button { text-align: left; }

/* ---- admin-only, badges, banners ---- */
body:not(.is-admin) .admin-only { display: none !important; }
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--red-solid);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 650;
}
.modebanner {
  padding: 6px 24px;
  font-size: 13px;
  background: var(--notice);
  color: var(--amber);
  border-bottom: 1px solid var(--line);
}
.linkbtn { font: inherit; background: none; border: 0; padding: 0 2px; color: var(--link); cursor: pointer; text-decoration: underline; }
.linkbtn.small { font-size: 13px; margin-top: 12px; }
.hint.block, .block { display: block; }
.warn { color: var(--amber); }
.textbtn.danger { color: var(--red); }

/* ---- call bar: a call to us, and the lines of a batch ---- */
.btn.answer:not(:disabled) { background: var(--green); border-color: var(--green); color: #fff; }
.callbar[data-state="incoming"] { box-shadow: inset 0 -2px 0 var(--green); }
.callbar[data-state="incoming"] .state { color: var(--green); }
.lines {
  list-style: none;
  margin: 0;
  padding: 8px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--side);
}
.line { display: inline-flex; gap: 8px; align-items: baseline; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line-strong); font-size: 13px; }
.line .line-name { font-weight: 550; }
.line .line-state { color: var(--muted); }
.line.live { border-color: var(--green); }
.line.live .line-state { color: var(--green); }

/* ---- lead card additions ---- */
.why { margin-top: 12px; font-size: 14px; color: var(--muted); }
.notice {
  margin-top: 24px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--notice);
  font-size: 15px;
}
.notice-label { font-weight: 650; color: var(--amber); margin-right: 6px; }
.calls { margin-top: 16px; font-size: 14px; }
.calls summary { color: var(--muted); }
.calls ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.calls .when { color: var(--muted); margin-right: 10px; font-variant-numeric: tabular-nums; }
.rating { display: inline-flex; gap: 2px; }
.rating .textbtn[aria-pressed="true"] { color: var(--text); background: var(--hover); }

/* ---- live assist ---- */
.assist { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.suggestion { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--accent); margin-bottom: 14px; }
.suggestion-label { font-size: 13px; color: var(--accent); font-weight: 650; margin-bottom: 4px; }
.suggestion-text { font-size: 17px; line-height: 1.45; }
.transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; max-height: 260px; overflow-y: auto; }
.transcript li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.transcript .t-who { color: var(--muted); font-size: 13px; padding-top: 2px; }
.transcript .t-rep .t-who { color: var(--accent); }
.transcript .partial { color: var(--muted); }
.ai-notes { padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 14px; font-size: 14px; }
.ai-notes-label { font-weight: 650; margin-bottom: 4px; }
.ai-notes p + p { white-space: pre-wrap; }
.callback { margin-top: 12px; }

/* ---- call list filters ---- */
.filters input[type="search"] { max-width: 320px; }
.filters select { width: auto; }

/* ---- inbox ---- */
.inbox { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; }
.inbox-item { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item.done { opacity: 0.6; }
.inbox-main { display: grid; gap: 4px; min-width: 0; }
.inbox-actions { display: flex; gap: 8px; flex-shrink: 0; }
.empty-row { padding: 18px 16px; color: var(--muted); }

/* ---- dashboard ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tile.warn .tile-value { color: var(--amber); }
.tile.bad .tile-value { color: var(--red); }
.dash-block { padding-top: 22px; border-top: 1px solid var(--line); }
.dash-block h2 { font-size: 16px; font-weight: 650; margin-bottom: 10px; }
.dash-block > .hint { margin-bottom: 10px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; }
.svgchart { width: 100%; height: auto; max-height: 240px; }
.svgchart .c-dials { fill: var(--line-strong); }
.svgchart .c-conv { fill: var(--accent); }
.svgchart .c-meet { fill: var(--green); }
.svgchart .c-axis { fill: var(--muted); font-size: 11px; }
.svgchart .c-base { stroke: var(--line-strong); }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.legend .k.dials { background: var(--line-strong); }
.legend .k.conv { background: var(--accent); }
.legend .k.meet { background: var(--green); border-radius: 50%; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.bars li { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.bar { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.warn td { color: var(--amber); }
tr.bad td { color: var(--red); }
td.health.good { color: var(--green); }
td.health.watch, td.health.resting { color: var(--amber); }
td.health.poor, td.health.flagged { color: var(--red); }
td.health.off { color: var(--muted); }

/* ---- setup ---- */
.setup-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
.subnav { position: sticky; top: 132px; display: grid; gap: 2px; font-size: 14px; }
.subnav a { color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: 6px; }
.subnav a:hover { background: var(--hover); color: var(--text); }
.setup-sections { display: grid; gap: 28px; min-width: 0; }
.setup-sections .setting { grid-template-columns: 220px minmax(0, 600px); }
.setting-about { scroll-margin-top: 140px; }
.modecard { display: grid; gap: 8px; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--line-strong); justify-items: start; }
.modecard.live { border-color: var(--green); }
.modecard.live .strong { color: var(--green); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
label.check input { width: auto; margin-top: 3px; }
h3.sub { font-size: 14px; font-weight: 650; margin-top: 8px; }
.message { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.message:last-child { border-bottom: 0; }
.script-text { font-size: 15px; padding: 8px 12px; border-left: 3px solid var(--line-strong); margin-top: 6px; }
.files { margin: 0; padding-left: 18px; }
.secret { display: grid; gap: 6px; }
.secret input { max-width: 360px; }
.linkbox { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--side); font-size: 14px; }
table.audit td { white-space: normal; vertical-align: top; }
table.audit td.detail { color: var(--muted); font-size: 13px; max-width: 420px; overflow-wrap: anywhere; }
.setting-fields .row input, .setting-fields .row select { width: auto; flex: 1 1 140px; }

@media (max-width: 1080px) {
  .setup-layout { grid-template-columns: minmax(0, 1fr); }
  .subnav { position: static; display: flex; flex-wrap: wrap; }
  .setup-sections .setting { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .appbar { overflow-x: auto; }
  .tabs button { white-space: nowrap; }
  #shortcutsBtn { display: none; }
}
@media (max-width: 600px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .inbox-item { flex-direction: column; }
  .lines { padding: 8px 16px; }
  .modebanner { padding: 6px 16px; }
}
