:root {
  --surface: #f3f4fa;
  --surface-inset: #eceefa;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.08);
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-muted: #64748b;
  --brand: #6366f1;
  --brand-ink: #4338ca;
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b, #fb923c);
  --grad-rose: linear-gradient(135deg, #f43f5e, #fb7185);
  --amber-ink: #b45309;
  --rose-ink: #e11d48;
  --emerald-ink: #059669;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, .14), 0 2px 8px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 40px -16px rgba(15, 23, 42, .22);
  --r-sm: 10px;
  --r: 16px;
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, .35);
}

html.dark-mode {
  --surface: #0a0e1a;
  --surface-inset: #060911;
  --card-bg: #121828;
  --card-border: rgba(255, 255, 255, .08);
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-muted: #8896ac;
  --brand: #818cf8;
  --brand-ink: #a5b4fc;
  --amber-ink: #fbbf24;
  --rose-ink: #fb7185;
  --emerald-ink: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, .55), 0 2px 8px -2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 40px -16px rgba(0, 0, 0, .65);
  --focus-ring: 0 0 0 3px rgba(129, 140, 248, .4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .08), transparent 60%),
    radial-gradient(900px 500px at 5% 100%, rgba(99, 102, 241, .07), transparent 60%),
    var(--surface);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

a { color: var(--brand); }

h1, h2 { letter-spacing: -.02em; }

h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

h1 a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 .mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad-brand);
  color: white;
  align-items: center;
  justify-content: center;
}


h1 { display: flex; align-items: baseline; gap: 6px; }

h1 .by-line {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
}

h1 .by-line:hover, .related-products a:hover { text-decoration: underline; }

.related-products { text-align: center; margin-top: 32px; font-size: 0.9rem; }
.related-products a { color: var(--ink-muted); text-decoration: none; }

.subtitle {
  color: var(--ink-muted);
  margin: 2px 0 32px;
  font-size: .95rem;
}

/* ── Page header ────────────────────────────────────────────────── */

.page-head { margin-bottom: 32px; }

.page-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.page-head .subtitle { margin-bottom: 0; }

.section-head {
  font-size: .95rem;
  font-weight: 650;
  color: var(--ink-soft);
  letter-spacing: -.01em;
  margin: 40px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

.section-head:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.locale-form select {
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  color: var(--ink);
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
}

.user-menu { position: relative; font-size: .9rem; }

.user-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  transition: background-color .15s ease;
}

.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--card-border); }
.user-menu summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.user-menu .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: white;
  font-size: .72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-menu .chevron {
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
  transition: transform .15s ease;
}

.user-menu[open] .chevron { transform: rotate(180deg); }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 20;
}

.user-menu-panel a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: .9rem;
  transition: background-color .15s ease, color .15s ease;
}

.user-menu-panel a:hover { color: var(--ink); background: var(--surface-inset); }
.user-menu-panel a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.user-menu-panel a.active { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 12%, transparent); }

.user-menu-form { display: contents; }
.user-menu-form button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.user-menu-form button:hover { color: var(--ink); background: var(--surface-inset); }

.user-menu-divider {
  height: 1px;
  background: var(--card-border);
  margin: 5px 2px;
}

/* ── Flash messages ─────────────────────────────────────────────── */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}

.flash svg { flex-shrink: 0; color: var(--brand); width: 16px; height: 16px; }

/* ── Forms (auth + credentials) ────────────────────────────────── */

.auth-shell {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}

.auth-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form h2 {
  margin: 0 0 -4px;
  font-size: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

input[type="text"], input[type="password"] {
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-size: .95rem;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="text"]::placeholder, input[type="password"]::placeholder {
  color: var(--ink-muted);
}

input[type="text"]:hover, input[type="password"]:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--card-border));
}

input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

button {
  background: var(--grad-brand);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 11px 18px;
  font-weight: 600;
  font-size: .92rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .5);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

