/* Narrator design system — tokens, primitives, then views. */

:root {
  color-scheme: light dark;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #191c21;
  --text-muted: #5e6672;
  --text-faint: #8b93a0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0fe;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --success: #16a34a;
  --shadow-sm: 0 1px 2px rgb(16 20 28 / 0.06);
  --shadow-md: 0 4px 16px rgb(16 20 28 / 0.08);
  --shadow-lg: 0 12px 40px rgb(16 20 28 / 0.18);
  --radius: 10px;
  --radius-sm: 8px;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #16181d;
    --surface-2: #1d2026;
    --border: #262a31;
    --border-strong: #363b44;
    --text: #e8eaee;
    --text-muted: #9aa2ae;
    --text-faint: #6d7581;
    --accent: #6d75f5;
    --accent-hover: #8189f7;
    --accent-soft: #23253a;
    --danger: #ef5350;
    --danger-soft: #33191b;
    --success: #4ade80;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.6);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; }

/* ---------- primitives ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  text-decoration: none; /* .btn is also used on <a> */
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-block { width: 100%; }

.button-row { display: flex; gap: 0.6rem; }
.button-row .btn-primary { flex: 1; }

.input, .textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.textarea { resize: vertical; min-height: 10rem; line-height: 1.55; }
.textarea-tall { min-height: 7.5rem; }
.clipboard-helper { position: fixed; opacity: 0; }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.field .hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-faint); }

.form-error {
  display: none;
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
}
.form-error.visible { display: block; }

.form-notice {
  display: none;
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.form-notice.visible { display: block; }

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #9333ea);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
}
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }

/* ---------- app shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 0;
}
.user-chip .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.view-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.view-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 0.2rem;
  margin-bottom: -1px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
}
.view-tab + .view-tab { margin-left: 0.6rem; }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-head h1 { font-size: 1.35rem; letter-spacing: -0.01em; }
.count-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.6rem;
}
.page-head .spacer { flex: 1; }

.usage-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.usage-tile {
  flex: 1 1 180px;
  padding: 0.9rem 1.1rem;
}
.usage-tile .label { display: block; font-size: 0.78rem; color: var(--text-faint); }
.usage-tile .value { display: block; margin-top: 0.2rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }

.search-box { position: relative; }
.search-box .input { width: 240px; padding-left: 2.1rem; }
.search-box svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

/* ---------- prompt cards ---------- */

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* Shared card surface — background/border, and usually radius + shadow too,
   reused by usage tiles, prompt cards, how-it-works steps, billing cards,
   example cards, the playground panel, and feature cards below. */
.usage-tile,
.prompt-card,
.how-steps li,
.billing-plan-card,
.billing-report-card,
.example-card,
.playground,
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
}
.usage-tile,
.prompt-card,
.how-steps li,
.billing-plan-card,
.billing-report-card,
.example-card,
.feature-card {
  border-radius: var(--radius);
}
.usage-tile,
.prompt-card,
.billing-plan-card,
.billing-report-card,
.example-card,
.playground,
.feature-card {
  box-shadow: var(--shadow-sm);
}

.prompt-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.prompt-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.prompt-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.prompt-card .card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.prompt-card .name {
  font-weight: 650;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prompt-card .when { font-size: 0.76rem; color: var(--text-faint); flex: none; }

.prompt-card .preview {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em;
  margin-bottom: 0.9rem;
}

.prompt-card .card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.url-chip {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.url-chip .url-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }

.calls-badge { font-size: 0.76rem; color: var(--text-faint); flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.copied { color: var(--success); border-color: var(--success); }
.icon-btn-lg { width: 38px; height: 38px; }

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
}
.empty-state .glyph { color: var(--text-faint); margin-bottom: 0.75rem; }
.empty-state h2 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.empty-state p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 1.5rem; font-size: 0.9rem; }

.how-steps {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto 1.75rem;
  padding: 0;
  list-style: none;
  max-width: 720px;
}
.how-steps li {
  flex: 1 1 180px;
  max-width: 220px;
  padding: 1rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  text-align: left;
}
.how-steps .step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

/* ---------- billing ---------- */

