:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #15171b;
  --ink-2: #3a3e45;
  --muted: #6d717a;
  --faint: #a3a7ae;
  --line: #e6e3dc;
  --line-2: #efede8;
  --accent: #f0542b;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee8;
  --accent-line: #f7c9b9;
  --good: #188a5d;
  --good-soft: #e3f4ec;
  --warn: #b97800;
  --warn-soft: #fbf1dc;
  --bad: #cf3f37;
  --bad-soft: #fbe7e5;
  --info: #3461d1;
  --info-soft: #e7edfb;
  --chart-1: #f0542b;
  --chart-2: #15171b;
  --chart-3: #c9c4b8;
  --shadow: 0 1px 2px rgba(20, 20, 18, .04), 0 4px 16px rgba(20, 20, 18, .05);
  --shadow-lg: 0 10px 40px rgba(20, 20, 18, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d0f;
    --surface: #141518;
    --surface-2: #181a1d;
    --ink: #eceef1;
    --ink-2: #c5c8ce;
    --muted: #8d929b;
    --faint: #5d626b;
    --line: #25282d;
    --line-2: #1e2024;
    --accent: #ff6a40;
    --accent-ink: #160a06;
    --accent-soft: rgba(255, 106, 64, .12);
    --accent-line: rgba(255, 106, 64, .35);
    --good: #3ccf8e;
    --good-soft: rgba(60, 207, 142, .12);
    --warn: #f0b440;
    --warn-soft: rgba(240, 180, 64, .12);
    --bad: #ff6b62;
    --bad-soft: rgba(255, 107, 98, .12);
    --info: #7d9cff;
    --info-soft: rgba(125, 156, 255, .12);
    --chart-1: #ff6a40;
    --chart-2: #eceef1;
    --chart-3: #3a3d43;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0d0f; --surface: #141518; --surface-2: #181a1d; --ink: #eceef1; --ink-2: #c5c8ce; --muted: #8d929b;
  --faint: #5d626b; --line: #25282d; --line-2: #1e2024; --accent: #ff6a40; --accent-ink: #160a06;
  --accent-soft: rgba(255, 106, 64, .12); --accent-line: rgba(255, 106, 64, .35); --good: #3ccf8e;
  --good-soft: rgba(60, 207, 142, .12); --warn: #f0b440; --warn-soft: rgba(240, 180, 64, .12); --bad: #ff6b62;
  --bad-soft: rgba(255, 107, 98, .12); --info: #7d9cff; --info-soft: rgba(125, 156, 255, .12);
  --chart-1: #ff6a40; --chart-2: #eceef1; --chart-3: #3a3d43;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
svg.i { width: 16px; height: 16px; flex: none; }
svg.i14 { width: 14px; height: 14px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid var(--line); background: var(--surface-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--ink); flex: none; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a.active svg { color: var(--accent); }
.nav .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent);
  color: var(--accent-ink); font-size: 11px; font-weight: 650; display: grid; place-items: center;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.side-card { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; font-size: 12px; }
.side-card b { display: block; font-size: 12px; margin-bottom: 4px; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.user { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid;
  place-items: center; font-weight: 650; font-size: 12px; flex: none;
}
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { color: var(--ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.content { padding: 8px 32px 64px; max-width: 1360px; width: 100%; }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-h h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-h .spacer { flex: 1; }
.card-b { padding: 14px 18px 18px; }
.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 550; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--line-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px;
  font-weight: 550; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

.input, .textarea, select.input {
  width: 100%; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { height: auto; padding: 12px 14px; line-height: 1.6; resize: vertical; min-height: 180px; }
.search { position: relative; width: 280px; }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--faint); }
.search .input { padding-left: 34px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px;
}
.chip b { font-weight: 600; color: var(--muted); font-size: 12px; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.on b { color: var(--surface); opacity: .7; }

.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--line-2); gap: 2px; }
.tabs button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- overview ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.hello h2 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.hello p { margin: 4px 0 0; color: var(--muted); }

.status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.status .card { padding: 14px 16px; display: flex; gap: 12px; align-items: center; text-decoration: none; }
.status .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-2); }
.status .ic svg { width: 19px; height: 19px; }
.status .ic.accent { background: var(--accent-soft); color: var(--accent); }
.status .ic.good { background: var(--good-soft); color: var(--good); }
.status .ic.warn { background: var(--warn-soft); color: var(--warn); }
.status .ic.bad { background: var(--bad-soft); color: var(--bad); }
.status .k { font-size: 12px; color: var(--muted); }
.status .v { font-size: 16px; font-weight: 600; }
a.card:hover { border-color: var(--faint); }

