/* =====================================================================
   Assisthub design system
   Loaded after Tailwind and site.css. Defines the app shell and restyles
   the shared components (card-premium, btn-premium, stat-tile, ...) so
   every view gets the same calm, neutral look without per-page rewrites.
   Rules that must beat site.css's [data-theme="dark"] overrides are
   prefixed with :root to tie on specificity and win on source order.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --muted-bg: #f4f4f5;
  --hover-bg: #f1f1f3;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --text: #18181b;
  --text-2: #52525b;
  --text-3: #71717a;
  --text-4: #a1a1aa;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #4338ca;
  --accent-subtle: #eef2ff;
  --accent-border: #c7d2fe;
  --on-accent: #ffffff;

  --success: #15803d;  --success-bg: #f0fdf4; --success-border: #bbf7d0; --success-solid: #059669;
  --warning: #b45309;  --warning-bg: #fffbeb; --warning-border: #fde68a; --warning-solid: #d97706;
  --danger:  #b91c1c;  --danger-bg:  #fef2f2; --danger-border:  #fecaca; --danger-solid:  #dc2626;
  --info:    #1d4ed8;  --info-bg:    #eff6ff; --info-border:    #bfdbfe; --info-solid:    #2563eb;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.05);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.18);

  --sidebar-w: 248px;
  --topbar-h: 56px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #17171a;
  --muted-bg: #1c1c20;
  --hover-bg: #222227;
  --border: #27272a;
  --border-strong: #3f3f46;

  --text: #f4f4f5;
  --text-2: #b4b4bb;
  --text-3: #8b8b94;
  --text-4: #63636b;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-text: #a5b4fc;
  --accent-subtle: rgba(99, 102, 241, 0.14);
  --accent-border: rgba(129, 140, 248, 0.35);

  --success: #4ade80;  --success-bg: rgba(34, 197, 94, 0.12);  --success-border: rgba(74, 222, 128, 0.3);
  --warning: #fbbf24;  --warning-bg: rgba(245, 158, 11, 0.12); --warning-border: rgba(251, 191, 36, 0.3);
  --danger:  #f87171;  --danger-bg:  rgba(239, 68, 68, 0.12);  --danger-border:  rgba(248, 113, 113, 0.3);
  --info:    #60a5fa;  --info-bg:    rgba(59, 130, 246, 0.12); --info-border:    rgba(96, 165, 250, 0.3);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(129, 140, 248, 0.3);
  color-scheme: dark;
}

/* ---------- Base ---------- */
:root body.app-body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
}
.app-body input, .app-body select, .app-body textarea, .app-body button { font-family: inherit; }

h1, h2, h3, h4 { letter-spacing: -0.015em; color: var(--text); }
/* The hidden attribute must win over component display rules (.alert, .empty, ...). */
[hidden] { display: none !important; }
::selection { background: var(--accent-subtle); color: var(--text); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tabular, .stat-tile-value, .kpi-value { font-variant-numeric: tabular-nums; }

/* Calm the motion: no page-wide fades, entrance staggers or hover jumps. */
main, .app-content, .pub-content { animation: none !important; }
.animate-fade-in-up, .animate-fade-in, .animate-slide-up, [class*="stagger-"] { animation: none !important; opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg); font-size: 13px;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn, :root .btn-premium, :root .btn-secondary-premium {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  transform: none !important;
}
.btn i, .btn-premium i, .btn-secondary-premium i { margin: 0 !important; font-size: 13px; }
.btn:disabled, .btn-premium:disabled, .btn-secondary-premium:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }

.btn-primary, :root .btn-premium {
  background: var(--accent) !important; color: var(--on-accent) !important;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover, :root .btn-premium:hover { background: var(--accent-hover) !important; box-shadow: var(--shadow-xs); }
:root .btn-premium::before, :root .btn-premium:hover::before { display: none !important; }
:root .btn-glow, :root .btn-glow:hover { box-shadow: var(--shadow-xs) !important; animation: none !important; }

.btn-secondary, :root .btn-secondary-premium {
  background: var(--surface) !important; color: var(--text) !important;
  border-color: var(--border-strong) !important; box-shadow: var(--shadow-xs);
}
.btn-secondary:hover, :root .btn-secondary-premium:hover { background: var(--hover-bg) !important; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text); }

.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: transparent; border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover-bg); color: var(--text); }

/* ---------- Cards & surfaces ---------- */
:root .card-premium, :root .card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
  border-radius: var(--radius-lg) !important;
  transform: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
:root .card-premium::before, :root .card-premium:hover::before { display: none !important; }
:root .card-premium:hover, :root .card:hover { transform: none !important; box-shadow: var(--shadow-xs) !important; }
:root a .card-premium:hover, :root .pipeline-card .card-premium:hover, :root .template-card:hover { border-color: var(--border-strong) !important; box-shadow: var(--shadow-sm) !important; }

:root .shadow-premium, :root .shadow-premium-lg, :root .shadow-card, :root .shadow-xl, :root .shadow-2xl, :root .shadow-lg {
  box-shadow: var(--shadow-xs) !important;
}
:root .hover\:shadow-premium:hover, :root .hover\:shadow-xl:hover, :root .hover\:shadow-2xl:hover, :root .hover\:shadow-lg:hover {
  box-shadow: var(--shadow-sm) !important;
}
:root .shadow-glow-sm, :root .shadow-glow, :root .shadow-inner { box-shadow: none !important; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 14px; font-weight: 600; color: var(--text); }
.panel-sub { font-size: 13px; color: var(--text-3); }
.panel-body { padding: 18px; }

/* ---------- Form controls ---------- */
:root .input-premium, :root .select-premium, .field, :root .field-premium input, :root .field-premium textarea, :root .field-premium select {
  width: 100%;
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  line-height: 1.45;
  box-shadow: var(--shadow-xs) !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
:root .select-premium, select.field {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding-right: 34px !important;
  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='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 11px center !important;
}
input.input-premium, input.field { height: 36px; }
:root .input-premium:focus, :root .select-premium:focus, .field:focus,
:root .field-premium input:focus, :root .field-premium textarea:focus, :root .field-premium select:focus {
  outline: none; border-color: var(--accent) !important; box-shadow: var(--ring) !important;
}
:root .input-premium::placeholder, .field::placeholder { color: var(--text-4) !important; }
.label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--text-3); }

/* Generic inputs inside the app that only use Tailwind utilities */
:root .app-content input[type="text"], :root .app-content input[type="email"], :root .app-content input[type="password"],
:root .app-content input[type="number"], :root .app-content input[type="url"], :root .app-content input[type="search"],
:root .app-content input[type="datetime-local"], :root .app-content input[type="date"], :root .app-content input[type="time"],
:root .app-content textarea, :root .app-content select {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border-strong) !important;
}
:root .app-content input::placeholder, :root .app-content textarea::placeholder { color: var(--text-4) !important; }
:root .app-content input:focus, :root .app-content textarea:focus, :root .app-content select:focus {
  border-color: var(--accent) !important; box-shadow: var(--ring) !important; outline: none;
}

/* ---------- Badges & chips ---------- */
:root .badge-premium, .badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--muted-bg) !important; color: var(--text-2) !important;
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  box-shadow: none !important;
}
:root .badge-premium i { margin-right: 0 !important; font-size: 10px; }
:root .badge-primary, .badge-accent { background: var(--accent-subtle) !important; color: var(--accent-text) !important; border-color: var(--accent-border) !important; }
:root .badge-success { background: var(--success-bg) !important; color: var(--success) !important; border-color: var(--success-border) !important; }
:root .badge-warning { background: var(--warning-bg) !important; color: var(--warning) !important; border-color: var(--warning-border) !important; }
:root .badge-error, :root .badge-danger { background: var(--danger-bg) !important; color: var(--danger) !important; border-color: var(--danger-border) !important; }

:root .chip, :root .platform-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface) !important; color: var(--text-2) !important;
  font-size: 13px; font-weight: 500; box-shadow: none !important; transform: none !important;
}
:root .chip:hover { background: var(--hover-bg) !important; color: var(--text) !important; }
:root .chip.is-active, :root .chip.active { background: var(--text) !important; color: var(--bg) !important; border-color: var(--text) !important; }

/* ---------- Page headers ---------- */
:root .page-header-compact, .page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 0 0 24px; padding: 0 !important;
  background: none !important; border: 0 !important; box-shadow: none !important;
}
:root .page-header-compact::before, :root .page-header-compact::after { display: none !important; }
:root .page-header-eyebrow, .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 6px; padding: 0 !important;
  background: none !important; border: 0 !important;
  font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--text-3) !important;
  text-transform: none;
}
:root .page-header-eyebrow i { color: var(--text-4); font-size: 11px; }
:root .page-header-title, .page-title {
  font-size: 24px !important; line-height: 1.25 !important; font-weight: 650 !important;
  letter-spacing: -0.02em; color: var(--text) !important; margin: 0;
}
:root .page-header-subtitle, .page-sub { margin-top: 4px; font-size: 14px !important; color: var(--text-3) !important; max-width: 64ch; }

/* The old marketing hero becomes a quiet page header. */
:root .page-hero {
  background: none !important; color: var(--text) !important;
  padding: 0 !important; margin: 0 0 24px !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible;
}
:root .page-hero::before, :root .page-hero::after, :root .page-hero-orb { display: none !important; }
:root .page-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px;
  padding: 0 !important; background: none !important; border: 0 !important; backdrop-filter: none !important;
  font-size: 12px; font-weight: 500; color: var(--text-3) !important;
}
:root .page-hero-badge i, :root .page-hero-badge span { color: var(--text-4) !important; }
:root .page-hero-badge .animate-pulse { display: none; }
:root .page-hero-title { font-size: 28px !important; line-height: 1.2 !important; font-weight: 650 !important; color: var(--text) !important; letter-spacing: -0.025em; }
:root .page-hero-title .accent { color: var(--text) !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
:root .page-hero-subtitle { margin-top: 6px; font-size: 15px !important; color: var(--text-3) !important; max-width: 68ch; }
:root .page-hero .text-white, :root .page-hero [class*="text-white"] { color: var(--text-3) !important; }
:root .page-hero [class*="text-yellow"] { color: var(--text-4) !important; }

/* Sub-navigation duplicated by the sidebar */
:root .is-app .content-nav-wrapper { display: none !important; }

/* ---------- Stat tiles ---------- */
:root .stat-tile, :root .stat-card, .kpi {
  position: relative;
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-xs) !important;
  padding: 16px !important; transform: none !important; overflow: hidden;
}
:root .stat-tile::before, :root .stat-tile::after { display: none !important; }
:root .stat-tile-icon {
  width: 30px !important; height: 30px !important; border-radius: var(--radius) !important;
  background: var(--muted-bg) !important; color: var(--text-2) !important;
  box-shadow: none !important; font-size: 13px !important;
  display: inline-flex; align-items: center; justify-content: center;
}
:root .stat-tile-label, .kpi-label { font-size: 13px !important; font-weight: 500 !important; color: var(--text-3) !important; text-transform: none !important; letter-spacing: 0 !important; }
:root .stat-tile-value, .kpi-value { font-size: 24px !important; font-weight: 650 !important; color: var(--text) !important; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; background: none !important; -webkit-text-fill-color: currentColor !important; }
:root .stat-tile-delta { font-size: 12px !important; background: none !important; padding: 0 !important; }
:root .stat-tile-delta-up { color: var(--success) !important; }
:root .stat-tile-delta-down { color: var(--danger) !important; }
:root .stat-tile-delta-flat { color: var(--text-3) !important; }

