/* ──────────────────────────────────────────────────────────────
   Call Tracking · Stripe / Mercury editorial
   Light + dark · iOS Blue accent (tweakable for white-label)
   ────────────────────────────────────────────────────────────── */

:root {
  --accent: #0A84FF;
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --accent-hover: color-mix(in oklab, var(--accent) 88%, black);

  /* Light (warm paper) */
  --bg: #FAFAF7;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F4F2EC;
  --panel: #FFFFFF;
  --ink: #0B0F14;
  --ink-2: #2C333B;
  --ink-3: #5B6370;
  --ink-4: #8A8F98;
  --ink-5: #B5B8BF;
  --line: rgba(12, 15, 20, 0.08);
  --line-2: rgba(12, 15, 20, 0.14);
  --shadow-sm: 0 1px 2px rgba(12,15,20,.04), 0 0 0 .5px rgba(12,15,20,.05);
  --shadow-md: 0 1px 2px rgba(12,15,20,.04), 0 4px 16px rgba(12,15,20,.06), 0 0 0 .5px rgba(12,15,20,.05);
  --shadow-lg: 0 24px 64px -12px rgba(12,15,20,.18), 0 0 0 .5px rgba(12,15,20,.06);

  --good: #0E9F6E;
  --warn: #D97706;
  --bad: #DC2626;
  --info: #0A84FF;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino", ui-serif, Georgia, serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0B0F14;
  --bg-elev: #12171E;
  --bg-sunken: #090C11;
  --panel: #12171E;
  --ink: #ECEEF2;
  --ink-2: #C8CCD4;
  --ink-3: #8A91A0;
  --ink-4: #636B7A;
  --ink-5: #3F4653;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.13);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 0 0 .5px rgba(255,255,255,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4), 0 0 0 .5px rgba(255,255,255,.06);
  --shadow-lg: 0 24px 64px -12px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.06);
  --accent-soft: color-mix(in oklab, var(--accent) 22%, transparent);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.003em;
}

h1,h2,h3,h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

button { font-family: inherit; cursor: default; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ── Layout shell ── */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  transition: grid-template-columns .22s cubic-bezier(.3,.7,.3,1);
}
.app.sidebar-hidden { grid-template-columns: 0 1fr; }
.app.sidebar-hidden .sidebar { overflow: hidden; opacity: 0; pointer-events: none; }

.sidebar {
  background: var(--bg);
  border-right: .5px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  transition: opacity .18s;
  min-width: 0;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

/* Sidebar account switcher */
.ws-switcher {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  position: relative;
}
.ws-switcher:hover { background: var(--panel); }
.ws-avatar {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 70%, #9333EA));
  color: white; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
  letter-spacing: 0;
}
.ws-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ws-name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 11px; color: var(--ink-4); }
.ws-chevron { color: var(--ink-4); flex-shrink: 0; }

/* Nav items */
.nav-section { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6.5px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: default;
  position: relative;
  transition: background .12s;
  white-space: nowrap;
  min-width: 0;
}
.nav-item > span:not(.badge) {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover { background: var(--bg-elev); color: var(--ink); }
.nav-item.active { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-sm); }
.nav-item .ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-3); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .badge {
  margin-left: auto; font-size: 10.5px; color: var(--ink-4);
  background: var(--bg-sunken); padding: 1px 6px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* Sidebar footer: balance + user */
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.balance-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.balance-chip .lbl { font-size: 11px; color: var(--ink-4); }
.balance-chip .val { font-size: 15px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.balance-chip .top { font-size: 11px; color: var(--accent); font-weight: 500; }

/* Topbar */
.topbar {
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: .5px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.topbar .crumb { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.topbar .crumb .cur { color: var(--ink); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  background: var(--bg-elev); border-radius: 8px;
  box-shadow: var(--shadow-sm);
  color: var(--ink-4); font-size: 13px;
  width: 280px;
}
.topbar .search kbd {
  margin-left: auto; font-size: 10.5px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-sunken); color: var(--ink-4);
  font-family: var(--sans); font-weight: 500;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: 0; color: var(--ink-3);
}
.icon-btn:hover { background: var(--bg-elev); color: var(--ink); }

/* Page content */
.page { flex: 1; overflow-y: auto; }
.page-inner { max-width: 1200px; padding: 32px 40px 80px; margin: 0 auto; }
.page-inner.wide { max-width: 1400px; }

/* Typography */
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-4); }
.page-title { font-family: var(--serif); font-size: 40px; line-height: 1.15;
  letter-spacing: -0.015em; color: var(--ink); font-weight: 400; padding-bottom: 2px; }
.page-sub { font-size: 15px; color: var(--ink-3); margin-top: 10px; }
.section-title { font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; }
.section-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* Cards */
.card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: .5px solid var(--line);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: .5px solid var(--line);
}
.card-h h3 { font-size: 14px; font-weight: 500; color: var(--ink); }
.card-h .sub { font-size: 12px; color: var(--ink-4); }
.card-b { padding: 16px 18px; }

