/* ListenerAI web app. One stylesheet: tokens, base, layout, components.
 * Calm work tool: neutral surfaces, one blue accent, status colors only
 * where they carry meaning. Light by default, dark via prefers-color-scheme. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e8ebf0;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #1b2130;
  --text-2: #4a5265;
  --text-3: #737b8f;
  --accent: #2557d6;
  --accent-hover: #1d47b3;
  --accent-soft: #e9effd;
  --accent-text: #1d47b3;
  --good: #1f8a4c;
  --good-soft: #e5f4ea;
  --warn: #a8670b;
  --warn-soft: #fbf1df;
  --bad: #c43a31;
  --bad-soft: #fbe9e7;
  --why-bg: #fbf7ec;
  --why-border: #efe2bd;
  --shadow-1: 0 1px 2px rgba(20, 28, 45, .05), 0 1px 1px rgba(20, 28, 45, .03);
  --shadow-2: 0 4px 16px rgba(20, 28, 45, .08), 0 1px 3px rgba(20, 28, 45, .05);
  --radius: 10px;
  --radius-sm: 7px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #161a22;
    --surface-2: #1c212b;
    --surface-3: #252b37;
    --border: #2a303c;
    --border-strong: #3a4250;
    --text: #e7eaf0;
    --text-2: #b4bbc9;
    --text-3: #8790a2;
    --accent: #5b8bff;
    --accent-hover: #7aa0ff;
    --accent-soft: #1b2744;
    --accent-text: #8fb0ff;
    --good: #4cc27d;
    --good-soft: #15291e;
    --warn: #e0a447;
    --warn-soft: #2d2414;
    --bad: #f0776d;
    --bad-soft: #321a19;
    --why-bg: #221f15;
    --why-border: #3b3420;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
code, pre { font-family: var(--mono); font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 24px; height: 24px; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center;
}
.brand__mark svg { width: 14px; height: 14px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
  color: var(--text-2); padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 520; font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.me { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
.me form { margin: 0; }
.me button { all: unset; cursor: pointer; color: var(--text-2); font-size: 13px; }
.me button:hover { color: var(--text); text-decoration: underline; }

/* ---------- page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.kicker, .eyebrow {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px;
}
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); margin-bottom: 14px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.grid-2 > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
button, .button {
  font: inherit; font-size: 14px; font-weight: 560; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { background: var(--surface-2); text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
.btn-primary, button.primary, .button--primary, button[type="submit"].primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover, button.primary:hover, .button--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: color-mix(in srgb, var(--good) 88%, #000); }
.btn-quiet, .button--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover, .button--ghost:hover { background: var(--surface-2); color: var(--text); }
button.danger, .btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); background: var(--surface); }
button.danger:hover, .btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-block { width: 100%; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; width: 100%; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea { line-height: 1.55; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
select[multiple] { padding: 4px; }
form label { display: block; margin-bottom: 14px; }
form label > span:first-child, .field__label { display: block; font-size: 13px; font-weight: 560; color: var(--text-2); margin-bottom: 5px; }
form label.inline, label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0 16px 14px 0; }
form label.inline > span:first-child { display: inline; margin: 0; }
form.inline, .inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
form.inline input { width: auto; }
.form-actions, .form__actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.field__hint { font-size: 12px; color: var(--text-3); margin-top: 4px; display: block; }
.readonly-value { display: block; padding: 8px 0; color: var(--text-2); font-size: 14px; }
.field--narrow input { max-width: 160px; }
.hint { font-size: 13px; color: var(--text-3); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); }
th a { color: inherit; }
.num, .numeric, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.table-wrap table td:first-child, .table-wrap table th:first-child { padding-left: 18px; }
.table-wrap table td:last-child, .table-wrap table th:last-child { padding-right: 18px; }
.row-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; white-space: nowrap; }
td.row-actions { display: table-cell; text-align: right; }
td.row-actions > * { margin-left: 8px; vertical-align: middle; }

/* ---------- badges / pills ---------- */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge--active, .pill--good { background: var(--good-soft); color: var(--good); }
.badge--muted { background: var(--surface-2); color: var(--text-3); }
.badge--version { background: var(--accent-soft); color: var(--accent-text); }
.pill--warn, .badge--level-4 { background: var(--warn-soft); color: var(--warn); }
.pill--bad, .badge--level-5 { background: var(--bad-soft); color: var(--bad); }
.badge--level-1 { background: var(--good-soft); color: var(--good); }
.badge--level-2 { background: var(--accent-soft); color: var(--accent-text); }
.badge--level-3 { background: var(--surface-2); color: var(--text-2); }
.score {
  display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 7px;
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--text-2);
}
.score--hi { background: var(--accent); color: #fff; }
.score--mid { background: var(--accent-soft); color: var(--accent-text); }
.status { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status--healthy { color: var(--good); }
.status--degraded { color: var(--warn); }
.status--dead { color: var(--bad); }

/* ---------- callouts / flash ---------- */
.callout { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 0 0 16px; font-size: 14px; }
.callout--warn { background: var(--warn-soft); color: var(--text); }
.callout--good { background: var(--good-soft); }
.callout--bad { background: var(--bad-soft); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty h2 { color: var(--text); margin-bottom: 6px; }

/* ---------- tabs + filters ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  padding: 10px 12px; margin-bottom: -1px; color: var(--text-2); font-weight: 560; font-size: 14px;
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.tabs a[aria-current="page"] .count { background: var(--accent-soft); color: var(--accent-text); }
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filterbar input[type="search"] { flex: 1; min-width: 200px; }
.filterbar select { width: auto; min-width: 140px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filters label { margin: 0; }
.filters input, .filters select { width: auto; min-width: 140px; }
.range { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.range a { padding: 6px 12px; border-radius: 5px; color: var(--text-2); font-size: 13px; font-weight: 560; }
.range a:hover { text-decoration: none; color: var(--text); }
.range a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- inbox list ---------- */
.feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.feed li + li { border-top: 1px solid var(--border); }
.feed a.item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; color: inherit; }
.feed a.item:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); text-decoration: none; }
.item__meta { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 3px; }
.item__meta .dot::before { content: "·"; }
.item__title { font-weight: 600; font-size: 15px; color: var(--text); line-height: 1.35; }
.item__why { margin-top: 4px; font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__side { text-align: right; font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--text-3); }