/* ---------- Tables ---------- */
:root .table-premium { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
:root .table-premium thead { background: var(--surface-2) !important; }
:root .table-premium thead th {
  background: transparent !important; color: var(--text-3) !important;
  font-size: 12px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important;
  padding: 10px 16px !important; border-bottom: 1px solid var(--border) !important;
}
:root .table-premium tbody td { padding: 12px 16px !important; border-bottom: 1px solid var(--border) !important; color: var(--text-2); }
:root .table-premium tbody tr:hover, :root .table-row:hover { background: var(--surface-2) !important; }
:root .app-content table thead { background: var(--surface-2); }
:root .app-content table th { color: var(--text-3); font-weight: 500; }
:root .app-body .divide-y > * + *, :root .app-body .divide-gray-100 > * + *, :root .app-body .divide-gray-200 > * + * { border-color: var(--border) !important; }

/* ---------- Modals ---------- */
:root .modal-premium-backdrop { background: rgba(9, 9, 11, 0.5) !important; backdrop-filter: none !important; }
:root .modal-premium { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-md) !important; }
:root .modal-premium-header { background: none !important; color: var(--text) !important; border-bottom: 1px solid var(--border) !important; }
:root .modal-premium-footer { background: var(--surface-2) !important; border-top: 1px solid var(--border) !important; }
:root .modal-premium-close { color: var(--text-3) !important; background: transparent !important; }

/* ---------- Empty states ---------- */
:root .empty-state-premium, .empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px 24px !important;
  background: var(--surface-2) !important; border: 1px dashed var(--border-strong) !important; border-radius: var(--radius-lg) !important;
  color: var(--text-3);
}
.empty.hidden, .empty-state-premium.hidden, .btn.hidden, .badge.hidden { display: none !important; }
.empty-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--muted-bg); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.empty-title { font-weight: 600; color: var(--text); }
.empty-text { font-size: 13px; color: var(--text-3); margin-top: 4px; max-width: 42ch; }

/* ---------- Misc existing components ---------- */
:root .history-card, :root .provider-card, :root .template-card, :root .theme-card, :root .export-format-card, :root .blog-card {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-xs) !important; transform: none !important;
}
:root .history-card:hover, :root .provider-card:hover, :root .template-card:hover, :root .export-format-card:hover, :root .blog-card:hover {
  border-color: var(--border-strong) !important; box-shadow: var(--shadow-sm) !important;
}
:root .history-card-icon-btn { background: transparent !important; color: var(--text-3) !important; border: 1px solid transparent !important; box-shadow: none !important; }
:root .history-card-icon-btn:hover { background: var(--hover-bg) !important; color: var(--text) !important; }
:root .loading-overlay-premium { background: rgba(9, 9, 11, 0.45) !important; backdrop-filter: none !important; }
:root .loading-overlay-premium-card { background: var(--surface) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-md) !important; color: var(--text) !important; }
:root .dropdown-glass { background: var(--surface) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-md) !important; backdrop-filter: none !important; }

/* =====================================================================
   Tailwind utility normalisation
   Views were written with Tailwind 2 palette classes. Map them onto the
   design tokens so light/dark stay consistent and colour is used sparingly.
   ===================================================================== */

/* Neutrals */
:root .app-body .text-gray-900, :root .app-body .text-gray-800, :root .app-body .text-slate-800, :root .app-body .text-slate-900 { color: var(--text) !important; }
:root .app-body .text-gray-700, :root .app-body .text-gray-600, :root .app-body .text-slate-700, :root .app-body .text-slate-600 { color: var(--text-2) !important; }
:root .app-body .text-gray-500, :root .app-body .text-slate-500 { color: var(--text-3) !important; }
:root .app-body .text-gray-400, :root .app-body .text-gray-300, :root .app-body .text-slate-400 { color: var(--text-4) !important; }
:root .app-body .bg-white { background-color: var(--surface) !important; }
:root .app-body .bg-gray-50, :root .app-body .bg-slate-50 { background-color: var(--surface-2) !important; }
:root .app-body .bg-gray-100, :root .app-body .bg-slate-100 { background-color: var(--muted-bg) !important; }
:root .app-body .bg-gray-200 { background-color: var(--hover-bg) !important; }
:root .app-body .hover\:bg-gray-50:hover, :root .app-body .hover\:bg-gray-100:hover, :root .app-body .hover\:bg-gray-200:hover { background-color: var(--hover-bg) !important; }
:root .app-body .border-gray-100, :root .app-body .border-gray-200, :root .app-body .border-slate-200 { border-color: var(--border) !important; }
:root .app-body .border-gray-300 { border-color: var(--border-strong) !important; }

/* Accent: one indigo, no purple/violet drift */
:root .app-body .text-indigo-400, :root .app-body .text-indigo-500, :root .app-body .text-indigo-600, :root .app-body .text-indigo-700,
:root .app-body .text-purple-500, :root .app-body .text-purple-600, :root .app-body .text-violet-500, :root .app-body .text-violet-600 { color: var(--accent-text) !important; }
:root .app-body .bg-indigo-500, :root .app-body .bg-indigo-600, :root .app-body .bg-purple-500, :root .app-body .bg-purple-600 { background-color: var(--accent) !important; }
:root .app-body .hover\:bg-indigo-600:hover, :root .app-body .hover\:bg-indigo-700:hover { background-color: var(--accent-hover) !important; }
:root .app-body .bg-indigo-50, :root .app-body .bg-indigo-100, :root .app-body .bg-purple-50, :root .app-body .bg-purple-100 { background-color: var(--accent-subtle) !important; }
:root .app-body .border-indigo-100, :root .app-body .border-indigo-200, :root .app-body .border-indigo-300, :root .app-body .border-purple-200 { border-color: var(--accent-border) !important; }
:root .app-body .border-indigo-500, :root .app-body .border-indigo-600 { border-color: var(--accent) !important; }
:root .app-body .hover\:border-indigo-200:hover, :root .app-body .hover\:border-indigo-300:hover, :root .app-body .hover\:border-purple-200:hover, :root .app-body .hover\:border-emerald-200:hover { border-color: var(--border-strong) !important; }
:root .app-body .focus\:border-indigo-500:focus { border-color: var(--accent) !important; }

/* Gradients become flat fills taken from the "from" colour. */
:root .app-body .bg-gradient-to-r, :root .app-body .bg-gradient-to-l, :root .app-body .bg-gradient-to-b, :root .app-body .bg-gradient-to-t,
:root .app-body .bg-gradient-to-br, :root .app-body .bg-gradient-to-bl, :root .app-body .bg-gradient-to-tr, :root .app-body .bg-gradient-to-tl {
  background-image: none !important;
  background-color: var(--tw-gradient-from, transparent);
}
:root .app-body .from-indigo-400, :root .app-body .from-indigo-500, :root .app-body .from-indigo-600, :root .app-body .from-indigo-700,
:root .app-body .from-purple-500, :root .app-body .from-purple-600, :root .app-body .from-violet-500, :root .app-body .from-violet-600,
:root .app-body .from-yellow-300, :root .app-body .from-yellow-400, :root .app-body .from-amber-400 { --tw-gradient-from: var(--accent) !important; }
:root .app-body .from-emerald-400, :root .app-body .from-emerald-500, :root .app-body .from-emerald-600, :root .app-body .from-green-500, :root .app-body .from-teal-500 { --tw-gradient-from: var(--success-solid) !important; }
:root .app-body .from-amber-500, :root .app-body .from-orange-400, :root .app-body .from-orange-500, :root .app-body .from-yellow-500 { --tw-gradient-from: var(--warning-solid) !important; }
:root .app-body .from-red-500, :root .app-body .from-red-600, :root .app-body .from-rose-500, :root .app-body .from-pink-500, :root .app-body .from-pink-400 { --tw-gradient-from: var(--danger-solid) !important; }
:root .app-body .from-blue-400, :root .app-body .from-blue-500, :root .app-body .from-blue-600, :root .app-body .from-cyan-400, :root .app-body .from-cyan-500, :root .app-body .from-sky-500 { --tw-gradient-from: var(--info-solid) !important; }
:root .app-body .from-indigo-50, :root .app-body .from-indigo-100, :root .app-body .from-purple-50, :root .app-body .from-purple-100, :root .app-body .from-violet-50 { --tw-gradient-from: var(--accent-subtle) !important; }
:root .app-body .from-emerald-50, :root .app-body .from-emerald-100, :root .app-body .from-green-50 { --tw-gradient-from: var(--success-bg) !important; }
:root .app-body .from-yellow-50, :root .app-body .from-amber-50, :root .app-body .from-amber-100, :root .app-body .from-orange-50 { --tw-gradient-from: var(--warning-bg) !important; }
:root .app-body .from-red-50, :root .app-body .from-rose-50, :root .app-body .from-pink-50, :root .app-body .from-pink-100 { --tw-gradient-from: var(--danger-bg) !important; }
:root .app-body .from-blue-50, :root .app-body .from-blue-100, :root .app-body .from-cyan-50, :root .app-body .from-sky-50 { --tw-gradient-from: var(--info-bg) !important; }
:root .app-body .from-white, :root .app-body .from-gray-50, :root .app-body .from-slate-50 { --tw-gradient-from: var(--surface) !important; }
:root .app-body .from-gray-100, :root .app-body .from-slate-100 { --tw-gradient-from: var(--muted-bg) !important; }

/* Gradient text reads as plain text. */
:root .app-body .bg-clip-text { background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important; }
:root .app-body .bg-clip-text.text-transparent, :root .app-body .text-transparent.bg-clip-text { color: inherit !important; -webkit-text-fill-color: currentColor !important; }

/* Decorative blur blobs and hover jumps go away. */
:root .app-body .blur-3xl, :root .app-body .blur-2xl, :root .app-body .auth-orb, :root .app-body .page-hero-orb { display: none !important; }
:root .app-body .hover\:-translate-y-1:hover, :root .app-body .hover\:-translate-y-2:hover, :root .app-body .hover\:-translate-y-0\.5:hover { --tw-translate-y: 0 !important; transform: none !important; }
:root .app-body .group:hover .group-hover\:scale-110, :root .app-body .group:hover .group-hover\:scale-105, :root .app-body .hover\:scale-105:hover, :root .app-body .hover\:scale-110:hover { --tw-scale-x: 1 !important; --tw-scale-y: 1 !important; transform: none !important; }
:root .app-body .rounded-3xl { border-radius: var(--radius-lg) !important; }
:root .app-body .rounded-2xl { border-radius: var(--radius-lg) !important; }
:root .app-body .rounded-xl { border-radius: 10px !important; }