/* Buttons */
.btn {
  appearance: none; border: 0; border-radius: 8px;
  padding: 0 14px; height: 34px;
  font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: default;
  transition: background .12s, transform .04s;
}
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 1px 2px rgba(10,132,255,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--panel); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-elev); color: var(--ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 9px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.input, .select {
  appearance: none;
  width: 100%; box-sizing: border-box;
  height: 36px; padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: .5px solid var(--line-2);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; font-family: inherit; line-height: 1.5; }
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%238A8F98' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Badge / pill / status */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--bg-sunken);
  color: var(--ink-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: color-mix(in oklab, var(--good) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); }
.pill.bad  { color: var(--bad);  background: color-mix(in oklab, var(--bad) 12%, transparent); }
.pill.info { color: var(--accent); background: var(--accent-soft); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--ink-4);
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: .5px solid var(--line);
}
.table td {
  padding: 13px 14px;
  border-bottom: .5px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg-sunken); }
.table .num { color: var(--ink); }
.table .muted { color: var(--ink-4); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--radius-lg); overflow: hidden;
  border: .5px solid var(--line);
}
.kpi { padding: 18px 20px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.kpi-lbl { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi-val { font-family: var(--serif); font-size: 34px; font-weight: 400; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-delta { font-size: 12px; color: var(--ink-4); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }

/* Segmented */
.seg { display: inline-flex; padding: 2px; background: var(--bg-elev); border-radius: 8px;
  box-shadow: var(--shadow-sm); position: relative; }
.seg button { appearance: none; border: 0; background: transparent; padding: 0 12px; height: 28px;
  font-size: 12.5px; color: var(--ink-3); font-weight: 500; border-radius: 6px; z-index: 1; position: relative; }
.seg button.on { color: var(--ink); background: var(--panel); box-shadow: var(--shadow-sm); }

/* Divider */
.hr { height: .5px; background: var(--line); border: 0; margin: 0; }

/* Waveform */
.wave { display: flex; align-items: center; gap: 2px; height: 48px; }
.wave span { display: inline-block; width: 3px; border-radius: 2px; background: var(--ink-5); }
.wave span.played { background: var(--accent); }
.wave span.cursor { background: var(--ink); width: 2px; }

/* Transcript */
.tscript { display: flex; flex-direction: column; gap: 14px; }
.tline { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: start; }
.tline .tmeta { font-size: 11px; color: var(--ink-4); padding-top: 2px; font-variant-numeric: tabular-nums; }
.tline .tspk { font-size: 11.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.tline .ttext { font-size: 14px; color: var(--ink-2); line-height: 1.55; cursor: text; }
.tline:hover .ttext { color: var(--ink); }
.tline .ttext mark { background: color-mix(in oklab, var(--accent) 18%, transparent); color: inherit; padding: 0 2px; border-radius: 2px; }

/* Map */
.map-wrap { position: relative; aspect-ratio: 2 / 1; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-sunken); }
.map-dot { position: absolute; border-radius: 50%; background: var(--accent);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent); }

/* Onboarding stages */
.onboarding { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: var(--bg); }
.onboarding-card { width: 100%; max-width: 480px; }
.stepper { display: flex; gap: 6px; margin-bottom: 40px; justify-content: center; }
.stepper span { height: 3px; width: 28px; border-radius: 2px; background: var(--bg-sunken); transition: background .2s; }
.stepper span.done { background: var(--ink); }
.stepper span.on { background: var(--accent); }

/* Sparkline */
.spark { display: block; }

/* Flex helpers */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.g8 { gap: 8px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g24 { gap: 24px; }
.mt8{margin-top:8px} .mt16{margin-top:16px} .mt24{margin-top:24px} .mt32{margin-top:32px} .mt40{margin-top:40px}
.mb8{margin-bottom:8px} .mb16{margin-bottom:16px} .mb24{margin-bottom:24px} .mb40{margin-bottom:40px}

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12,15,20,.4); backdrop-filter: blur(6px); z-index: 50;
  display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 520px; background: var(--panel); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); border: .5px solid var(--line); overflow: hidden; }
.modal-h { padding: 20px 24px 6px; }
.modal-h h2 { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: -0.01em; }
.modal-b { padding: 10px 24px 20px; }
.modal-f { padding: 16px 24px; border-top: .5px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg); }

/* Utility */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Tag input */
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px;
  min-height: 36px; background: var(--bg-elev); border: .5px solid var(--line-2); border-radius: 8px; }
.tag-input .tag { display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }

