/* Kimura SMS — calm, editorial UI. Light + dark via tokens. */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #f1efea;
  --border: #e6e2da;
  --border-strong: #d5d0c5;
  --text: #1d1c1a;
  --muted: #676259;
  --faint: #9a948a;

  --accent: #1f6b58;
  --accent-hover: #185646;
  --accent-soft: #e5f0ec;
  --accent-ring: rgba(31, 107, 88, .22);
  --on-accent: #ffffff;

  --ok: #1d7446;      --ok-soft: #e4f3ea;
  --warn: #9a5b06;    --warn-soft: #fbf1de;
  --danger: #b3261e;  --danger-soft: #fbe9e7;
  --info: #2c5595;    --info-soft: #e8eef9;

  --side-bg: #171917;
  --side-text: #c9c6bd;
  --side-muted: #7f7b72;
  --side-active: #262a26;
  --side-border: #262825;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(29, 28, 26, .04), 0 2px 6px -2px rgba(29, 28, 26, .05);
  --shadow-lg: 0 24px 48px -20px rgba(29, 28, 26, .28);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412;
    --surface: #1a1c1a;
    --surface-2: #1e211e;
    --surface-3: #242724;
    --border: #2c302c;
    --border-strong: #3a3f3a;
    --text: #ecebe6;
    --muted: #a3a097;
    --faint: #75726a;
    --accent: #5cb89c;
    --accent-hover: #74c8ad;
    --accent-soft: #1d3129;
    --accent-ring: rgba(92, 184, 156, .28);
    --on-accent: #0d1a15;
    --ok: #6cc394;      --ok-soft: #1b2e23;
    --warn: #e0a54a;    --warn-soft: #33281a;
    --danger: #f08a80;  --danger-soft: #3a1f1c;
    --info: #8fb0ea;    --info-soft: #1d2638;
    --side-bg: #0d0f0d;
    --side-active: #1d211d;
    --side-border: #1f221f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--side-bg) 252px, transparent 252px); }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-text);
  padding: 22px 14px 16px;
  border-right: 1px solid var(--side-border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 22px; color: #f3f1ea; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2f8a71, #1a5446);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  color: #fff;
}
.brand-name { font-family: var(--serif); font-size: 19px; letter-spacing: .005em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  margin: 18px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted);
}
.nav-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--side-text); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--side-active); color: #fff; }
.nav-item.is-active { background: var(--side-active); color: #fff; box-shadow: inset 2px 0 0 #5cb89c; }
.nav-item .count {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px;
  background: rgba(92,184,156,.16); color: #8fd8bf; font-size: 12px; text-align: center; font-weight: 600;
}

.sidebar-foot { border-top: 1px solid var(--side-border); padding-top: 14px; margin-top: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: #2b3a34; color: #cfe9df; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.me-text { min-width: 0; flex: 1; line-height: 1.25; }
.me-name { color: #f1efe8; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { color: var(--side-muted); font-size: 12px; }
.me-actions { display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: 8px; border: 0; background: transparent; color: var(--side-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--side-active); color: #fff; }

.main { padding: 38px clamp(18px, 4vw, 56px) 64px; max-width: 1240px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 32px); letter-spacing: -.005em; line-height: 1.15; }
.lede { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ---------- 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: 18px 22px 0; }
.card-head h2 { font-size: 15.5px; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 18px 22px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.flush .card-body { padding: 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-bottom: 10px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.stat-value { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-value.danger { color: var(--danger); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label .hint { font-weight: 400; color: var(--faint); font-size: 12.5px; }
.help { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.textarea { resize: vertical; min-height: 124px; line-height: 1.5; }
.textarea.short { min-height: 72px; }
.select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23857f75' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .32em; text-align: center; padding: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.check .t { font-weight: 500; }
.check .d { color: var(--muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-form { display: inline; }

.meter { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.meter .warn { color: var(--warn); }

/* Segmented control */
.segmented { align-self: flex-start; display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px;
  font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; user-select: none;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Phone picker */
.phone-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.phone-option { position: relative; }
.phone-option input { position: absolute; opacity: 0; }
.phone-option .box {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: all .15s;
}
.phone-option .box:hover { border-color: var(--accent); }
.phone-option input:checked + .box { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.phone-option input:focus-visible + .box { box-shadow: 0 0 0 4px var(--accent-ring); }
.phone-option .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.phone-option input:checked + .box .dot { background: var(--accent); color: var(--on-accent); }
.phone-option .lbl { font-weight: 600; line-height: 1.25; }
.phone-option .num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(0,0,0,.12); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--faint); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; padding: 13px 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Alerts ---------- */
.flashes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px;
  border-radius: 11px; border: 1px solid transparent; font-size: 14px;
}
.alert .icon { margin-top: 1px; }
.alert-body { flex: 1; }
.alert-close { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert strong { font-weight: 600; }

/* ---------- Lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 22px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.snippet { color: var(--muted); font-size: 13.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .body-cell { max-width: 420px; }
.cell-strong { font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-weight: 500; font-size: 13.5px; }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Messages feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: 0; }
.dir { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.dir.in { background: var(--info-soft); color: var(--info); }
.dir.out { background: var(--accent-soft); color: var(--accent); }
.feed-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed-party { font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-via { color: var(--faint); font-size: 12.5px; }
.feed-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed-side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.feed-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .icon-wrap { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- Key/value ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: flex-start; gap: 10px; }
.status-line .pulse { margin-top: 7px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.pulse.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.pulse.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.copyable { display: flex; gap: 8px; align-items: center; }
.copyable code { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }

/* ---------- 2FA ---------- */
.qr { background: #fff; border-radius: 14px; padding: 10px; border: 1px solid var(--border); width: 212px; height: 212px; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; }
.setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: .06em; padding: 9px 12px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 18px; border-radius: 12px; background: var(--surface-3); border: 1px dashed var(--border-strong); font-family: var(--mono); font-size: 15px; letter-spacing: .04em; text-align: center; }

.credential { font-family: var(--mono); font-size: 18px; letter-spacing: .04em; padding: 14px 16px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); flex: 1; }

/* ---------- Auth pages ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 18px;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 408px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 32px 30px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; color: var(--text); }
.auth-brand .brand-name { font-size: 20px; }
.auth h1 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin-bottom: 6px; }
.auth .lede { margin: 0 0 24px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--faint); font-size: 12.5px; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--side-border); }
  .brand { padding: 0 6px 0 2px; }
  .brand-name { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 10px; }
  .nav-item span.txt { display: none; }
  .nav-item.is-active span.txt { display: inline; }
  .sidebar-foot { border: 0; padding: 0; margin: 0; }
  .me-text, .me .avatar { display: none; }
  .main { padding-top: 26px; }
  .grid-halves, .form-row { grid-template-columns: minmax(0, 1fr); }
  .setup { grid-template-columns: minmax(0, 1fr); }
  .qr { margin: 0 auto; }
  .feed-item { grid-template-columns: 34px minmax(0, 1fr); }
  .feed-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .table .hide-sm { display: none; }
}

/* ---------- Campaigns ---------- */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.campaign-card { display: block; padding: 20px 22px; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.campaign-card:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.campaign-name { font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.25; }
.progress { display: flex; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress.thin { height: 5px; margin-top: 5px; width: 120px; }
.progress .seg { display: block; height: 100%; }
.seg.ok { background: var(--ok); } .seg.accent { background: var(--accent); opacity: .55; }
.seg.warn { background: var(--warn); opacity: .7; } .seg.danger { background: var(--danger); opacity: .7; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats strong { font-family: var(--serif); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.ok-text { color: var(--ok); } .danger-text { color: var(--danger); }
.nav-item .count.warn { background: rgba(224,165,74,.18); color: #f0c27a; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.tl-marker { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 12px; }
.tl-card { padding: 14px 18px 18px; }
.tl-when { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; color: var(--accent); }
.bubble { margin-top: 10px; padding: 12px 15px; border-radius: 18px 18px 18px 6px; background: var(--surface-3); white-space: pre-wrap;
  overflow-wrap: anywhere; max-width: 520px; line-height: 1.5; }

.tips { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.tips code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; color: var(--text); }
.chips.tokens { margin-bottom: 0; gap: 6px; }
.chips.tokens .chip { padding: 4px 10px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }

.disclosure > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 22px; font-weight: 600; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.mono-area { font-family: var(--mono); font-size: 13px; min-height: 150px; }
.input.file { padding: 8px; }
.import-result { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.import-result h2 { font-size: 15.5px; }

.verdict { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.feed-item.needs-review { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.quote { margin-top: 4px; font-size: 12.5px; color: var(--faint); font-style: italic; }
@media (max-width: 860px) { .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