/* Gradients written as inline styles in a few views. */
:root .app-body .format-tile-icon[style], :root .app-body .export-format-icon[style], :root .app-body .social-tile[style] {
  background: var(--muted-bg) !important; color: var(--text-2) !important; box-shadow: none !important;
}
:root .app-body .blog-card-cover[style] { background: var(--muted-bg) !important; color: var(--text-3) !important; }
:root .app-body .blog-card-cover[style] i { color: var(--text-4) !important; }
:root .app-body .textarea-shell[style] { background: var(--surface) !important; }
/* Full-width promotional banners become a quiet dark panel in both themes. */
:root .app-body section[style*="linear-gradient"], :root .app-body div.rounded-2xl[style*="linear-gradient"],
:root .app-body div.relative[style*="linear-gradient"] {
  background: #18181b !important; border: 1px solid #27272a; border-radius: var(--radius-lg) !important;
}
:root .app-body section[style*="linear-gradient"] .text-white,
:root .app-body div[style*="linear-gradient"] .text-white { color: #fafafa !important; }

/* =====================================================================
   App shell (signed in)
   ===================================================================== */
.app-shell { min-height: 100vh; }

.sb {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}
.sb-brand { height: var(--topbar-h); display: flex; align-items: center; padding: 0 16px; flex-shrink: 0; }
.sb-cta { padding: 4px 12px 8px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sb-label { margin: 16px 10px 4px; font-size: 11px; font-weight: 600; color: var(--text-4); letter-spacing: .04em; text-transform: uppercase; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}
.sb-link i { width: 16px; text-align: center; font-size: 13px; color: var(--text-4); transition: color .12s ease; }
.sb-link:hover { background: var(--hover-bg); color: var(--text); }
.sb-link:hover i { color: var(--text-2); }
.sb-link.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border); }
.sb-link.is-active i { color: var(--accent-text); }
.sb-foot { padding: 8px; border-top: 1px solid var(--border); }
.sb-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(9, 9, 11, .45); }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.sb-toggle { display: none; }
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.topbar-crumb { color: var(--text-3); }
.topbar-sep { font-size: 9px; color: var(--text-4); }
.topbar-page { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 4px; border-radius: var(--radius);
  color: var(--text-2); background: transparent; border: 1px solid transparent;
}
.user-btn:hover { background: var(--hover-bg); color: var(--text); }
.user-btn-name { font-size: 13px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 26px; height: 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent-text);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.menu-panel[hidden] { display: none; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head-name { font-weight: 600; font-size: 13px; color: var(--text); }
.menu-head-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); text-decoration: none; }
.menu-item i { width: 14px; text-align: center; color: var(--text-4); }
.menu-item:hover { background: var(--hover-bg); color: var(--text); }
.menu-sep { height: 1px; margin: 6px 0; background: var(--border); }

.app-content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }
.app-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 32px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.app-footer nav { display: flex; gap: 16px; }
.app-footer a { color: var(--text-3); text-decoration: none; }
.app-footer a:hover { color: var(--text); }

@media (max-width: 1023px) {
  .sb { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sb.is-open { transform: none; }
  .app-main { margin-left: 0; }
  .sb-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .app-content { padding: 20px 16px 40px; }
  .app-footer { padding: 16px; }
  .user-btn-name { display: none; }
}

/* =====================================================================
   Public shell (signed out)
   ===================================================================== */
.pub-nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.pub-nav-inner { max-width: 1200px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.pub-links { display: flex; gap: 4px; }
.pub-links a { padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); text-decoration: none; }
.pub-links a:hover { color: var(--text); background: var(--hover-bg); }
.pub-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pub-content { max-width: 1200px; margin: 0 auto; padding: 40px 24px 64px; }
.pub-footer { border-top: 1px solid var(--border); background: var(--surface-2); }
.pub-footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.pub-footer-tag { margin-top: 10px; font-size: 13px; color: var(--text-3); max-width: 32ch; }
.pub-footer-cols { display: flex; gap: 56px; }
.pub-footer-cols a { display: block; font-size: 13px; color: var(--text-2); text-decoration: none; margin-top: 8px; }
.pub-footer-cols a:hover { color: var(--text); }
.pub-footer-h { font-size: 12px; font-weight: 600; color: var(--text); }
.pub-footer-base { max-width: 1200px; margin: 0 auto; padding: 16px 24px 24px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); }
@media (max-width: 767px) {
  .pub-links { display: none; }
  .pub-nav-inner { padding: 0 16px; gap: 12px; }
  .pub-actions .btn-ghost { display: none; }
  .pub-content { padding: 24px 16px 48px; }
  .pub-footer-cols { gap: 32px; flex-wrap: wrap; }
}

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth-main { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px; background: var(--surface-2); border-right: 1px solid var(--border); overflow: hidden;
}
.auth-aside-body { max-width: 440px; }
.auth-aside h2 { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -0.025em; }
.auth-aside p.lead { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.auth-points { margin-top: 28px; display: grid; gap: 16px; }
.auth-point { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.auth-point-icon { width: 32px; height: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 13px; }
.auth-point-title { font-weight: 600; font-size: 14px; color: var(--text); }
.auth-point-text { font-size: 13px; color: var(--text-3); }
.auth-aside-foot { font-size: 12px; color: var(--text-3); }

.auth-panel { display: flex; flex-direction: column; padding: 24px; }
.auth-panel-top { display: flex; justify-content: flex-end; }
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.auth-form .auth-sub { margin-top: 6px; color: var(--text-3); font-size: 14px; }
.auth-stack { display: grid; gap: 16px; margin-top: 28px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-alt { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-3); }
.link { color: var(--accent-text); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }
.alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; border: 1px solid; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.alert-warning .link { color: inherit; text-decoration: underline; }
.field-wrap { position: relative; }
.field-wrap .field { padding-right: 40px !important; }
.field-addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: var(--radius-sm); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.field-addon:hover { background: var(--hover-bg); color: var(--text); }
.field-error { display: block; margin-top: 6px; font-size: 12px; color: var(--danger); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.pw-meter span { height: 3px; border-radius: 2px; background: var(--border); transition: background-color .2s ease; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger-solid); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warning-solid); }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--info-solid); }
.pw-meter[data-score="4"] span { background: var(--success-solid); }
@media (max-width: 1023px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* =====================================================================
   Overview page
   ===================================================================== */
.ov-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: stretch; }
.ov-form { display: grid; gap: 16px; }
.ov-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ov-actions { display: flex; gap: 8px; }
.ov-actions .btn-primary { flex: 1; }
.ov-result { min-height: 420px; display: flex; flex-direction: column; }
.ov-output { flex: 1; min-height: 240px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); white-space: pre-wrap; line-height: 1.65; overflow-y: auto; max-height: 520px; }
.ov-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ov-tabs { display: flex; gap: 4px; padding: 3px; background: var(--muted-bg); border-radius: var(--radius); width: max-content; }
.ov-tab { height: 28px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-3); }
.ov-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.ov-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.quick-link { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.quick-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.quick-link-icon { width: 32px; height: 32px; border-radius: var(--radius); background: var(--muted-bg); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.quick-link-title { font-size: 14px; font-weight: 600; color: var(--text); }
.quick-link-text { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 360px; max-width: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-md); }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 16px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 8px; align-content: start; }
.hist-item { text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hist-item:hover { background: var(--hover-bg); }
.hist-item-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-3); }
.hist-item-text { margin-top: 4px; font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.preview-avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--muted-bg); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
@media (max-width: 1023px) {
  .ov-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .ov-row { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
}

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px; padding: 10px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease;
}
.toast.is-in { opacity: 1; transform: none; }
.toast-success i { color: var(--success-solid); }
.toast-error i { color: var(--danger-solid); }
.toast-warning i { color: var(--warning-solid); }
.toast-info i { color: var(--info-solid); }
@media (max-width: 520px) { .toast-stack { left: 16px; right: 16px; } .toast { min-width: 0; max-width: none; } }

/* =====================================================================
   Shared form & layout components
   ===================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 13px !important; }
.app-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; padding: 1px 5px; border-radius: 4px; background: var(--muted-bg); color: var(--text); }
.link-danger { color: var(--danger); font-weight: 500; }
.link-danger:hover { text-decoration: underline; }
.link-danger.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Status pill: Connected / Unreachable / Not configured */
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--muted-bg); white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--text-4); }
.status-pill.is-ok { color: var(--success); background: var(--success-bg); }
.status-pill.is-ok .status-dot { background: var(--success-solid); }
.status-pill.is-warn { color: var(--warning); background: var(--warning-bg); }
.status-pill.is-warn .status-dot { background: var(--warning-solid); }