/* ---------- post page ---------- */
.post-title { font-size: 24px; line-height: 1.3; margin: 6px 0 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; font-size: 13px; color: var(--text-3); }
.why {
  background: var(--why-bg); border: 1px solid var(--why-border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px;
}
.why .eyebrow { color: var(--warn); }
.why p { margin: 0; font-size: 15px; }
.excerpt { font-size: 15px; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.excerpt-src { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--text-3); }
dl.facts dd { margin: 0; }
.panel { position: sticky; top: 76px; }
@media (max-width: 900px) { .panel { position: static; } }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.draft-area { min-height: 220px; font-size: 14.5px; }
.draft-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.draft-tools .grow { flex: 1; }
.guidance { display: flex; gap: 8px; margin-bottom: 10px; }
.guidance input { flex: 1; }
.outcome-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.outcome-form { margin-top: 12px; }
.closed-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.msg--bad { color: var(--bad); }
.msg--good { color: var(--good); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 6px 0; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; }
.timeline li.t-responded::before { background: var(--good); }
.timeline li.t-not_useful::before { background: var(--text-3); }
.timeline li.t-draft_generated::before { background: var(--accent); }
.timeline .when { color: var(--text-3); }
.timeline .detail { color: var(--text-2); white-space: pre-wrap; margin-top: 2px; }

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); }
.tile__label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.tile__value { font-size: 26px; font-weight: 680; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile__sub { font-size: 12px; color: var(--text-3); }
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.funnel__stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); position: relative; }
.funnel__label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.funnel__value { font-size: 26px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 4px; }
.funnel__conv { font-size: 12px; color: var(--text-3); }
.funnel__bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.funnel__bar span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 760px) { .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.charts .card { padding: 16px 18px; }
.charts .card + .card { margin-top: 0; }
.chart-box { position: relative; height: 220px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); padding: 32px; }
.login__card .brand { margin-bottom: 24px; }
.login__card h1 { font-size: 20px; margin-bottom: 6px; }
.login__card p { color: var(--text-2); font-size: 14px; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; padding: 10px; }
.login__alt { margin-top: 16px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- settings / config ---------- */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.settings-nav a { padding: 6px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 560; }
.settings-nav a:hover { color: var(--text); text-decoration: none; }
.settings-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.config-card { display: block; color: inherit; }
.config-card:hover { border-color: var(--accent); text-decoration: none; }
.config-card h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.config-card h3 small { font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
.config-card p { margin: 0; color: var(--text-3); font-size: 13px; }
.config-landing__lede { color: var(--text-2); max-width: 70ch; margin-bottom: 18px; }
section > form, .crud-edit form, .prompts-edit form, .channels-edit form, .rule-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); max-width: 900px;
}
section > table, .crud, .prompts, .settings-list, .channels, .cost-table, .source-health {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); border-collapse: separate; border-spacing: 0; overflow: hidden;
}
.settings-list td form.inline { width: 100%; }
.settings-list td form.inline input { flex: 1; width: 100%; }
.settings-list td form.inline { background: none; border: 0; padding: 0; box-shadow: none; max-width: none; }
td form.inline { background: none; border: 0; padding: 0; box-shadow: none; }
ol.rules { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
ol.rules li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); cursor: grab; }
ol.rules li:first-child { border-top: 0; }
ol.rules li a { flex: 1; color: inherit; display: flex; flex-direction: column; }
ol.rules li.is-inactive { opacity: .6; }
ol.rules li.is-dragging { opacity: .4; }
.handle { color: var(--text-3); }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.diff-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; max-height: 70vh; overflow: auto; margin-top: 8px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 8px 0 18px; }
dl.kv dt { color: var(--text-3); }
dl.kv dd { margin: 0; }
.metadata h2 { margin-top: 4px; }

/* ---------- footer ---------- */
.footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 32px; color: var(--text-3); font-size: 12px; }

@media (max-width: 720px) {
  .topbar__inner { gap: 4px 12px; padding: 8px 16px 6px; height: auto; flex-wrap: wrap; }
  .me { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -8px; }
  .nav a { padding: 7px 8px; white-space: nowrap; }
  .me span { display: none; }
  .page { padding: 20px 16px 48px; }
  .feed a.item { grid-template-columns: 40px minmax(0, 1fr); }
  .item__side { display: none; }
  .diff-grid { grid-template-columns: 1fr; }
}
.msg:empty { min-height: 0; margin: 0; }