.billing-plan-card {
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.billing-plan-card .stats-grid { margin-bottom: 0.6rem; }
.billing-plan-card .hint { margin: 0; font-size: 0.82rem; color: var(--text-faint); }

.billing-reports {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.billing-report-card {
  padding: 1.1rem 1.2rem;
}
.billing-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.billing-report-head .name {
  font-weight: 650;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.billing-report-card .limit-bar { margin-bottom: 0; }

.tier-badge { flex: none; }
.tier-badge.tier-paid { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.billing-add-slot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.billing-add-slot .hint { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- drawer ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(10 12 16 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 40;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0.28, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

/* ---------- auth modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(10 12 16 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 60;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.97);
  width: min(400px, calc(100vw - 2.5rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 61;
  display: flex;
  flex-direction: column;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.05rem; }

.modal-body { padding: 1.5rem; }

/* Only the pane named by #auth-modal's [data-pane] is shown. */
.modal [data-pane-content] { display: none; }
#auth-modal[data-pane="choose"] [data-pane-content="choose"],
#auth-modal[data-pane="code"] [data-pane-content="code"] { display: block; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 1.05rem; }

.drawer-body { flex: 1; overflow-y: auto; padding: 1.5rem; }

.url-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
}
.url-section .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.url-section .label-row label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.url-row { display: flex; gap: 0.5rem; }
.url-row .input { font-family: var(--font-mono); font-size: 0.78rem; background: var(--surface); }
.url-section .hint { margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--text-faint); }
.url-section .hint-warn { color: var(--danger); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1rem;
  margin-bottom: 1.1rem;
}
.stat { font-size: 0.8rem; color: var(--text-faint); }
.stat b { display: block; color: var(--text-muted); font-weight: 600; }

.limit-bar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  margin-bottom: 1.1rem;
}
.limit-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.limit-bar-head .label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.limit-count { font-size: 0.78rem; font-variant-numeric: tabular-nums; color: var(--text-faint); }
.limit-count.at-limit { color: var(--danger); font-weight: 600; }
.limit-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.limit-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.2s ease; }
.limit-fill.at-limit { background: var(--danger); }
.limit-note { margin: 0.5rem 0 0; font-size: 0.76rem; color: var(--danger); }

.drawer-foot {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.drawer-foot .grow { flex: 1; }

/* ---------- toasts ---------- */

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 550;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- landing / marketing ---------- */

.btn-lg { padding: 0.75rem 1.4rem; font-size: 1rem; border-radius: var(--radius); }

.hero-notice { max-width: 760px; margin: 0 auto 1.5rem; }

.hero {
  max-width: 720px;
  margin: 2.5rem auto 4rem;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.1rem;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 58ch;
  margin: 0 auto;
}
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.9rem 0 1.1rem;
}
.hero-trust { color: var(--text-faint); font-size: 0.82rem; }

.section { margin-bottom: 4rem; }
.section-title {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 2rem;
}

.how-steps.how-steps-static {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.how-steps.how-steps-static li { max-width: none; font-size: 0.88rem; }

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.example-card {
  overflow: hidden;
}
.example-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.example-body { padding: 1rem 1.15rem 1.2rem; }
.example-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.example-quote {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.playground-wrap { max-width: 680px; margin: 0 auto; }

.playground {
  border-radius: 16px;
  padding: 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  padding: 1.2rem 1.3rem;
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.feature-card h3 { font-size: 0.98rem; margin-bottom: 0.4rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.86rem; line-height: 1.55; }

.final-cta {
  text-align: center;
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 3rem 1.5rem;
}
.final-cta h2 { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.final-cta .section-sub { margin-bottom: 1.6rem; }

.landing-footer { border-top: 1px solid var(--border); margin-top: 1rem; }
.landing-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.sample-details { margin-top: 1.5rem; }
.sample-details summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.sample-details summary:hover { color: var(--text); }
.sample-details .table-wrap { margin-top: 0.75rem; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-wrap th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.mode-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
.mode-option {
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.mode-option:hover { color: var(--text); }
.mode-option.active { background: var(--accent); color: #fff; }

.demo-output {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.demo-output label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.demo-output p {
  margin: 0;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  line-height: 1.6;
}

.btn.disabled { opacity: 0.55; cursor: not-allowed; }

.hidden { display: none !important; }

/* skeleton shimmer while the list loads */
.skeleton {
  height: 150px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border: 1px solid var(--border);
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- legal pages (terms / privacy) ---------- */
.legal { max-width: 68ch; margin: 0 auto; }
.legal h1 { font-size: 1.75rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.legal .legal-updated { color: var(--text-faint); font-size: 0.82rem; margin-bottom: 2.2rem; }
.legal h2 { font-size: 1.05rem; margin: 2.2rem 0 0.75rem; letter-spacing: -0.01em; }
.legal p { color: var(--text-muted); margin: 0 0 0.9rem; }
.legal ul { color: var(--text-muted); margin: 0 0 0.9rem; padding-left: 1.3rem; }
.legal li { margin-bottom: 0.4rem; }
.legal a { color: var(--accent); }
.legal strong { color: var(--text); }
.legal .placeholder { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0.05rem 0.35rem; font-size: 0.92em; }

.brand-link { text-decoration: none; color: inherit; }