/* Radio list */
.choice-list { display: grid; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-top: 1px solid var(--border); transition: background-color .12s ease; }
.choice:first-child { border-top: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.choice:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.choice:hover { background: var(--surface-2); }
.choice input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.choice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.choice-title { font-weight: 500; color: var(--text); }
.choice-desc { font-size: 13px; color: var(--text-3); }
.choice:has(input:checked) { background: var(--accent-subtle); }
.choice:has(input:checked) .choice-title { color: var(--accent-text); }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--muted-bg); border-radius: var(--radius); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-3); }
.segmented span i { font-size: 12px; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.row-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.row-title { font-weight: 500; color: var(--text); }
.row-desc { font-size: 13px; color: var(--text-3); }

/* Sticky action / save bars */
.action-bar, .save-bar {
  position: sticky; bottom: 16px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.save-bar { margin: -20px 0 40px; }
.save-bar[hidden] { display: none; }
.save-bar-text { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding-left: 4px; }
.save-bar-text i { color: var(--info-solid); }

/* Native dialog */
.dialog { width: min(880px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
.dialog::backdrop { background: rgba(9, 9, 11, .5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 16px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare-label { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.compare-text { max-height: 60vh; overflow-y: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); white-space: pre-wrap; font-size: 14px; line-height: 1.65; }

/* Validation summary from ASP.NET */
.validation-summary-valid { display: none !important; }
.alert ul { margin: 0; padding-left: 16px; list-style: disc; }

/* =====================================================================
   Settings page
   ===================================================================== */
.settings { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 2px; }
.settings-nav-link { height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-3); text-decoration: none; }
.settings-nav-link:hover { background: var(--hover-bg); color: var(--text); }
.settings-nav-link.is-active { color: var(--text); font-weight: 500; background: var(--hover-bg); }
.settings-main { max-width: 760px; }
.set-section { scroll-margin-top: calc(var(--topbar-h) + 24px); margin-bottom: 40px; }
.set-head { margin-bottom: 12px; }
.set-title { font-size: 16px; font-weight: 600; }
.set-desc { margin-top: 2px; font-size: 13px; color: var(--text-3); max-width: 60ch; }
.set-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.provider-notice { margin: 12px 12px 0; }
.limit-value { font-size: 18px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.limit-value span { font-size: 12px; font-weight: 500; color: var(--text-3); }

.cred > summary { list-style: none; }
.cred > summary::-webkit-details-marker { display: none; }
.cred-sum { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.cred-sum:hover { background: var(--surface-2); }
.cred-name { font-weight: 500; color: var(--text); }
.cred-vendor { margin-left: 6px; font-weight: 400; font-size: 13px; color: var(--text-3); }
.cred-state { margin-left: auto; font-size: 12px; color: var(--text-3); }
.cred-chev { font-size: 11px; color: var(--text-4); transition: transform .15s ease; }
.cred[open] .cred-chev { transform: rotate(180deg); }
.cred-body { padding: 4px 18px 18px; }
.key-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--muted-bg); color: var(--text-3); font-size: 12px; font-weight: 500; }
.key-chip.is-set { background: var(--success-bg); color: var(--success); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.key-chip.is-removing { background: var(--danger-bg); color: var(--danger); }

@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .settings-nav-link { white-space: nowrap; }
}

/* ---------- Settings tabs ---------- */
.stabs { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; align-items: start; }
.stabs-list { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 2px; }
.stabs-list [role="tab"] {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius); text-align: left; color: var(--text-2);
  border: 1px solid transparent; transition: background-color .12s ease, color .12s ease;
}
.stabs-list [role="tab"] > i { width: 16px; text-align: center; font-size: 14px; color: var(--text-4); }
.stabs-text { display: flex; flex-direction: column; min-width: 0; }
.stabs-text > span { font-size: 14px; font-weight: 500; color: inherit; }
.stabs-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stabs-list [role="tab"]:hover { background: var(--hover-bg); color: var(--text); }
.stabs-list [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-xs); }
.stabs-list [role="tab"][aria-selected="true"] > i { color: var(--accent-text); }
.stabs-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 999px; background: var(--warning-solid); flex-shrink: 0; }
.stabs-panels { min-width: 0; max-width: 820px; }
.stabs-panel:focus { outline: none; }
.stabs-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius); }
.set-block { margin-top: 28px; }
.set-block:first-child { margin-top: 0; }
@media (max-width: 900px) {
  .stabs { grid-template-columns: 1fr; gap: 16px; }
  .stabs-list { position: sticky; top: var(--topbar-h); z-index: 15; display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .stabs-list::-webkit-scrollbar { display: none; }
  .stabs-list [role="tab"] { width: auto; padding: 7px 12px; gap: 8px; flex-shrink: 0; }
  .stabs-text small { display: none; }
  .stabs-dot { margin-left: 4px; }
}

/* AI summary card */
.ai-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 28px; }
.ai-summary-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ai-summary-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); font-size: 16px; flex-shrink: 0; }
.ai-summary-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; font-weight: 650; color: var(--text); line-height: 1.3; }
@media (max-width: 560px) { .ai-summary { flex-direction: column; align-items: stretch; } }