button:hover { filter: brightness(1.06); box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .6); }
button:active { transform: translateY(1px); box-shadow: 0 2px 8px -4px rgba(99, 102, 241, .5); }
button:focus-visible { outline: none; box-shadow: var(--focus-ring), 0 4px 12px -4px rgba(99, 102, 241, .5); }
button:disabled { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }

.hint {
  font-size: .85rem;
  color: var(--ink-muted);
  margin: 0;
  text-align: center;
}

.hint a { font-weight: 600; text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* ── Code block (integrations snippet) ─────────────────────────── */

.code-block {
  margin: 20px 0 0;
  padding: 16px 18px;
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  overflow-x: auto;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.code-block code {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
  white-space: pre;
}

.or-divider {
  text-align: center;
  color: var(--ink-muted);
  font-size: .82rem;
  margin: -4px 0;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.btn-google:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--card-border)); }

/* Destructive action — quiet surface, rose ink; never the brand gradient */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--rose-ink);
  cursor: pointer;
  box-shadow: none;
  filter: none;
  transition: border-color .15s ease;
}

.btn-danger:hover { border-color: color-mix(in srgb, var(--rose-ink) 40%, var(--card-border)); filter: none; }
.btn-danger:active { transform: translateY(1px); }
.btn-danger:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Settings / credentials ────────────────────────────────────── */

.cred-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
}

.cred-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cred-form .field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cred-form .field-row label {
  font-size: .92rem;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--emerald-ink);
}

.status-pill svg { width: 13px; height: 13px; }

/* red variant for "over threshold" history events (see channels/history.html) */
.status-pill.bad { color: var(--rose-ink); }

/* Delivery health line under the channel's Active pill */
.channel-health {
  margin: 0;
  font-size: .82rem;
  line-height: 1.45;
}

.channel-health.good { color: var(--emerald-ink); }
.channel-health.bad { color: var(--rose-ink); }

.cred-form .field-actions {
  display: flex;
  gap: 8px;
}

.cred-form input[type="password"] { flex: 1; }

/* ── Provider dashboard rows ────────────────────────────────────── */

.providers {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.provider-row {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.provider-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-add a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .9rem;
  opacity: .8;
  transition: opacity .15s, border-color .15s;
}

.provider-add a:hover {
  opacity: 1;
  border-color: var(--brand);
  color: var(--brand-ink);
}

.provider-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.provider-logo,
.provider-logo-fallback {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -.125em;
}

.provider-logo {
  background: currentColor;
}

.provider-icon .provider-logo {
  width: 15px;
  height: 15px;
}

.provider-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--grad-brand);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.provider-head h2 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 650;
}

.provider-head-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}

.btn-icon:hover { background: var(--surface-inset); color: var(--ink); }
.btn-icon svg { width: 16px; height: 16px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.metric-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--grad-brand);
  transform: scaleX(var(--pct, 0));
  transform-origin: left;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.bar-fill.warn { background: var(--grad-amber); }
.bar-fill.danger { background: var(--grad-rose); }

.bar-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .9rem;
  min-width: 38px;
  text-align: right;
}

.reset {
  margin: 10px 0 0;
  font-size: .82rem;
  color: var(--ink-muted);
}

.detail {
  margin: 4px 0 0;
  font-size: .78rem;
  color: var(--ink-muted);
}

.metric .error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: .88rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.metric .error svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--ink-muted);
}

.stale {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--amber-ink);
  line-height: 1.4;
}

.stale svg { flex-shrink: 0; width: 13px; height: 13px; margin-top: 2px; }

.metrics + .stale { margin: 16px 0 0; }

/* ── Section layout (providers / channels sidebar) ─────────────── */

.section-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.section-sidebar {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 24px;
}

.section-sidebar-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 10px;
}

.section-sidebar-title.active { color: var(--brand-ink); }

.section-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
}