.kpi { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 4px; min-height: 128px; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 30px; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d .up { color: var(--good); font-weight: 600; }
.kpi .d .down { color: var(--bad); font-weight: 600; }
.kpi .spark { margin-top: auto; height: 30px; }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line-2); }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart-wrap { position: relative; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: 7px 10px; border-radius: 8px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; z-index: 3;
}
.tip b { display: block; font-weight: 600; margin-bottom: 1px; }

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel .f { display: grid; grid-template-columns: 112px 1fr 64px; gap: 12px; align-items: center; font-size: 13px; }
.funnel .bar { height: 26px; background: var(--line-2); border-radius: 7px; overflow: hidden; position: relative; }
.funnel .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 7px; transition: width .7s cubic-bezier(.2, .7, .2, 1); }
.funnel .bar span { position: absolute; left: 10px; top: 4px; font-size: 12px; font-weight: 600; color: var(--accent-ink); mix-blend-mode: normal; }
.funnel .bar.low span { color: var(--ink); left: auto; right: 10px; }
.funnel .pct { text-align: right; color: var(--muted); font-size: 12px; }

.feed { display: flex; flex-direction: column; }
.feed .e { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.feed .e:first-child { border-top: 0; }
.feed .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.feed .dot svg { width: 15px; height: 15px; }
.feed .dot.replied, .feed .dot.paid { background: var(--accent-soft); color: var(--accent); }
.feed .dot.demo_viewed, .feed .dot.clicked { background: var(--info-soft); color: var(--info); }
.feed .dot.bounced, .feed .dot.complained, .feed .dot.opt_out { background: var(--bad-soft); color: var(--bad); }
.feed .t { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .t b { font-weight: 600; }
.feed .when { font-size: 12px; color: var(--faint); white-space: nowrap; }

.pipeline-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--line-2); }
.pipeline-bar i { display: block; height: 100%; }
.pipeline-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 14px; font-size: 13px; }
.pipeline-legend div { display: flex; align-items: center; gap: 8px; }
.pipeline-legend i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.pipeline-legend b { margin-left: auto; font-weight: 600; }