/* Selectable provider cards */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .pick-grid { grid-template-columns: 1fr; } }
.pick { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease; }
.pick:hover { border-color: var(--border-strong); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-icon { width: 32px; height: 32px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.pick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-title { font-weight: 500; color: var(--text); }
.pick-desc { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .status-pill { flex-shrink: 0; }
.pick-check { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }
.pick:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.pick:has(input:checked) .pick-icon { background: var(--accent-subtle); color: var(--accent-text); }
.pick:has(input:checked) .pick-check { display: inline-flex; }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Switch */
.switch-row { cursor: pointer; }
.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch-track { display: block; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); transition: background-color .15s ease; }
.switch-thumb { display: block; width: 18px; height: 18px; margin: 2px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Theme previews */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; }
@media (max-width: 560px) { .theme-grid { grid-template-columns: 1fr 1fr; } }
.theme-opt { display: grid; gap: 8px; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-prev { display: flex; height: 96px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); transition: border-color .12s ease, box-shadow .12s ease; }
.theme-opt:hover .theme-prev { border-color: var(--border-strong); }
.theme-opt input:checked + .theme-prev { border-color: var(--accent); box-shadow: var(--ring); }
.theme-opt input:focus-visible + .theme-prev { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-side { width: 26%; }
.tp-main { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.tp-bar { height: 8px; width: 55%; border-radius: 3px; }
.tp-card { flex: 1; border-radius: 4px; }
.tp-card.short { flex: .6; }
.theme-prev-light { background: #f7f7f8; } .theme-prev-light .tp-side { background: #fafafa; border-right: 1px solid #e4e4e7; }
.theme-prev-light .tp-bar { background: #d4d4d8; } .theme-prev-light .tp-card { background: #fff; border: 1px solid #e4e4e7; }
.theme-prev-dark { background: #0b0b0d; } .theme-prev-dark .tp-side { background: #17171a; border-right: 1px solid #27272a; }
.theme-prev-dark .tp-bar { background: #3f3f46; } .theme-prev-dark .tp-card { background: #131316; border: 1px solid #27272a; }
.theme-prev-system { background: linear-gradient(90deg, #f7f7f8 50%, #0b0b0d 50%); }
.theme-prev-system .tp-side { background: #fafafa; border-right: 1px solid #e4e4e7; }
.theme-prev-system .tp-bar { background: linear-gradient(90deg, #d4d4d8 50%, #3f3f46 50%); }
.theme-prev-system .tp-card { background: linear-gradient(90deg, #fff 50%, #131316 50%); border: 1px solid #a1a1aa55; }
.theme-opt-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text); }
.theme-radio { width: 14px; height: 14px; border-radius: 999px; border: 1.5px solid var(--border-strong); }
.theme-opt input:checked ~ .theme-opt-label .theme-radio { border: 4px solid var(--accent); }

/* API keys */
.new-key { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--success-border); background: var(--success-bg); border-radius: var(--radius-lg); }
.new-key-icon { color: var(--success-solid); margin-top: 3px; }
.new-key .kv-box { max-width: none; background: var(--surface); }
.new-key-form { margin-bottom: 16px; }
.data-table tr.is-dim td { color: var(--text-4); }
.dev-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (max-width: 560px) { .dev-links { grid-template-columns: 1fr; } }
.dialog-sm { width: min(440px, calc(100vw - 32px)); }

/* Webhooks */
.wh-list { display: grid; gap: 12px; }
.wh-card { padding: 16px 18px; }
.wh-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wh-url { font-size: 13.5px !important; font-weight: 600; color: var(--text); word-break: break-all; }
.wh-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.wh-deliveries { margin-top: 12px; }

/* Usage & account */
.usage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.account-head { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--border); }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; flex-shrink: 0; }
.account-name { font-size: 16px; font-weight: 600; color: var(--text); }

/* ---------- Library ---------- */
.lib-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px 160px auto; gap: 8px; margin-bottom: 12px; }
@media (max-width: 860px) { .lib-toolbar { grid-template-columns: 1fr 1fr; } .lib-search { grid-column: 1 / -1; } }
.lib-search { position: relative; }
.lib-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 13px; pointer-events: none; }
:root .app-body .lib-search .field { padding-left: 34px !important; height: 36px; }
#libFav[aria-pressed="true"] { background: var(--warning-bg) !important; color: var(--warning) !important; border-color: var(--warning-border) !important; }
.lib-origins { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lib-origins .chip i { font-size: 11px; }
.chip-count { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--muted-bg); color: var(--text-3); line-height: 18px; }
:root .chip.is-active .chip-count { background: rgba(255,255,255,.18); color: inherit; }
.lib-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.lib-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--border); }
.lib-item:first-child { border-top: 0; }
.lib-item:hover { background: var(--surface-2); }
.lib-icon { width: 36px; height: 36px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--text-2); font-size: 13px; }
.lib-title { display: block; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-title:hover { color: var(--accent-text); }
.lib-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.lib-preview { margin-top: 6px; font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .12s ease; }
.lib-item:hover .lib-actions, .lib-item:focus-within .lib-actions { opacity: 1; }
.lib-fav.is-on { color: var(--warning-solid); opacity: 1; }
.lib-item .lib-actions:has(.is-on) { opacity: 1; }
@media (max-width: 560px) { .lib-item { grid-template-columns: 1fr; } .lib-icon { display: none; } .lib-actions { opacity: 1; } }
.doc-text { flex: 1; padding: 16px; min-height: 240px; max-height: 70vh; overflow-y: auto; white-space: pre-wrap; font-size: 15px; line-height: 1.7; color: var(--text); }
.doc-muted { color: var(--text-2); font-size: 14px; }
.link-muted { color: var(--text-3) !important; text-decoration: none; }
.link-muted:hover { color: var(--text) !important; }

/* =====================================================================
   Public landing page
   ===================================================================== */
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 40px 0 72px; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); }
.lp-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.lp-title { margin-top: 18px; font-size: clamp(40px, 6vw, 64px); line-height: 1.04; font-weight: 700; letter-spacing: -0.04em; color: var(--text); }
.lp-lead { margin-top: 18px; font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 54ch; }
.lp-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.lp-note { margin-top: 16px; font-size: 13px; color: var(--text-3); }

.lp-demo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 12px; padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; }
.lp-demo-src, .lp-demo-out { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.lp-demo-outs { display: grid; gap: 10px; }
.lp-demo-out { padding: 12px 14px; gap: 7px; }
.lp-demo-label { font-size: 12px; color: var(--text-3); }
.lp-demo-label i { margin-right: 6px; }
.lp-demo-h { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 2px; }
.lp-demo-arrow { width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 6px var(--accent-subtle); }
.lp-line { display: block; height: 8px; border-radius: 4px; background: var(--muted-bg); }
.lp-line.w-50 { width: 50%; } .lp-line.w-60 { width: 60%; } .lp-line.w-70 { width: 70%; } .lp-line.w-80 { width: 80%; } .lp-line.w-90 { width: 90%; } .lp-line.w-95 { width: 95%; }
.lp-chip { display: inline-flex; align-items: center; gap: 6px; width: max-content; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--accent-subtle); color: var(--accent-text); font-size: 11.5px; font-weight: 600; }

.lp-section { padding: 64px 0; border-top: 1px solid var(--border); }
.lp-kicker { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.lp-h2 { margin-top: 6px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; color: var(--text); max-width: 24ch; }
.lp-sub { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--text-2); max-width: 56ch; }
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.lp-steps li { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.lp-step-n { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; }
.lp-steps h3, .lp-features h3 { margin-top: 14px; font-size: 16px; font-weight: 600; color: var(--text); }
.lp-steps p, .lp-features p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.lp-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--border); }
.lp-features article { padding: 22px; background: var(--surface); }
.lp-f-icon { width: 34px; height: 34px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--text-2); font-size: 14px; }
.lp-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin: 8px 0; padding: 40px; border-radius: 20px; background: #18181b; color: #fafafa; }
.lp-band .lp-kicker { color: #a5b4fc; }
.lp-band .lp-h2 { color: #fafafa; }
.lp-band .lp-sub { color: #a1a1aa; }
.lp-providers { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-providers li { padding: 8px 14px; border: 1px solid #3f3f46; border-radius: 999px; font-size: 14px; color: #e4e4e7; background: #27272a; }
.lp-dev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.lp-faq { display: grid; gap: 8px; margin-top: 24px; max-width: 820px; }
.lp-faq details { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.lp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; cursor: pointer; list-style: none; font-weight: 600; color: var(--text); }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary i { font-size: 12px; color: var(--text-4); transition: transform .15s ease; }
.lp-faq details[open] summary i { transform: rotate(45deg); }
.lp-faq details p { padding: 0 18px 18px; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.lp-cta { margin: 32px 0 8px; padding: 56px 24px; text-align: center; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; }
.lp-cta h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.lp-cta p { margin-top: 10px; color: var(--text-2); }
.lp-cta .lp-ctas { justify-content: center; }
@media (max-width: 1024px) {
  .lp-hero, .lp-dev, .lp-band { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lp-hero { padding: 16px 0 48px; }
  .lp-steps, .lp-features { grid-template-columns: minmax(0, 1fr); }
  .lp-demo { grid-template-columns: minmax(0, 1fr); }
  .lp-demo-arrow { justify-self: center; transform: rotate(90deg); }
  .lp-band { padding: 28px 20px; }
  .lp-section { padding: 48px 0; }
}

/* =====================================================================
   Legal & support pages (Privacy, Terms, Contact)
   ===================================================================== */
.legal { max-width: 1120px; }
.legal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.legal-title { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.legal-lead { margin-top: 10px; font-size: 16px; line-height: 1.6; color: var(--text-2); max-width: 62ch; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--text-3); }
.legal-meta i { margin-right: 6px; color: var(--text-4); }
.legal-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.legal-grid > *, .contact-grid > * { min-width: 0; }
.legal-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
/* site.css has an older .legal-toc card style; reset it. */
:root .legal-toc { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 1px; padding: 0 0 0 12px; background: none; border: 0; border-left: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.is-public .legal-toc { top: 84px; }
.legal-toc-h { margin: 0 0 8px -12px; padding-left: 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-4); }
.legal-toc a { position: relative; padding: 5px 0; font-size: 13px; color: var(--text-3); text-decoration: none; transition: color .12s ease; }
.legal-toc a:hover { color: var(--text); }
.legal-toc a.is-active { color: var(--text); font-weight: 500; }
.legal-toc a.is-active::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }

.legal-body { max-width: 72ch; font-size: 15.5px; line-height: 1.75; color: var(--text-2); }
.legal-body h2 { position: relative; scroll-margin-top: calc(var(--topbar-h) + 24px); margin: 44px 0 12px; font-size: 21px; line-height: 1.3; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.legal-body h3 { margin: 24px 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
.legal-body ul > li { position: relative; padding-left: 20px; margin: 6px 0; }
.legal-body ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 5px; height: 5px; border-radius: 999px; background: var(--text-4); }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-anchor { margin-left: 8px; font-weight: 500; color: var(--text-4); text-decoration: none; opacity: 0; transition: opacity .12s ease; }
.legal-body h2:hover .legal-anchor, .legal-anchor:focus-visible { opacity: 1; }
.legal-anchor:hover { color: var(--accent-text); }

.legal-summary { padding: 20px 22px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.legal-summary-h { font-size: 12px !important; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px !important; }
.legal-summary ul { margin: 0; display: grid; gap: 12px; }
.legal-summary ul > li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 0; margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.legal-summary ul > li::before { display: none; }
.legal-summary li > i { width: 30px; height: 30px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); font-size: 12px; }
.legal-summary-note { margin: 14px 0 0 !important; font-size: 12.5px; color: var(--text-3); }

.legal-dl { display: grid; margin: 0 0 16px; border-top: 1px solid var(--border); }
.legal-dl > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.legal-dl dt { font-size: 14px; font-weight: 600; color: var(--text); }
.legal-dl dd { font-size: 14.5px; line-height: 1.65; }
.legal-providers { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.legal-providers span { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--text); }
.legal-table { margin: 4px 0 16px; overflow-x: auto; }
.legal-table .data-table { font-size: 13px; }
.legal-body ul.legal-contact > li { padding-left: 0; display: flex; align-items: center; gap: 10px; }
.legal-body ul.legal-contact > li::before { display: none; }
.legal-contact i { width: 16px; text-align: center; color: var(--text-4); }

@media (max-width: 960px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  :root .legal-toc { position: static; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .legal-toc-h { grid-column: 1 / -1; margin-left: 0; padding-left: 0; }
  .legal-toc a.is-active::before { display: none; }
  .legal-title { font-size: 28px; }
}
@media (max-width: 560px) {
  :root .legal-toc { grid-template-columns: minmax(0, 1fr); }
  .legal-dl > div { grid-template-columns: 1fr; gap: 4px; }
  .legal-body { font-size: 15px; }
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-side { display: grid; gap: 16px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
@media (max-width: 640px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.topic { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease; }
.topic:hover { border-color: var(--border-strong); }
.topic input { position: absolute; opacity: 0; pointer-events: none; }
.topic-icon { width: 28px; height: 28px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--text-2); font-size: 12px; flex-shrink: 0; }
.topic-text { display: flex; flex-direction: column; min-width: 0; }
.topic-label { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-hint { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); background: var(--accent-subtle); }
.topic:has(input:checked) .topic-icon { background: var(--surface); color: var(--accent-text); }
.topic:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
:root .app-body .field[aria-invalid="true"] { border-color: var(--danger-solid) !important; }
.contact-done { padding: 48px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; outline: none; }
.contact-done .kv-box { width: 100%; max-width: 320px; }
.contact-done-icon { width: 52px; height: 52px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--success-bg); color: var(--success-solid); font-size: 20px; margin-bottom: 14px; }
.contact-done-title { font-size: 20px; font-weight: 650; color: var(--text); }
.contact-done-text { margin-top: 6px; color: var(--text-2); }
.contact-line { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; transition: background-color .12s ease; }
a.contact-line:hover { background: var(--surface-2); }
a.contact-line:hover .row-title { color: var(--accent-text); }
.contact-chev { margin-left: auto; font-size: 11px; color: var(--text-4); }

@media print {
  .sb, .topbar, .app-footer, .pub-nav, .pub-footer, .legal-head-actions, .legal-toc, .legal-anchor, .toast-stack { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content, .pub-content { padding: 0 !important; max-width: none !important; }
  .legal-grid { display: block; }
  .legal-body { max-width: none; color: #000; font-size: 11pt; }
  .legal-body h2 { break-after: avoid; }
  .legal-summary { box-shadow: none; border-color: #ccc; }
  :root body.app-body { background: #fff !important; }
}

/* =====================================================================
   Compose (Content > Create)
   ===================================================================== */
.compose { display: grid; gap: 16px; }
.compose-errors { margin: 0; }
.compose-details { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .compose-details { grid-template-columns: repeat(3, minmax(0, 1fr)); } .compose-title { grid-column: 1 / -1; } }
@media (max-width: 640px) { .compose-details { grid-template-columns: 1fr; } }

.compose-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .compose-editors { grid-template-columns: 1fr; } }
.editor { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: border-color .15s ease, box-shadow .15s ease; }
.editor:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.editor.is-drop { border-color: var(--accent); border-style: dashed; background: var(--accent-subtle); }
.editor.is-recording { border-color: var(--danger-solid); }
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.editor-title { font-size: 14px; font-weight: 600; color: var(--text); }
.editor-tools { display: flex; align-items: center; gap: 4px; }
.editor-stage { position: relative; flex: 1; display: flex; }
:root .app-body .editor-area {
  flex: 1; width: 100%; min-height: 360px; resize: vertical;
  padding: 16px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  background: transparent !important; color: var(--text) !important;
  font-size: 15px; line-height: 1.7; outline: none;
}
:root .app-body .editor-area:focus { box-shadow: none !important; border: 0 !important; }
.editor-foot { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.editor-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.editor-busy[hidden] { display: none; }
.editor-busy-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.editor-busy-card > i { color: var(--accent-text); font-size: 16px; }
.rec { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 500; }
.rec.hidden { display: none; }
.rec-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--danger-solid); animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .35; } }
.btn[aria-pressed="true"] { background: var(--danger-bg); color: var(--danger); }

/* =====================================================================
   Usage dashboard & insights
   Chart colours were checked with the dataviz palette validator
   (CVD and normal-vision separation, contrast) in both themes.
   ===================================================================== */
:root {
  --viz-1: #2a78d6;          /* series: succeeded / magnitude */
  --viz-fail: #d03b3b;       /* status: critical */
  --viz-grid: #ececef;
  --viz-axis: #d4d4d8;
  --hm-0: var(--muted-bg);
  --hm-1: #86b6ef; --hm-2: #5598e7; --hm-3: #2a78d6; --hm-4: #1c5cab; --hm-5: #0d366b;
}
:root[data-theme="dark"] {
  --viz-1: #3987e5;
  --viz-grid: #232327;
  --viz-axis: #34343a;
  --hm-1: #184f95; --hm-2: #256abf; --hm-3: #3987e5; --hm-4: #6da7ec; --hm-5: #b7d3f6;
}

.segmented-links a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-3); text-decoration: none; }
.segmented-links a:hover { color: var(--text); }
.segmented-links a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-label i { margin-right: 4px; color: var(--text-4); }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta i { font-size: 10px; }
.delta.is-up { color: var(--success); }
.delta.is-down { color: var(--danger); }
.delta.is-flat { color: var(--text-3); }

.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .dash-2-1 { grid-template-columns: 1fr; } .dash-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .dash-3 { grid-template-columns: 1fr; } }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--border); }

/* Daily stacked columns */
.vz-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.vz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.vz-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vz-key.vz-ok { background: var(--viz-1); }
.vz-key.vz-fail { background: var(--viz-fail); }
.vz-fail-ico { color: var(--viz-fail); font-size: 11px; }
.vz-daily { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.vz-y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-6px); }
.vz-plot { position: relative; min-width: 0; }
.vz-grid { position: absolute; inset: 0 0 auto 0; height: 200px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vz-grid span { height: 1px; background: var(--viz-grid); }
.vz-grid span:last-child { background: var(--viz-axis); }
.vz-cols { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; }
.vz-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; border-radius: 4px 4px 0 0; outline-offset: 1px; cursor: default; }
.vz-col:hover, .vz-col.is-hot { background: color-mix(in srgb, var(--text) 5%, transparent); }
.vz-stack { width: 100%; display: flex; flex-direction: column; gap: 2px; min-height: 3px; }
.vz-seg { display: block; min-height: 2px; }
.vz-seg:first-child { border-radius: 4px 4px 0 0; }
.vz-seg.vz-ok { background: var(--viz-1); }
.vz-seg.vz-fail { background: var(--viz-fail); }
.vz-x { display: flex; gap: 2px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.vz-x span { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: visible; }
.vz-table { margin-top: 12px; font-size: 13px; }
.vz-table summary { cursor: pointer; color: var(--text-3); font-size: 12px; width: max-content; }
.vz-table summary:hover { color: var(--text); }
.vz-table table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.vz-table th, .vz-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.vz-table th { font-weight: 500; color: var(--text-3); font-size: 12px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* Ranked bars */
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto 40px; align-items: center; gap: 10px; padding: 5px 6px; margin: 0 -6px; border-radius: var(--radius-sm); font-size: 13px; }
.bar-row:hover, .bar-row.is-hot { background: var(--surface-2); }
.bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 8px; border-radius: 4px; background: var(--muted-bg); overflow: hidden; display: block; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--viz-1); border-radius: 4px; }
.bar-value { color: var(--text); font-weight: 500; text-align: right; }
.bar-share { color: var(--text-3); text-align: right; font-size: 12px; }
.share { display: grid; grid-template-columns: 1fr 36px; align-items: center; gap: 8px; }

/* Heatmap */
.hm { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.hm-hour { font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: visible; }
.hm-day { font-size: 11px; color: var(--text-3); }
.hm-cell { display: block; aspect-ratio: 1 / 1; min-height: 12px; border-radius: 3px; background: var(--hm-0); }
.hm .hm-cell:hover, .hm .hm-cell.is-hot { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-0 { background: var(--hm-0); } .hm-1 { background: var(--hm-1); } .hm-2 { background: var(--hm-2); }
.hm-3 { background: var(--hm-3); } .hm-4 { background: var(--hm-4); } .hm-5 { background: var(--hm-5); }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.hm-legend .hm-cell { width: 12px; min-height: 12px; }
.hm-legend span:first-child { margin-right: 4px; } .hm-legend span:last-child { margin-left: 4px; }
@media (max-width: 640px) { .hm-hour { visibility: hidden; } .hm { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; } .hm-cell { min-height: 8px; border-radius: 2px; } }

/* Tooltip */
.vz-tip { position: fixed; z-index: 90; display: grid; gap: 2px; padding: 8px 10px; max-width: 260px; pointer-events: none; background: var(--text); color: var(--bg); border-radius: var(--radius); font-size: 12px; box-shadow: var(--shadow-md); }
.vz-tip[hidden] { display: none; }
.vz-tip strong { font-weight: 600; }

/* Insights */
.insight-stack { display: grid; gap: 10px; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .insight-grid { grid-template-columns: 1fr; } }
.insight { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.insight-stack .insight { padding: 12px; background: var(--surface-2); }
.insight-icon { width: 32px; height: 32px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--muted-bg); color: var(--text-2); }
.insight-level { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); }
.insight-title { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--text); }
.insight-text { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.insight-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 13px; }
.insight.is-good .insight-icon { background: var(--success-bg); color: var(--success); }
.insight.is-good .insight-level { color: var(--success); }
.insight.is-warning { border-color: var(--warning-border); }
.insight.is-warning .insight-icon { background: var(--warning-bg); color: var(--warning); }
.insight.is-warning .insight-level { color: var(--warning); }
.insight.is-critical { border-color: var(--danger-border); }
.insight.is-critical .insight-icon { background: var(--danger-bg); color: var(--danger); }
.insight.is-critical .insight-level { color: var(--danger); }
.insight.is-info .insight-icon { background: var(--info-bg); color: var(--info); }

/* Data tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 9px 16px; text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.status-pill.is-fail { color: var(--danger); background: var(--danger-bg); }
.status-pill i { font-size: 10px; }

.stat-list { display: grid; grid-template-columns: 1fr 1fr; }
.stat-list > div { padding: 12px 18px; border-top: 1px solid var(--border); }
.stat-list > div:nth-child(-n+2) { border-top: 0; }
.stat-list > div:nth-child(odd) { border-right: 1px solid var(--border); }
.stat-list dt { font-size: 12px; color: var(--text-3); }
.stat-list dd { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Developer pages: API reference & playground
   ===================================================================== */
:root { --code-bg: #18181b; --code-fg: #e4e4e7; --code-muted: #a1a1aa; --code-border: #27272a; }
:root[data-theme="dark"] { --code-bg: #0e0e11; --code-fg: #e4e4e7; --code-muted: #8b8b94; --code-border: #27272a; }

.m-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 20px; padding: 0 6px; border-radius: 4px; font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.m-get { background: var(--info-bg); color: var(--info); }
.m-post { background: var(--success-bg); color: var(--success); }
.m-delete { background: var(--danger-bg); color: var(--danger); }
.int-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
@media (max-width: 1100px) { .int-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .int-cards { grid-template-columns: minmax(0, 1fr); } }
.int-main { max-width: 920px; }
.int-main .code-tabs-bar button[data-tab] { height: 30px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--code-muted); border-bottom: 2px solid transparent; }
.int-main .code-tabs-bar button[data-tab]:hover { color: var(--code-fg); }
.int-main .code-tabs-bar button[data-tab].is-active { color: var(--code-fg); border-bottom-color: var(--code-fg); }
.int-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--text-2); }
.int-list li { position: relative; padding-left: 18px; }
.int-list li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 5px; height: 5px; border-radius: 999px; background: var(--text-4); }
.m-ok { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--success); font-weight: 600; }
kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; font: 500 11px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); background: var(--surface); }