/* Routing flow canvas */
.flow-canvas {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 20px; border-radius: var(--radius-lg);
  background: var(--bg-sunken);
}
.flow-card {
  background: var(--panel); border: .5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.flow-card:hover { border-color: var(--line-2); }
.flow-card__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.flow-card__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.flow-card__text { flex: 1; min-width: 0; }
.flow-card__title { font-size: 14px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.flow-card__sub { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.flow-card__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.flow-card__body { padding: 0 16px 16px; }

/* Down arrow connector */
.flow-arrow {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 0; color: var(--ink-5); gap: 2px;
}
.flow-arrow__lbl { font-size: 11px; color: var(--ink-4); letter-spacing: .02em; }

/* "Add step" affordance between cards */
.flow-add-wrap { display: flex; justify-content: center; padding: 6px 0; }
.flow-add {
  appearance: none; border: 1px dashed var(--line-2); background: transparent;
  color: var(--ink-3); font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: default; transition: background .12s, color .12s, border-color .12s;
}
.flow-add:hover { background: var(--panel); color: var(--accent); border-color: var(--accent); }

/* Routing type segmented buttons (inside the core card) */
.route-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; background: var(--bg-sunken); border-radius: 10px; }
.route-types__btn {
  appearance: none; border: 0; background: transparent;
  height: 34px; padding: 0 10px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  cursor: default; transition: background .12s, color .12s;
}
.route-types__btn:hover { color: var(--ink-2); }
.route-types__btn.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Ring group rows */
.ring-row {
  display: flex; align-items: center; gap: 10px; flex: 1;
  padding: 0 12px; height: 40px;
  background: var(--bg-elev); border: .5px solid var(--line-2); border-radius: 9px;
  transition: border-color .12s;
}
.ring-row:focus-within { border-color: var(--accent); }
.ring-row__idx {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--bg-sunken); color: var(--ink-3);
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
}

/* IVR editor */
.ivr-grid { display: flex; flex-direction: column; gap: 8px; }
.ivr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--bg-elev);
  border: .5px solid var(--line-2); border-radius: 10px;
  transition: border-color .12s;
}
.ivr-row:focus-within { border-color: var(--accent); }
.ivr-row__key {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--panel); border: .5px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.ivr-row__key input {
  width: 100%; height: 100%; border: 0; outline: 0; background: transparent;
  text-align: center; font-family: var(--mono, monospace);
  font-size: 18px; font-weight: 500; color: var(--ink);
}
.ivr-row__body { flex: 1; display: flex; gap: 8px; min-width: 0; }
.ivr-row__label, .ivr-row__dest {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px;
  border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--ink);
}
.ivr-row__label { font-weight: 500; }
.ivr-row__label::placeholder, .ivr-row__dest::placeholder { color: var(--ink-4); font-weight: 400; }

/* Vanity hero search */
.vanity-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; margin: 0 auto; }
.vanity-search {
  position: relative; display: flex; align-items: center; width: 100%;
  height: 56px; padding: 0 56px 0 52px; border-radius: 14px;
  background: var(--bg-elev); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.vanity-search:focus-within {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
}
.vanity-search__icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none;
}
.vanity-search:focus-within .vanity-search__icon { color: var(--accent); }
.vanity-search input {
  flex: 1; height: 100%; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em;
  color: var(--ink);
}
.vanity-search input::placeholder { color: var(--ink-4); font-family: var(--serif); }
.vanity-search__action {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; color: var(--ink-4);
}
.vanity-prefix { display: flex; gap: 4px; padding: 4px; background: var(--bg-sunken); border-radius: 10px; }
.vanity-prefix__chip {
  appearance: none; border: 0; background: transparent;
  height: 28px; padding: 0 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  cursor: default; transition: background .12s, color .12s;
  font-variant-numeric: tabular-nums;
}
.vanity-prefix__chip:hover { color: var(--ink-2); }
.vanity-prefix__chip.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Toast host (themed alerts) */
.toast-host {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 260px; padding: 12px 14px;
  background: var(--panel); color: var(--ink);
  border: .5px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13px; line-height: 1.45;
  cursor: default;
  animation: toastIn .18s ease-out;
}
.toast__icon {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  display: grid; place-items: center; border-radius: 50%;
}
.toast__msg { flex: 1; min-width: 0; word-wrap: break-word; }
.toast--success { border-color: color-mix(in oklab, #10B981 30%, var(--line)); }
.toast--success .toast__icon { background: color-mix(in oklab, #10B981 18%, transparent); color: #059669; }
.toast--error { border-color: color-mix(in oklab, #DC2626 30%, var(--line)); }
.toast--error .toast__icon { background: color-mix(in oklab, #DC2626 16%, transparent); color: #DC2626; }
.toast--info .toast__icon { background: var(--accent-soft); color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Animation fade */
@keyframes fadeSlide { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ct-spin { to { transform: rotate(360deg); } }
.page-inner { animation: fadeSlide .24s ease-out; }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; }
.bars .bar { flex: 1; background: var(--bg-sunken); border-radius: 4px 4px 0 0; position: relative; min-height: 4px; transition: background .12s; }
.bars .bar:hover { background: color-mix(in oklab, var(--accent) 20%, var(--bg-sunken)); }
.bars .bar .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; background: var(--accent); }
.bars .bar.missed .fill { background: color-mix(in oklab, var(--bad) 70%, var(--bg)); }

/* Subtle scrollbars */
.page::-webkit-scrollbar { width: 10px; height: 10px; }
.page::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--ink-5) 60%, transparent); border-radius: 5px; border: 2px solid var(--bg); background-clip: content-box; }

/* Links */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