/* ---------- replies ---------- */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 14px; align-items: start; }
.inbox-list { overflow: hidden; }
.inbox-list .head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.msg {
  display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: transparent;
  padding: 14px 16px; cursor: pointer; position: relative;
}
.msg:hover { background: var(--surface-2); }
.msg.on { background: var(--accent-soft); }
.msg.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.msg .top { display: flex; align-items: center; gap: 8px; }
.msg .who { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .when { font-size: 12px; color: var(--faint); }
.msg .snip { margin-top: 3px; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg .meta { margin-top: 8px; display: flex; gap: 6px; }

.thread { padding: 0; }
.thread .head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.thread .head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.thread .head .facts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 13px; }
.thread .head .facts > span { display: inline-flex; gap: 5px; align-items: center; }
.thread .head .facts a { color: var(--muted); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.thread .head .facts a:hover { color: var(--accent); }
.thread .head .facts svg { width: 14px; height: 14px; }
.convo { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; max-height: 46vh; overflow: auto; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.bubble.them { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { margin-left: auto; background: var(--ink); color: var(--surface); border-bottom-right-radius: 4px; }
.bubble .by { display: block; font-size: 11.5px; margin-bottom: 4px; opacity: .65; }
.compose { padding: 18px 22px 20px; }
.compose .label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.compose .label .spacer { flex: 1; }
.compose .warn { color: var(--bad); font-size: 12.5px; margin-top: 6px; }
.compose .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.compose .actions .spacer { flex: 1; }
.compose .foot { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; font-size: 12px; font-weight: 550; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface-2); position: sticky; top: 0;
}
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { cursor: pointer; transition: background .1s; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }
.biz { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.mono-av {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 650; font-size: 13px;
  background: var(--line-2); color: var(--ink-2); flex: none;
}
.biz .n { font-weight: 600; }
.biz .c { font-size: 12px; color: var(--muted); }
.icon-link { color: var(--muted); display: inline-flex; }
.icon-link:hover { color: var(--accent); }
.icon-link svg { width: 16px; height: 16px; }

/* ---------- demos ---------- */
.demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.demo { overflow: hidden; display: flex; flex-direction: column; }
.demo .art { height: 128px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.demo .art svg { width: 100%; height: 100%; }
.demo .art .mono-av { position: absolute; left: 16px; bottom: -14px; width: 44px; height: 44px; border-radius: 12px; font-size: 17px; box-shadow: var(--shadow); background: var(--surface); }
.demo .body { padding: 22px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.demo .n { font-weight: 650; font-size: 15px; }
.demo .c { font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.countdown { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.countdown .meter { flex: 1; margin: 0; }
.countdown .meter i { background: var(--good); }
.countdown.soon .meter i { background: var(--warn); }
.countdown.gone .meter i { background: var(--faint); }
.demo .foot { display: flex; align-items: center; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.demo .foot .btn { padding: 0 9px; gap: 5px; }
.demo .foot .btn svg { width: 14px; height: 14px; }
.demo[data-id] { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.demo[data-id]:hover { border-color: var(--faint); box-shadow: var(--shadow); }
.demo[data-id]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dtools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 6px 0 18px; }
.dtools .chips { flex: 1; min-width: 0; }
.dsel { gap: 8px; }
.dsel select.input { height: 34px; width: auto; min-width: 150px; padding-right: 28px; }
.dgroup + .dgroup { margin-top: 28px; }
.dgroup-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.dgroup-h h2 { margin: 0; font-size: 15px; font-weight: 650; }
.dgroup-h h2 .num { color: var(--muted); font-weight: 550; margin-left: 4px; }
.dgroup-h .muted { font-size: 12.5px; }

/* ---------- drawer, modal, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 12, .32); z-index: 30; opacity: 0; animation: fade .18s forwards; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 31;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(24px); opacity: 0;
  animation: slide .22s cubic-bezier(.2, .7, .2, 1) forwards;
}
.drawer .dh { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .dh h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.drawer .db { padding: 20px 22px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.drawer .df { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.facts-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13.5px; }
.facts-grid dt { color: var(--muted); }
.facts-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline .ev { position: relative; padding: 0 0 16px; }
.timeline .ev::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--faint); }
.timeline .ev.hot::before { border-color: var(--accent); background: var(--accent); }
.timeline .ev .w { font-size: 12px; color: var(--faint); }
.timeline .ev .q { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); white-space: pre-wrap; font-size: 13px; }

.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%); width: min(440px, calc(100vw - 32px)); z-index: 41;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); opacity: 0; animation: pop .2s forwards;
}
.modal .mh { padding: 20px 22px 6px; }
.modal .mh h3 { margin: 0; font-size: 17px; }
.modal .mb { padding: 10px 22px; display: flex; flex-direction: column; gap: 12px; }
.modal .mf { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: up .2s; }
.toast.bad { background: var(--bad); color: #fff; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 120px; height: 88px; }
.empty h3 { margin: 4px 0 0; color: var(--ink); font-size: 15px; font-weight: 600; }
.empty p { margin: 0; max-width: 360px; font-size: 13.5px; }

.skeleton { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin .art { background: var(--ink); color: var(--surface); position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.signin .art svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.signin .art .brand { position: relative; }
.signin .art .brand-mark { color: #2a2d33; }
.signin .art .brand-mark rect:last-child { fill: #ffffff; }
.signin .art .brand-name { color: var(--surface); }
.signin .art blockquote { position: relative; margin: 0; font-size: 28px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; max-width: 460px; }
.signin .art blockquote span { color: var(--accent); }
.signin .panel { display: grid; place-items: center; padding: 32px 16px; }
.signin .box { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; }
.signin h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.signin p { margin: 0; color: var(--muted); }
.signin .btn { height: 44px; justify-content: center; font-size: 15px; }

@keyframes fade { to { opacity: 1; } }
@keyframes slide { to { transform: none; opacity: 1; } }
@keyframes pop { to { transform: translate(-50%, -50%); opacity: 1; } }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g-4, .status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px;
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  }
  .sidebar .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 4px; position: relative; }
  .nav a.active { box-shadow: none; background: transparent; }
  .nav .count { position: absolute; top: 0; right: 4px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
  .topbar { padding: 14px 16px; }
  .content { padding: 4px 16px 96px; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox.detail .inbox-list { display: none; }
  .inbox:not(.detail) .thread-card { display: none; }
  .search { width: 100%; }
  .dsel { width: 100%; }
  .dsel select.input { flex: 1; min-width: 0; }
  .signin { grid-template-columns: 1fr; }
  .signin .art { min-height: 240px; padding: 28px; }
  .signin .art blockquote { font-size: 22px; }
  .hello h2 { font-size: 22px; }
  .kpi .v { font-size: 26px; }
}
@media (max-width: 520px) {
  .g-4, .status { grid-template-columns: 1fr 1fr; gap: 10px; }
  .status .card { padding: 12px; }
  .status .ic { display: none; }
  .funnel .f { grid-template-columns: 86px 1fr 44px; }
  .facts-grid { grid-template-columns: 100px 1fr; }
}