pre.code { margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); border-radius: var(--radius); font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
pre.code code { background: none; padding: 0; color: inherit; font: inherit; }
pre.code { scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; }
pre.code::-webkit-scrollbar { height: 8px; width: 8px; background: transparent; }
pre.code::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; border: 2px solid var(--code-bg); }
pre.code::-webkit-scrollbar-track { background: transparent; }
pre.code-muted { color: var(--code-muted); }
.code-caption { margin: 12px 0 6px; font-size: 12px; color: var(--text-3); }

/* Reference layout */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; display: grid; gap: 1px; padding-bottom: 16px; }
.is-public .docs-nav { top: 80px; }
.docs-nav-h { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.docs-nav-h:first-child { margin-top: 0; }
.docs-nav a { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-3); text-decoration: none; }
.docs-nav a .m-tag { min-width: 36px; height: 16px; font-size: 9.5px; }
.docs-nav a:hover { background: var(--hover-bg); color: var(--text); }
.docs-nav a.is-active { background: var(--hover-bg); color: var(--text); font-weight: 500; }
.docs-main { min-width: 0; max-width: 1040px; }
.docs-section { scroll-margin-top: calc(var(--topbar-h) + 20px); padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.docs-section > p { color: var(--text-2); margin-bottom: 12px; max-width: 70ch; }
.docs-section p code, .docs-section td code, .params code { font-size: 12.5px; }
.docs-h2 { font-size: 20px; font-weight: 650; margin-bottom: 8px; }
.docs-h3 { font-size: 17px; font-weight: 600; }
.docs-h4 { font-size: 13px; font-weight: 600; margin: 4px 0 8px; color: var(--text); }
.docs-group { margin: 8px 0 20px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }

.kv-box { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 640px; }
.kv-label { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.kv-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none !important; padding: 0 !important; font-size: 13px !important; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; max-width: 640px; }
.facts > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.facts-v { font-size: 20px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.facts-l { font-size: 12px; color: var(--text-3); }
.callout { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--info-border); background: var(--info-bg); border-radius: var(--radius); font-size: 13px; color: var(--text-2); max-width: 70ch; }
.callout > i { color: var(--info); margin-top: 3px; }
.docs-section .panel { max-width: 720px; }

.endpoint-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.route { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.route code { background: none; padding: 0; font-size: 14px; color: var(--text); word-break: break-all; }
.endpoint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.endpoint-code { position: sticky; top: calc(var(--topbar-h) + 20px); min-width: 0; }
.params { border-top: 1px solid var(--border); margin-bottom: 16px; }
.params > div { padding: 10px 0; border-bottom: 1px solid var(--border); }
.params dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.params dd { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.p-type { font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-3); }
.p-req { font-size: 11px; font-weight: 600; color: var(--warning); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chips code { font-size: 11.5px; }
.disclosure { margin-top: 4px; font-size: 13px; }
.disclosure summary { cursor: pointer; color: var(--text-2); font-weight: 500; }
.id-list { margin-top: 8px; max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.id-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.id-list li:first-child { border-top: 0; }
.id-list code { font-size: 11px; white-space: nowrap; }

.code-tabs { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--code-border); }
.code-tabs pre.code { border: 0; border-radius: 0; }
.code-tabs-bar { display: flex; align-items: center; gap: 2px; padding: 4px 4px 0 4px; background: var(--code-bg); border-bottom: 1px solid var(--code-border); }
.code-tabs-bar button[data-lang] { height: 30px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--code-muted); border-bottom: 2px solid transparent; }
.code-tabs-bar button[data-lang]:hover { color: var(--code-fg); }
.code-tabs-bar button.is-active { color: var(--code-fg); border-bottom-color: var(--code-fg); }
.code-copy { margin-left: auto; width: 30px; height: 28px; color: var(--code-muted); border-radius: 4px; }
.code-copy:hover { color: var(--code-fg); background: rgba(255,255,255,.06); }

@media (max-width: 1180px) { .endpoint-grid { grid-template-columns: 1fr; } .endpoint-code { position: static; } }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 16px; }
  .docs-nav { position: static; max-height: none; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .docs-nav-h { display: none; }
  .docs-nav a { white-space: nowrap; border: 1px solid var(--border); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Playground */
.pg { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-list { position: sticky; top: calc(var(--topbar-h) + 20px); padding: 6px; display: grid; gap: 1px; }
.pg-list-h { margin: 10px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); }
.pg-list-h:first-child { margin-top: 4px; }
.pg-ep { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border-radius: var(--radius-sm); text-align: left; font-size: 13px; color: var(--text-2); }
.pg-ep .m-tag { min-width: 38px; height: 17px; font-size: 10px; }
.pg-ep:hover { background: var(--hover-bg); color: var(--text); }
.pg-ep.is-active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 500; }
.pg-ep-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.urlbar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.urlbar-url { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: none !important; padding: 0 !important; font-size: 13px !important; color: var(--text) !important; }
:root .app-body textarea.code-input { min-height: 220px; font-size: 13px !important; line-height: 1.6; resize: vertical; tab-size: 2; }
pre.code-response { max-height: 560px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.j-key { color: #93c5fd; } .j-str { color: #86efac; } .j-num { color: #fcd34d; } .j-bool, .j-null { color: #f9a8d4; }
.status-pill.is-warn i { font-size: 10px; }
@media (max-width: 1280px) { .pg-work { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .pg { grid-template-columns: 1fr; }
  .pg-list { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .pg-list-h { display: none; }
  .pg-ep { width: auto; white-space: nowrap; border: 1px solid var(--border); }
}

/* ---------------- Engagement ---------------- */
.kpi-grid.kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpi-grid.kpi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.eng-compose { display: grid; gap: 18px; }
.eng-platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.eng-platform { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.eng-platform i { width: 14px; text-align: center; color: var(--text-3); }
.eng-platform:hover { background: var(--hover-bg); color: var(--text); }
.eng-platform[aria-checked="true"] { border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.eng-platform[aria-checked="true"] i { color: var(--accent); }
.eng-platform:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eng-text { min-height: 200px; resize: vertical; line-height: 1.55; }
#charCount.is-over { color: var(--danger); font-weight: 500; }
.eng-ideas { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px; }
.eng-ideas-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.eng-side { display: grid; gap: 16px; }
.eng-icon { width: 16px; text-align: center; color: var(--text-3); }
.eng-plat { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text); }
.eng-content { min-width: 220px; max-width: 420px; }
.eng-top { list-style: none; margin: 0; padding: 4px 0; }
.eng-top li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--border); }
.eng-top li:first-child { border-top: 0; }
.eng-top-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); text-decoration: none; }
.eng-top-title:hover { text-decoration: underline; }
.eng-top-rate { font-size: 13px; font-weight: 600; color: var(--text); }
.eng-metrics { display: grid; gap: 14px; }
.eng-rate { display: flex; flex-direction: column; justify-content: flex-end; }
.eng-rate-value { font-size: 20px; font-weight: 600; color: var(--text); line-height: 38px; }
@media (max-width: 480px) { .eng-metrics .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

.eng-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12px; color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.eng-link i { font-size: 10px; }

/* Engagement: section picker, rewrite tools, thread preview, post filters */
.eng-sections { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.eng-section-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eng-section-chips .chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.eng-tools-note { margin-left: auto; }
.eng-thread { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px; }
.eng-thread-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eng-thread-parts li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.eng-thread-parts .eng-part-n { width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--accent-subtle); color: var(--accent-text); }
.eng-thread-parts .eng-part-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.eng-thread-parts .eng-part-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.eng-thread-parts .eng-part-meta.is-over { color: var(--danger); font-weight: 600; }
.eng-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.eng-filters .chip i { margin-right: 4px; }
.hint.is-over { color: var(--danger); font-weight: 600; }


/* ---------------- FAQ ---------------- */
.faq-head { padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.faq-head .eyebrow { margin-bottom: 10px; }
.faq-search { position: relative; max-width: 560px; margin-top: 22px; }
.faq-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 14px; pointer-events: none; }
.faq-search .field { height: 46px; padding-left: 40px !important; padding-right: 44px !important; font-size: 15px; border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.faq-search .field::-webkit-search-cancel-button { cursor: pointer; }
.faq-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-3); font: 500 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; pointer-events: none; }
.faq-search .field:focus ~ .faq-kbd, .faq-search .field:not(:placeholder-shown) ~ .faq-kbd { display: none; }
.faq-status { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.faq-toc a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.faq-toc a.is-dim { opacity: .45; }
.faq-toc-count { font-size: 11px; font-weight: 500; color: var(--text-4); font-variant-numeric: tabular-nums; }
.faq-main { max-width: 760px; }
.faq-group { scroll-margin-top: calc(var(--topbar-h) + 24px); margin-bottom: 36px; }
.is-public .faq-group { scroll-margin-top: 84px; }
.faq-h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.faq-h2-icon { width: 30px; height: 30px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); font-size: 13px; }
.faq-list { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.faq-item { scroll-margin-top: calc(var(--topbar-h) + 24px); border-top: 1px solid var(--border); }
.is-public .faq-item { scroll-margin-top: 84px; }
.faq-list > .faq-item:first-child, .faq-list > .faq-item[hidden] + .faq-item:not([hidden]):first-of-type { border-top: 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; cursor: pointer; list-style: none; transition: background .12s ease; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--hover-bg); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-q { font-size: 15px; font-weight: 550; line-height: 1.45; color: var(--text); }
.faq-q mark { background: var(--accent-subtle); color: inherit; border-radius: 3px; padding: 0 1px; }
.faq-chev { flex: none; font-size: 12px; color: var(--text-4); transition: transform .18s ease; }
.faq-item[open] .faq-chev { transform: rotate(180deg); color: var(--text-2); }
.faq-item[open] summary { padding-bottom: 8px; }
.faq-a { padding: 0 20px 18px; font-size: 14.5px; line-height: 1.7; color: var(--text-2); max-width: 68ch; }
.faq-a p { margin: 0 0 10px; }
.faq-a strong { color: var(--text); font-weight: 600; }
.faq-a code { font-size: 13px; padding: 1px 5px; border-radius: 4px; background: var(--muted-bg); }
.faq-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.faq-link:hover { color: var(--accent-text); }
.faq-link i { font-size: 11px; }
.faq-empty { padding: 48px 24px; margin-bottom: 36px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.faq-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.faq-help-title { font-size: 17px; font-weight: 650; color: var(--text); }
.faq-help-text { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--text-3); max-width: 46ch; }
.faq-help-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .faq .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .faq-toc { display: none !important; }
}
@media (max-width: 480px) {
  .faq-item summary { padding: 14px 16px; }
  .faq-a { padding: 0 16px 16px; }
  .faq-help { padding: 20px; }
}

/* ---------------- Blog ---------------- */
.blog { max-width: 1120px; }
.blog-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.blog-head .eyebrow { margin-bottom: 10px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.blog-cats a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.blog-cats a span { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.blog-cats a:hover { background: var(--hover-bg); color: var(--text); }
.blog-cats a.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.blog-cats a.is-active span { color: inherit; opacity: .7; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--text-3); }
.blog-meta > span + span::before { content: "\00B7"; margin-right: 10px; color: var(--text-4); }
.blog-cat { font-weight: 600; color: var(--accent-text); }
.blog-stretch { color: inherit; text-decoration: none; }
.blog-stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.blog-stretch:focus-visible { outline: none; }
.blog-stretch:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }

.blog-feature { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.blog-feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.blog-feature-copy { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 36px; }
.blog-feature-title { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; color: var(--text); }
.blog-feature-desc { font-size: 15.5px; line-height: 1.65; color: var(--text-2); max-width: 52ch; }
.blog-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.blog-more i { font-size: 12px; transition: transform .15s; }
.blog-feature:hover .blog-more i { transform: translateX(3px); }
.blog-feature-art { border-left: 1px solid var(--border); background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px; }

.blog-art { height: 100%; min-height: 240px; display: grid; grid-template-columns: auto 64px auto; align-items: center; justify-content: center; padding: 28px; }
.blog-art-src { width: 72px; height: 72px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--accent-text); font-size: 26px; }
.blog-art-lines { height: 100px; background:
    linear-gradient(to top right, transparent calc(50% - 1px), var(--border-strong) calc(50% - 1px), var(--border-strong) calc(50% + 1px), transparent calc(50% + 1px)) top / 100% 50% no-repeat,
    linear-gradient(var(--border-strong), var(--border-strong)) center / 100% 2px no-repeat,
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--border-strong) calc(50% - 1px), var(--border-strong) calc(50% + 1px), transparent calc(50% + 1px)) bottom / 100% 50% no-repeat; }
.blog-art-chips { display: grid; gap: 10px; }
.blog-art-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.blog-art-chip i { width: 14px; text-align: center; color: var(--text-3); }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.blog-card2 { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s, transform .15s; }
.blog-card2:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.blog-card2-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); font-size: 14px; margin-bottom: 4px; }
.blog-card2-title { font-size: 17px; line-height: 1.35; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
.blog-card2-desc { font-size: 14px; line-height: 1.6; color: var(--text-3); flex: 1; }
.blog-card2-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.blog-card2-foot i { font-size: 11px; color: var(--text-4); transition: transform .15s, color .15s; }
.blog-card2:hover .blog-card2-foot i { transform: translateX(3px); color: var(--accent-text); }

.blog-follow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 40px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.blog-follow-title { font-size: 18px; font-weight: 650; color: var(--text); }
.blog-follow-text { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--text-3); max-width: 56ch; }

