:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #14171c;
  --text-2: #4b5260;
  --text-3: #7a8190;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fc;
  --accent-text: #1c5cab;
  --good: #1a8a4a; --good-soft: #e3f4ea;
  --warn: #b26b00; --warn-soft: #fdf1dc;
  --bad: #c93636; --bad-soft: #fbe7e7;
  --violet: #6250d6; --violet-soft: #ece9fb;
  --teal: #0f8a80; --teal-soft: #dff3f1;
  --orange: #d35a20; --orange-soft: #fdeadf;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --grid: #e8eaee;
  --side-bg: #101828; --side-text: #c7cdd8; --side-muted: #8a93a6; --side-active: #1d2a44; --side-accent: #7fb2ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --radius: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116; --surface: #161a21; --surface-2: #1b2029; --surface-3: #222833; --border: #2a303b; --border-strong: #3a4250;
    --text: #eef0f3; --text-2: #b7bdc8; --text-3: #8890a0; --accent: #3987e5; --accent-soft: #1a2b45; --accent-text: #8ab8f5;
    --good: #3cbf73; --good-soft: #15291e; --warn: #e2a33a; --warn-soft: #2d2412; --bad: #ef6b6b; --bad-soft: #321a1a;
    --violet: #9085e9; --violet-soft: #241f3d; --teal: #3cc3b6; --teal-soft: #132c2a; --orange: #f08a55; --orange-soft: #33201a;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #262c36;
    --side-bg: #0a0d12; --side-active: #18202e; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116; --surface: #161a21; --surface-2: #1b2029; --surface-3: #222833; --border: #2a303b; --border-strong: #3a4250;
  --text: #eef0f3; --text-2: #b7bdc8; --text-3: #8890a0; --accent: #3987e5; --accent-soft: #1a2b45; --accent-text: #8ab8f5;
  --good: #3cbf73; --good-soft: #15291e; --warn: #e2a33a; --warn-soft: #2d2412; --bad: #ef6b6b; --bad-soft: #321a1a;
  --violet: #9085e9; --violet-soft: #241f3d; --teal: #3cc3b6; --teal-soft: #132c2a; --orange: #f08a55; --orange-soft: #33201a;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #262c36;
  --side-bg: #0a0d12; --side-active: #18202e; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #3987e5, #6250d6); display: grid; place-items: center; color: #fff; flex: none; }
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--side-muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--side-active); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--side-accent); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: #2a78d6; color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 7px; }
.nav .count.alert { background: #e5603a; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid #1f2937; font-size: 12px; color: var(--side-muted); display: flex; flex-direction: column; gap: 8px; }
.side-foot button { background: none; border: 0; color: var(--side-muted); padding: 0; cursor: pointer; font: inherit; text-align: left; }
.side-foot button:hover { color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }
.dot.on { background: #3cbf73; } .dot.off { background: #ef6b6b; } .dot.warn { background: #e2a33a; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 0; }
.page { padding: 18px 28px 48px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.mobile-bar { display: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head .sub { color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.grid.split-r { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }

/* ---------- stat tiles ---------- */
.tile { padding: 14px 16px; }
.tile .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tile.hero .value { font-size: 40px; }
a.tile { display: block; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--border-strong); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.success { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 30px; height: 30px; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], select, textarea {
  width: 100%; height: 34px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 13.5px var(--font);
}
textarea { height: auto; min-height: 90px; line-height: 1.55; resize: vertical; padding: 9px 11px; }
textarea.mail { min-height: 360px; font-family: var(--font); font-size: 13.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
select { padding-right: 28px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
label.field .help { font-weight: 400; color: var(--text-3); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; cursor: pointer; transition: .15s; }
.toggle span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font: 500 13px var(--font); color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; background: currentColor; }
.b-pending { background: var(--surface-3); color: var(--text-2); }
.b-queued { background: var(--violet-soft); color: var(--violet); }
.b-approached { background: var(--accent-soft); color: var(--accent-text); }
.b-responded { background: var(--orange-soft); color: var(--orange); }
.b-awaiting { background: var(--warn-soft); color: var(--warn); }
.b-in_progress { background: var(--violet-soft); color: var(--violet); }
.b-success { background: var(--good-soft); color: var(--good); }
.b-done { background: var(--teal-soft); color: var(--teal); }
.b-declined, .b-rejected { background: var(--surface-3); color: var(--text-3); }
.b-bounced { background: var(--bad-soft); color: var(--bad); }
.b-good { background: var(--good-soft); color: var(--good); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--accent-soft); color: var(--accent-text); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.rank { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 650; }
.rank.mv { background: var(--teal-soft); color: var(--teal); }
.pct { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 24px; padding: 0 7px; border-radius: 6px; font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pct.hi { background: var(--good-soft); color: var(--good); }
.pct.mid { background: var(--warn-soft); color: var(--warn); }
.pct.lo { background: var(--surface-3); color: var(--text-2); }

/* ---------- meter ---------- */
.meter { height: 6px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; min-width: 60px; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.meter.warn { background: var(--warn-soft); } .meter.warn > i { background: var(--warn); }
.meter.bad { background: var(--bad-soft); } .meter.bad > i { background: var(--bad); }
.meter.good { background: var(--good-soft); } .meter.good > i { background: var(--good); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 550; font-size: 12px; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.clickable { cursor: pointer; }
table.t tr.sel td { background: var(--accent-soft) !important; }
table.t td.chk, table.t th.chk { width: 36px; padding-right: 0; }
table.t .biz { display: flex; align-items: center; gap: 10px; min-width: 220px; }
table.t .biz img { width: 20px; height: 20px; border-radius: 4px; flex: none; background: var(--surface-3); }
table.t .biz-name { font-weight: 600; color: var(--text); }
table.t .unread .biz-name::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-left: 6px; vertical-align: middle; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.filters select, .filters input { width: auto; min-width: 120px; height: 32px; font-size: 13px; }
.filters input[type=search] { min-width: 220px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
ul.clean { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; }
.feature-grid .yes { color: var(--good); } .feature-grid .no { color: var(--text-3); }
.signal { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.signal:last-child { border-bottom: 0; }
.signal .pts { flex: none; width: 34px; text-align: right; font-weight: 650; color: var(--bad); font-variant-numeric: tabular-nums; }
.signal .pts.minus { color: var(--good); }

/* ---------- gauges ---------- */
.gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gauge { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.gauge .g-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.gauge .g-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.gauge .g-val small { font-size: 15px; font-weight: 600; color: var(--text-3); }

/* ---------- conversation ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 92%; }
.msg.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.in { align-self: flex-start; }
.msg.bounce { background: var(--bad-soft); border-color: transparent; }
.msg-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 9px 13px 0; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.msg-subj { padding: 4px 13px 0; font-weight: 600; font-size: 13.5px; }
.msg-body { padding: 6px 13px 12px; white-space: pre-wrap; font-size: 13.5px; overflow-wrap: anywhere; }
.msg-body.clamp { max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); cursor: pointer; }
.ai-box { border: 1px solid var(--border); border-left: 3px solid var(--violet); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); font-size: 13px; }
.callout { border-radius: 9px; padding: 11px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.callout.info { background: var(--accent-soft); color: var(--accent-text); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.good { background: var(--good-soft); color: var(--good); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.callout b { color: inherit; }

/* ---------- screenshot ---------- */
.shot { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-3); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot .shot-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12.5px; }
.frame-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 70vh; background: #fff; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 10px; font-size: 12.5px; padding: 6px 0; }
.tl .when { color: var(--text-3); flex: none; width: 92px; }
.tl .what { color: var(--text-2); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 54px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.hbar .track { height: 18px; position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel .fill { background: var(--series-1); }
.tooltip { position: fixed; z-index: 1000; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-lg); max-width: 280px; white-space: pre-line; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 500; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { width: min(1100px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: pop .18s ease-out; }
.toast.error { background: var(--bad); color: #fff; }
.toast.success { background: var(--good); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.empty h3 { color: var(--text-2); margin-bottom: 6px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px; display: grid; place-items: center; }
.progress { height: 8px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
pre.log { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 300px; overflow: auto; font: 12px/1.5 var(--mono); white-space: pre-wrap; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font: 12px var(--mono); border: 1px solid var(--border); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; background: var(--surface-3); color: var(--text-3); }
.checklist .tick.done { background: var(--good-soft); color: var(--good); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.preview-mail { white-space: pre-wrap; font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-wrap: anywhere; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, rgba(57,135,229,.18), transparent), var(--bg); }
.auth .card { width: min(400px, 100%); padding: 28px; }
.auth h1 { margin: 14px 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.c4, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split, .grid.split-r, .grid.c3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 400; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--side-bg); color: #fff; position: sticky; top: 0; z-index: 300; }
  .mobile-bar button { background: none; border: 0; color: #fff; padding: 4px; }
  .page { padding: 16px 16px 40px; }
  .grid.c2, .form-grid, .gauges, .feature-grid { grid-template-columns: 1fr; }
  .grid.c4, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 110px 1fr; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  .hbar { grid-template-columns: 100px 1fr 44px; }
}