.section-sidebar-link:hover { background: var(--surface-inset); color: var(--ink); }
.section-sidebar-link.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-ink); font-weight: 600; }

.section-sidebar-icon { font-size: 1rem; }

.section-sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-ink);
  margin-left: auto;
}

/* separates non-channel entries (e.g. History) from the channel list */
.section-sidebar-separator {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 10px 10px 8px;
}

.section-main { flex: 1; min-width: 0; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.tab {
  padding: 8px 4px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}

.tab + .tab { margin-left: 16px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); }

.cred-form-link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease;
}

.cred-form-link:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--card-border)); }

/* ── Empty state ────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--r);
  color: var(--ink-muted);
}

.empty-state svg {
  width: 32px;
  height: 32px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.empty-state p { margin: 0 0 16px; }

.empty-state a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  background: var(--grad-brand);
  color: white;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: .88rem;
}

/* ── Landing ────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 56px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-ink);
  font-size: .8rem;
  font-weight: 600;
}

.hero-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  max-width: 560px;
}

.hero-subtitle {
  margin: 0;
  max-width: 480px;
  color: var(--ink-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-hero-primary, .btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
}

.btn-hero-primary {
  background: var(--grad-brand);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .5);
}

.btn-hero-secondary {
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  color: var(--ink);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.feature-icon { font-size: 1.6rem; margin-bottom: 10px; }

.feature-card h3 { margin: 0 0 6px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--ink-muted); font-size: .88rem; line-height: 1.5; }

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.support-list {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

.support-list h3 { margin: 0 0 12px; font-size: .95rem; }

.support-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--ink-soft);
}

.support-icon { font-size: 1.1rem; }

/* ── Admin ──────────────────────────────────────────────────────── */

.admin-nav { display: flex; gap: 8px; margin-bottom: 28px; }
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--card-border);
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-nav a:hover { color: var(--ink); background: var(--surface-inset); }
.admin-nav a.active { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, var(--card-border)); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat-card {
  position: relative;
  background: var(--surface-inset);
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  padding: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(15, 23, 42, .18); }
.stat-card .stat-icon {
  font-size: 1.1rem;
  color: var(--brand-ink);
  opacity: .8;
  margin-bottom: 10px;
  display: block;
}
.stat-card .stat-icon-danger { color: var(--rose-ink); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.stat-card .stat-label { color: var(--ink-muted); font-size: .85rem; margin-top: 2px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--card-border);
  font-size: .9rem;
}
.admin-table th { color: var(--ink-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: var(--surface-inset); }
.admin-table form { display: inline; }
.admin-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table .btn-icon { width: auto; padding: 6px 10px; gap: 6px; font-size: .82rem; font-weight: 600; }

.admin-user-cell { display: inline-flex; align-items: center; gap: 10px; }

.badge-pill { gap: 6px; padding: 4px 12px; font-size: .75rem; margin-right: 6px; }
.badge-admin { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand-ink); }
.badge-blocked { background: color-mix(in srgb, var(--rose-ink) 14%, transparent); color: var(--rose-ink); }


/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 560px) {
  main { padding: 24px 16px 48px; }
  .topbar { flex-wrap: wrap; }
  .provider-row { padding: 18px; }
  .auth-form { padding: 24px; }
  .section-layout { flex-direction: column; gap: 4px; }
  .section-sidebar { flex-direction: row; flex-wrap: wrap; position: static; width: 100%; }
  .hero-title { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
}

/* Analytics consent banner (templates/_posthog.html) */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px 20px;
  background: var(--card-bg); color: var(--ink);
  border-top: 1px solid var(--card-border);
  box-shadow: 0 -4px 16px -8px rgba(15, 23, 42, .25);
  font-size: .9rem;
}
.consent-banner[hidden] { display: none; }
.consent-banner span { flex: 1 1 260px; }
.consent-banner button { padding: 8px 14px; }
.consent-banner .consent-decline {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--card-border); box-shadow: none;
}