/* Article */
.post { max-width: 1120px; }
.post-crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; }
.post-crumbs a { color: var(--text-3); text-decoration: none; }
.post-crumbs a:hover { color: var(--text); }
.post-crumbs i { font-size: 9px; color: var(--text-4); }
.post-head { max-width: 760px; margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.post-title { font-size: 40px; line-height: 1.12; font-weight: 750; letter-spacing: -0.035em; color: var(--text); text-wrap: balance; }
.post-lead { margin-top: 14px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; font-size: 13.5px; color: var(--text-3); }
.post-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.post-avatar { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--bg); font-size: 11px; }
.post-share { display: inline-flex; gap: 2px; margin-left: auto; }
.post-grid { grid-template-columns: 200px minmax(0, 1fr); }
.post-toc a { line-height: 1.4; }
.post-main { max-width: 720px; }

.post-body { font-size: 16.5px; line-height: 1.75; color: var(--text-2); }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { scroll-margin-top: calc(var(--topbar-h) + 24px); margin: 44px 0 12px; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.is-public .post-body h2 { scroll-margin-top: 84px; }
.post-body h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 650; color: var(--text); }
.post-body p { margin: 0 0 18px; }
.post-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 22px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin: 6px 0; padding-left: 4px; }
.post-body li::marker { color: var(--text-4); }
.post-body ol li::marker { font-weight: 600; color: var(--text-3); }
.post-body blockquote { margin: 0 0 20px; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--text); font-style: italic; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; padding: 2px 6px; border-radius: 5px; background: var(--muted-bg); color: var(--text); }
.post-body pre { position: relative; margin: 0 0 22px; padding: 16px 18px; border-radius: var(--radius); background: #0b0b0f; color: #e4e4e7; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.post-body pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.post-copy { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #a1a1aa; cursor: pointer; opacity: 0; transition: opacity .15s; }
.post-body pre:hover .post-copy, .post-copy:focus-visible { opacity: 1; }
.post-copy:hover { color: #fff; }
.post-body table { width: 100%; margin: 0 0 24px; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.post-body th, .post-body td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.post-body th { font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface-2); border-top: 1px solid var(--border); white-space: nowrap; }
.post-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }

.post-cta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 40px 0 28px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.post-cta-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); }
.post-cta-title { font-size: 15px; font-weight: 650; color: var(--text); }
.post-cta-text { margin-top: 2px; font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.post-pager-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, background .15s; }
.post-pager-link:hover { border-color: var(--border-strong); background: var(--hover-bg); }
.post-pager-link.is-next { text-align: right; grid-column: 2; }
.post-pager-dir { font-size: 12px; color: var(--text-3); }
.post-pager-dir i { font-size: 10px; }
.post-pager-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text); }
.post-related { max-width: 1120px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.post-related-title { margin-bottom: 16px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }

@media (max-width: 960px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-feature { grid-template-columns: minmax(0, 1fr); }
  .blog-feature-art { border-left: 0; border-top: 1px solid var(--border); }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-toc { display: none !important; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-feature-copy { padding: 24px; }
  .blog-feature-title { font-size: 23px; }
  .blog-art { min-height: 200px; padding: 20px; grid-template-columns: auto 36px auto; }
  .blog-art-src { width: 56px; height: 56px; font-size: 20px; border-radius: 14px; }
  .post-title { font-size: 30px; }
  .post-lead { font-size: 16.5px; }
  .post-body { font-size: 16px; }
  .post-share { margin-left: 0; }
  .post-cta { grid-template-columns: minmax(0, 1fr); }
  .post-cta-icon { display: none; }
  .post-pager { grid-template-columns: minmax(0, 1fr); }
  .post-pager-link.is-next { grid-column: 1; }
}

/* Landing: hero example */
.lp-ex { margin: 0; display: grid; gap: 10px; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px; box-shadow: var(--shadow-sm); }
.lp-ex-src { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.lp-ex-label { font-size: 12px; color: var(--text-3); }
.lp-ex-label i { margin-right: 6px; }
.lp-ex-title { margin-top: 6px; font-size: 15px; font-weight: 650; color: var(--text); }
.lp-ex-text { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.lp-ex-arrow { justify-self: center; width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent, #fff); font-size: 12px; box-shadow: var(--shadow-sm); }
.lp-ex-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.lp-ex-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-ex-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none; font-size: 13px; font-weight: 500; color: var(--text-3); cursor: pointer; }
.lp-ex-tabs button:hover { color: var(--text); }
.lp-ex-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.lp-ex-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lp-ex-out { min-height: 196px; padding: 16px 18px; font-size: 14px; line-height: 1.6; color: var(--text); }
.lp-ex-out p + p { margin-top: 8px; }
.lp-ex-subject { font-weight: 600; }
.lp-ex-note { font-size: 12px; color: var(--text-3); text-align: center; }
.lp-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.mt-7 { margin-top: 28px; }
@media (max-width: 640px) { .lp-ex { padding: 14px; } .lp-ex-tabs button { padding: 0 9px; font-size: 12.5px; } .lp-ex-out { min-height: 0; } }

/* ---------------- About ---------------- */
.about { max-width: 1120px; }
.about-hero { max-width: 820px; padding: 24px 0 40px; }
.about-hero .eyebrow { margin-bottom: 14px; }
.about-title { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; font-weight: 750; letter-spacing: -0.04em; color: var(--text); text-wrap: balance; }
.about-lead { margin-top: 18px; font-size: 18px; line-height: 1.65; color: var(--text-2); max-width: 62ch; }
.about-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--border); overflow: hidden; }
.about-facts > div { padding: 22px; background: var(--surface); }
.about-fact-v { font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.about-fact-l { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.about-story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; padding: 64px 0; border-bottom: 1px solid var(--border); }
.about-prose { font-size: 16.5px; line-height: 1.75; color: var(--text-2); }
.about-prose p + p { margin-top: 16px; }
.about-section { padding: 64px 0; border-bottom: 1px solid var(--border); }
.about-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--border); overflow: hidden; }
.about-principles article { padding: 24px; background: var(--surface); }
.about-principles h3 { margin-top: 14px; font-size: 16px; font-weight: 600; color: var(--text); }
.about-principles p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.about-for { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.about-for > div { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.about-for h3 { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 600; color: var(--text); }
.about-for h3 i { width: 16px; text-align: center; color: var(--accent-text); }
.about-for p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.about-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 48px; padding: 32px; border: 1px solid var(--border); border-radius: 20px; background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px; }
.about-cta-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.about-cta-text { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); max-width: 58ch; }
@media (max-width: 960px) {
  .about-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-story { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .about-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-for { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .about-principles { grid-template-columns: minmax(0, 1fr); }
  .about-story, .about-section { padding: 44px 0; }
  .about-cta { padding: 22px; }
}

/* ---------------- How it works ---------------- */
.hiw { max-width: 1120px; }
.hiw-hero { max-width: 860px; padding: 24px 0 24px; }
.hiw-hero .eyebrow { margin-bottom: 14px; }
.hiw-overview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hiw-overview a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: border-color .12s, color .12s; }
.hiw-overview a:hover { border-color: var(--border-strong); color: var(--text); }
.hiw-n { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; }
.hiw-step { scroll-margin-top: calc(var(--topbar-h) + 16px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 64px 0; border-bottom: 1px solid var(--border); }
.is-public .hiw-step { scroll-margin-top: 72px; }
.hiw-step:nth-of-type(even) .hiw-visual { order: -1; }
.hiw-kicker { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.hiw-h2 { margin-top: 6px; margin-bottom: 14px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.hiw-copy > p { font-size: 16px; line-height: 1.7; color: var(--text-2); }
.hiw-copy > p + p { margin-top: 12px; }
.hiw-copy strong { color: var(--text); font-weight: 600; }
.hiw-list { display: grid; gap: 10px; margin-top: 18px; }
.hiw-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; font-size: 15px; line-height: 1.55; color: var(--text); }
.hiw-list i { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); font-size: 12px; }
.hiw-facts { display: grid; gap: 1px; margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--border); overflow: hidden; }
.hiw-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 16px; background: var(--surface); }
.hiw-facts dt { font-size: 14px; font-weight: 650; color: var(--text); }
.hiw-facts dd { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.hiw-note { margin-top: 16px !important; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 14px !important; line-height: 1.6 !important; }
.hiw-visual { padding: 28px; border: 1px solid var(--border); border-radius: 20px; background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px; }
.hiw-mock { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.hiw-mock-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hiw-mock-actions { display: inline-flex; gap: 12px; color: var(--text-4); }
.hiw-mock-body { display: grid; gap: 8px; padding: 16px; }
.hiw-mock-h { font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: 4px; }
.hiw-mock-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-3); }
.hiw-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--text-2); font-weight: 500; }
.hiw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hiw-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.hiw-chip.is-on { border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.hiw-chip.is-on i { color: var(--accent-text); }
.hiw-mock-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.hiw-mock-k { color: var(--text-3); }
.hiw-select { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.hiw-select i { font-size: 10px; color: var(--text-4); }
.hiw-flow { display: grid; grid-template-columns: auto 28px auto 28px auto; align-items: center; justify-content: center; gap: 4px; }
.hiw-node { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px; min-width: 92px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); font-size: 12.5px; font-weight: 500; color: var(--text); text-align: center; }
.hiw-node > i { font-size: 18px; color: var(--text-3); }
.hiw-node.is-brand { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.hiw-node.is-sm { flex-direction: row; padding: 10px 12px; min-width: 0; }
.hiw-node.is-sm > i { font-size: 13px; }
.hiw-targets { display: grid; gap: 8px; }
.hiw-arrow { text-align: center; color: var(--text-4); font-size: 12px; }
.hiw-lib { list-style: none; margin: 0; padding: 0; }
.hiw-lib li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text); }
.hiw-lib li:first-child { border-top: 0; }
.hiw-lib li > i { color: var(--text-3); text-align: center; }
.hiw-lib li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hiw-badge { padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); font-size: 11.5px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hiw-ex { padding: 1px 8px; border-radius: 999px; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 600; }
.hiw-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.hiw-kpis div { display: grid; gap: 2px; padding: 12px 14px; border-left: 1px solid var(--border); }
.hiw-kpis div:first-child { border-left: 0; }
.hiw-kpis span { font-size: 11.5px; color: var(--text-3); }
.hiw-kpis strong { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.hiw-more { border-bottom: 0; }
@media (max-width: 900px) {
  .hiw-step { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 48px 0; }
  .hiw-step:nth-of-type(even) .hiw-visual { order: 0; }
}
@media (max-width: 560px) {
  .hiw-visual { padding: 14px; }
  .hiw-flow { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .hiw-arrow i { transform: rotate(90deg); }
  .hiw-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------------- Press ---------------- */
.press-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.press-main { min-width: 0; }
.press-section { margin-bottom: 44px; }
.press-h2 { margin-bottom: 14px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.press-p { margin: -4px 0 14px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.press-quote { margin-bottom: 12px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.press-quote-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.press-label { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.press-quote p { font-size: 15px; line-height: 1.7; color: var(--text); }
.press-dl > div { grid-template-columns: 150px minmax(0, 1fr); }
.press-dl dd { color: var(--text-2); }
.press-assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.press-asset { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.press-asset.is-wide { grid-column: 1 / -1; }
.press-asset-art { display: flex; align-items: center; justify-content: center; min-height: 150px; padding: 24px; border-bottom: 1px solid var(--border); }
.press-asset-art.is-light { background: #ffffff; }
.press-asset-art.is-dark { background: #18181b; }
.press-asset-art.is-photo { padding: 0; background: var(--surface-2); }
.press-asset-art img { max-width: 100%; height: auto; }
.press-asset figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text); }
.press-dl-links { display: inline-flex; gap: 6px; }
.press-dl-links a { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.press-dl-links a:hover { background: var(--hover-bg); color: var(--text); }
.press-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.press-color { display: grid; gap: 2px; padding: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); text-align: left; overflow: hidden; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.press-color:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.press-color:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.press-swatch { display: block; height: 72px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.press-color-name { padding: 0 12px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.press-color-hex { padding: 0 12px; font: 500 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); }
.press-color-use { padding: 4px 12px 0; font-size: 12px; line-height: 1.45; color: var(--text-3); }
.press-rules { display: grid; gap: 10px; }
.press-rules li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.press-rules strong { color: var(--text); }
.press-rules .fa-check { margin-top: 4px; color: var(--success); }
.press-rules .fa-xmark { margin-top: 4px; color: var(--danger); }
.press-side { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 16px; }
.is-public .press-side { top: 84px; }
.press-contact { display: grid; gap: 10px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.press-contact-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent-text); }
.press-contact-title { font-size: 17px; font-weight: 650; color: var(--text); }
.press-contact-text { font-size: 14px; line-height: 1.6; color: var(--text-3); margin-bottom: 4px; }
.press-contact .btn { justify-content: center; overflow: hidden; text-overflow: ellipsis; }
.press-links { display: grid; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.press-links a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); text-decoration: none; }
.press-links a:hover { background: var(--hover-bg); color: var(--text); }
.press-links i { width: 16px; text-align: center; color: var(--text-4); }
@media (max-width: 960px) {
  .press-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .press-side { position: static; }
  .press-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .press-assets { grid-template-columns: minmax(0, 1fr); }
  .press-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Settings: data and backups */
.bk-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bk-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.bk-label { font-size: 12.5px; color: var(--text-3); }
.bk-label i { margin-right: 6px; color: var(--text-4); }
.bk-value { margin-top: 6px; font-size: 16px; font-weight: 650; color: var(--text); word-break: break-all; }
.bk-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 900px) { .bk-cards { grid-template-columns: minmax(0, 1fr); } }
