/* Email Outreach — data-dense dashboard.
   Palette: the original teal on warm paper. Fira Sans / Fira Code. Light + dark. */
:root {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f1efea; --surface-3: #e7e3da;
  --border: #e4e1da; --border-strong: #d3cfc4;
  --text: #1d1b18; --muted: #6b665d; --faint: #9a948a;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #d7efec; --accent-text: #0f766e; --accent-2: #14b8a6;
  --cta: #b45309; --cta-soft: #fef3c7;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --err: #b91c1c; --err-soft: #fee2e2;
  --link: #1d4ed8;
  --shadow-sm: 0 1px 2px rgba(20, 16, 10, .06);
  --shadow: 0 1px 2px rgba(20, 16, 10, .06), 0 4px 16px rgba(20, 16, 10, .05);
  --shadow-lg: 0 10px 40px rgba(20, 16, 10, .18);
  --radius: 10px; --radius-lg: 14px;
  --sans: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 244px; --top-h: 56px;
  /* charts: categorical slots 1–2 and status colours (validated reference palette) */
  --series-1: #2a78d6; --series-2: #eb6834; --good: #0ca30c; --critical: #d03b3b; --grid: #e9e6df;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #141311; --surface: #1c1b18; --surface-2: #25231f; --surface-3: #312e29;
    --border: #34312b; --border-strong: #454037;
    --text: #efece6; --muted: #a8a197; --faint: #7a746a;
    --accent: #2dd4bf; --accent-ink: #062b27; --accent-soft: #11332f; --accent-text: #5eead4; --accent-2: #5eead4;
    --cta: #fbbf24; --cta-soft: #3a2c0c;
    --ok: #4ade80; --ok-soft: #143222; --warn: #fbbf24; --warn-soft: #3a2c0c; --err: #f87171; --err-soft: #3b1515;
    --link: #93b4ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
    --series-1: #3987e5; --series-2: #d95926; --good: #4ade80; --critical: #f87171; --grid: #2c2a26;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1c1b18; --surface-2: #25231f; --surface-3: #312e29;
  --border: #34312b; --border-strong: #454037;
  --text: #efece6; --muted: #a8a197; --faint: #7a746a;
  --accent: #2dd4bf; --accent-ink: #062b27; --accent-soft: #11332f; --accent-text: #5eead4; --accent-2: #5eead4;
  --cta: #fbbf24; --cta-soft: #3a2c0c;
  --ok: #4ade80; --ok-soft: #143222; --warn: #fbbf24; --warn-soft: #3a2c0c; --err: #f87171; --err-soft: #3b1515;
  --link: #93b4ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .55);
  --series-1: #3987e5; --series-2: #d95926; --good: #4ade80; --critical: #f87171; --grid: #2c2a26;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::placeholder { color: var(--faint); opacity: 1; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { letter-spacing: -.015em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--text); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 1200; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; font-weight: 650; font-size: 15px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.side .brand small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); font-weight: 650; padding: 14px 8px 5px; }
.nav button { width: 100%; border: 0; background: none; text-align: left; padding: 7px 9px; border-radius: 8px; color: var(--muted);
  font-weight: 550; font-size: 13.5px; display: flex; align-items: center; gap: 9px; transition: background .15s, color .15s; }
.nav button svg { flex: none; opacity: .85; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.nav button.on svg { opacity: 1; }
.nav .count { margin-left: auto; background: var(--err); color: #fff; border-radius: 20px; font-size: 11px; font-weight: 700; padding: 1px 6px; min-width: 19px; text-align: center; }
.sidefoot { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.master { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; background: var(--surface-2); border-radius: 9px; padding: 9px 11px; cursor: pointer; }
.master .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.master .switch { margin-left: auto; }
.master.off { color: var(--err); background: var(--err-soft); }
.master.off .dot { background: var(--err); box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }

.mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 8px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(8px); border-bottom: 1px solid var(--border); }
.top .spacer { flex: 1; }
.top .iconbtn { border: 1px solid transparent; background: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); position: relative; transition: background .15s, color .15s; }
.top .iconbtn:hover { background: var(--surface-2); color: var(--text); }
.top .iconbtn.has { color: var(--err); }
.top .iconbtn .count { position: absolute; top: 2px; right: 2px; background: var(--err); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 1; border-radius: 10px; padding: 2px 4px; }
.kbd { display: inline-flex; gap: 2px; font-family: var(--mono); font-size: 11px; color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.jump { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  border-radius: 9px; padding: 6px 9px; font-size: 13px; min-width: 210px; transition: border-color .15s; }
.jump:hover { border-color: var(--border-strong); }
.jump .kbd { margin-left: auto; }
.top .menubtn { display: none; }
.sidebd { display: none; }

main { padding: 22px 26px 72px; max-width: 1440px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--border-strong); background: var(--surface); padding: 7px 12px; border-radius: 9px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); background: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.small { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.link { border: 0; background: none; color: var(--link); padding: 2px 4px; box-shadow: none; }
.btn.link:hover { background: none; text-decoration: underline; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.pagehead h1 { font-size: 23px; margin: 0; letter-spacing: -.025em; }
.pagehead p { margin: 3px 0 0; color: var(--muted); max-width: 84ch; }
.pagehead .spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.num, .mono, td.num, th.num { font-variant-numeric: tabular-nums; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid transparent; border-radius: 11px; padding: 11px 13px; transition: border-color .15s; }
.stat:hover { border-color: var(--border-strong); }
/* only the tile's own <b> is the big number — the detail line lives inside the label <span> */
.stat > b { display: block; font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.18; }
.stat > b small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.stat span b { font-size: 12.5px; font-weight: 650; color: var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ---------- pills (status names double as class names) ---------- */
.pill { font-size: 11px; font-weight: 650; border-radius: 6px; padding: 2px 7px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-3); color: var(--muted); letter-spacing: .01em; }
.pill.ok, .pill.active, .pill.valid, .pill.inbox, .pill.pass, .pill.reply, .pill.done, .pill.completed { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.paused, .pill.risky, .pill.auto, .pill.queued, .pill.unknown { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.invalid, .pill.spam, .pill.fail, .pill.bounced, .pill.bounce, .pill.error, .pill.unsubscribed, .pill.unsubscribe, .pill.missing, .pill.softfail { background: var(--err-soft); color: var(--err); }
.pill.draft, .pill.stopped, .pill.unchecked { background: var(--surface-3); color: var(--muted); }
.pill.running, .pill.replied { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- alerts ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid transparent; }
.alert.error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert .ico { font-weight: 700; width: 16px; flex: none; text-align: center; }
.alert .ico svg { vertical-align: -2px; }
.alert .go { margin-left: auto; white-space: nowrap; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 650; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); padding: 9px 10px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: top; }
tbody tr:hover td, table tr:hover td { background: var(--surface-2); }
td small { color: var(--muted); display: block; }
td.num, th.num { text-align: right; }
.empty { color: var(--muted); padding: 30px 20px; text-align: center; }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; font-weight: 650; }

/* ---------- mailbox cards ---------- */
.mbcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.mb .head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.mb .head b { font-size: 15px; display: block; word-break: break-all; }
.mb .head small { color: var(--muted); }
.mb .head .spacer { flex: 1; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 12px; }
.meter .lbl { font-weight: 600; font-size: 13px; }
.meter .val { font-variant-numeric: tabular-nums; font-size: 13px; }
.meter .sub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width .3s; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kv div { background: var(--surface-2); border-radius: 9px; padding: 7px 9px; }
.kv b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.kv span { font-size: 11.5px; color: var(--muted); }
.mb .err { background: var(--err-soft); color: var(--err); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 10px; word-break: break-word; }
.mb .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.charttip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px; padding: 6px 9px; border-radius: 7px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow); }
.charttip b { display: block; }
.hit { fill: transparent; cursor: default; }
.hit:hover + g rect, .barcol:hover rect { opacity: .85; }

/* ---------- deliverability checks ---------- */
.check { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.check:first-child { border-top: 0; }
.check .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.check.ok .ic { background: var(--ok-soft); color: var(--ok); }
.check.warn .ic, .check.unknown .ic { background: var(--warn-soft); color: var(--warn); }
.check.bad .ic { background: var(--err-soft); color: var(--err); }
.check b { font-weight: 600; }
.check .det { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.fix { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.fix code { flex: 1; white-space: pre-wrap; word-break: break-all; }
.tips { margin: 0; padding-left: 18px; }
.tips li { margin: 5px 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field > label { font-weight: 600; display: block; margin-bottom: 3px; font-size: 13px; }
.field > small { color: var(--muted); display: block; margin-bottom: 5px; font-size: 12px; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .inp {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check-row input { margin-top: 3px; accent-color: var(--accent); }
.check-row small { display: block; color: var(--muted); font-size: 12px; }
details.adv > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 20px; padding: 4px 10px; cursor: pointer; user-select: none; background: var(--surface); font-size: 13px; transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip input { display: none; }
.chip:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.varchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.varchips button { font-family: var(--mono); font-size: 11.5px; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: 6px; padding: 2px 6px; }
.varchips button:hover { border-color: var(--accent); color: var(--accent-text); }
.logoprev { min-width: 118px; height: 48px; padding: 5px 9px; border: 1px dashed var(--border-strong); border-radius: 9px;
  background: var(--surface-2); display: grid; place-items: center; }
.logoprev img { max-height: 38px; max-width: 220px; display: block; }
.switch { position: relative; width: 36px; height: 21px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--border-strong); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg { font-size: 12.5px; margin-top: 6px; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--err); }

/* ---------- campaign editor ---------- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 16px; flex-wrap: wrap; }
.subtabs button { border: 0; background: none; padding: 8px 12px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.subtabs button:hover { color: var(--text); }
.subtabs button.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.step { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.step .stephead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.step .stephead b { font-size: 14px; }
.step .stephead .spacer { flex: 1; }
.step textarea { min-height: 170px; font-size: 13.5px; }
.wait { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 4px; }
.wait input { width: 64px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.score { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.score .num { font-weight: 700; font-size: 15px; border-radius: 8px; padding: 3px 8px; }
.score .num.good { background: var(--ok-soft); color: var(--ok); }
.score .num.ok { background: var(--warn-soft); color: var(--warn); }
.score .num.poor { background: var(--err-soft); color: var(--err); }
.score ul { margin: 0; padding-left: 16px; color: var(--muted); }
.score li.bad { color: var(--err); }
.score li.warn { color: var(--warn); }
.preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview .hdr { background: var(--surface-2); padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.preview .hdr div { display: flex; gap: 8px; }
.preview .hdr span { color: var(--muted); width: 60px; flex: none; }
.preview .bd { padding: 16px 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.campcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.campcard { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.campcard:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.campcard .row b { font-size: 15px; }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.minis div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.minis b { display: block; font-variant-numeric: tabular-nums; }
.minis span { font-size: 11px; color: var(--muted); }

/* ---------- replies ---------- */
.replyrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 4px; border-top: 1px solid var(--border); }
.replyrow:first-child { border-top: 0; }
.replyrow .who b { font-weight: 600; }
.replyrow .who small { color: var(--muted); }
.replyrow .txt { grid-column: 1 / -1; white-space: pre-wrap; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: 0 8px 8px 0; padding: 9px 11px; font-size: 13px; }
.replyrow.done { opacity: .55; }
.composer { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-top: 8px; }
.composer textarea { background: var(--surface); }
.events { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.ev { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.ev:first-child { border-top: 0; }
.ev time { color: var(--faint); font-variant-numeric: tabular-nums; }
.ev.error { color: var(--err); }
.ev.warn { color: var(--warn); }
.ev.success { color: var(--ok); }

/* ---------- modal, toast, misc ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 2000; padding: 16px; animation: fade .15s ease-out; }
.modal .card { width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--muted); margin: 0 0 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.helpbox { background: var(--accent-soft); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 12px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; z-index: 3000; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: pop .18s ease-out; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); z-index: 2500; padding: 12vh 16px 16px; display: flex; justify-content: center; animation: fade .12s ease-out; }
.palette .box { width: min(520px, 100%); height: fit-content; max-height: 60vh; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease-out; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 13px 15px; background: none; outline: none; font-size: 15px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: calc(60vh - 52px); overflow-y: auto; }
.palette li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.palette li small { color: var(--muted); margin-left: auto; }
.palette li.sel, .palette li:hover { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .mbcards { grid-template-columns: 1fr; }
  .jump { min-width: 0; }
  .jump span, .jump .kbd { display: none; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .sidebd { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1100; }
  .top .menubtn { display: grid; }
  main { padding: 16px 16px 60px; }
  .top { padding: 0 12px; }
  .cols2, .cols3, .cols4 { grid-template-columns: 1fr; }
  .kv, .minis { grid-template-columns: repeat(2, 1fr); }
  .pagehead h1 { font-size: 20px; }
}
@media (max-width: 420px) { .stats { grid-template-columns: 1fr 1fr; } .stat b { font-size: 21px; } }
