/* Open Forum — Airtable-inspired design system + admin */

:root {
  --primary: #181d26;
  --primary-active: #0d1218;
  --ink: #181d26;
  --body: #333840;
  --muted: #41454d;
  --hairline: #dddddd;
  --border-strong: #9297a0;
  --canvas: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #e0e2e6;
  --surface-dark: #181d26;
  --surface-dark-elevated: #1d1f25;
  --signature-coral: #aa2d00;
  --signature-forest: #0a2e0e;
  --signature-cream: #f5e9d4;
  --signature-peach: #fcab79;
  --signature-mint: #a8d8c4;
  --signature-yellow: #f4d35e;
  --on-primary: #ffffff;
  --link: #1b61c9;
  --info-border: #458fff;
  --success: #006400;
  --success-border: #39bf45;
  --warn: #9a5b12;
  --warn-bg: #f7ebd7;
  --danger: #9b2c2c;
  --danger-bg: #f8e4e4;
  --ok: #006400;
  --ok-bg: #e8f5e9;

  /* legacy aliases used by admin */
  --ink-soft: var(--body);
  --paper: var(--surface-soft);
  --paper-2: var(--surface-strong);
  --surface: var(--canvas);
  --accent: var(--primary);
  --accent-deep: var(--primary-active);
  --accent-soft: var(--surface-soft);
  --line: var(--hairline);
  --shadow: none;
  --radius: 12px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.55s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--body);
  background: var(--canvas);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.public {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:active {
  color: #1a3866;
}

.container {
  width: min(1280px, calc(100% - 3rem));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .container {
    width: min(1280px, calc(100% - 1.5rem));
  }
}

/* —— Reveal motion —— */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-reveal]:nth-child(2) { transition-delay: 0.06s; }
.reveal[data-reveal]:nth-child(3) { transition-delay: 0.12s; }
.reveal[data-reveal]:nth-child(4) { transition-delay: 0.18s; }
.reveal[data-reveal]:nth-child(5) { transition-delay: 0.24s; }

.demo-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.demo-grid .reveal:nth-child(2) { transition-delay: 0.12s; }
.demo-grid .reveal:nth-child(3) { transition-delay: 0.18s; }
.demo-grid .reveal:nth-child(4) { transition-delay: 0.24s; }

.steps-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.steps-grid .reveal:nth-child(2) { transition-delay: 0.14s; }
.steps-grid .reveal:nth-child(3) { transition-delay: 0.22s; }

/* —— Top nav —— */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
  transition: border-color 0.25s var(--ease-soft), box-shadow 0.25s var(--ease-soft);
}

.top-nav.is-scrolled {
  border-bottom-color: var(--hairline);
}

.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--body);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s var(--ease-soft);
}

.nav-links a:active {
  color: var(--ink);
}

.nav-links .nav-cta {
  font-weight: 500;
  color: var(--ink);
}

.nav-links .nav-quiet {
  color: var(--muted);
}

.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.nav-menu-btn:active {
  background: var(--surface-soft);
}

.nav-menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s var(--ease-soft), opacity 0.2s var(--ease-soft);
}

.top-nav.is-menu-open .nav-menu-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.top-nav.is-menu-open .nav-menu-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* —— Hero —— */
.hero-band {
  display: grid;
  gap: 3rem;
  align-items: center;
  width: min(1280px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 96px 0 72px;
}

@media (min-width: 960px) {
  .hero-band {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    padding: 96px 0;
  }
}

@media (max-width: 640px) {
  .hero-band {
    width: min(1280px, calc(100% - 1.5rem));
    gap: 2rem;
    padding: 48px 0 40px;
  }
}

.hero-inner {
  width: 100%;
}

.hero-kicker {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16px;
  color: var(--muted);
}

.brand-display {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 48px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 0 0 32px;
  max-width: 34rem;
  font-size: 16px;
  line-height: 1.5;
  color: var(--body);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.hero-stack {
  display: grid;
  gap: 12px;
  width: min(320px, 100%);
}

.hero-chip {
  padding: 20px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  transform: translateX(0);
  animation: chip-float 6s var(--ease-soft) infinite;
}

.hero-chip--peach {
  background: var(--signature-peach);
  animation-delay: 0s;
}

.hero-chip--mint {
  background: var(--signature-mint);
  margin-left: 24px;
  animation-delay: 0.4s;
}

.hero-chip--cream {
  background: var(--signature-cream);
  margin-left: 8px;
  animation-delay: 0.8s;
}

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.18s var(--ease-soft),
    transform 0.18s var(--ease-soft),
    border-color 0.18s var(--ease-soft),
    color 0.18s var(--ease-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:active:not(:disabled),
.btn-primary:focus-visible {
  background: var(--primary-active);
  color: var(--on-primary);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--info-border);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-secondary:active:not(:disabled) {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-secondary-on-dark {
  background: var(--canvas);
  color: var(--ink);
  border: none;
}

.btn-secondary-on-dark:active {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding-inline: 0.9rem;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-icon {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}

/* —— Sections —— */
.section {
  padding: 96px 0;
}

.section-head {
  max-width: 36rem;
  margin-bottom: 48px;
}

.title-lg {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.12px;
  color: var(--ink);
}

.display-md {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.5vw, 32px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

.section-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  max-width: 32rem;
}

/* Steps */
.steps-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 32px;
}

.step-num {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.step-card p {
  margin: 0;
  color: var(--body);
}

/* Signature coral */
.section-signature {
  padding-top: 0;
}

.signature-card {
  border-radius: 12px;
  padding: 48px;
  display: grid;
  gap: 32px;
}

@media (min-width: 800px) {
  .signature-card {
    grid-template-columns: 1.4fr 1fr;
    align-items: end;
  }
}

.signature-coral {
  background: var(--signature-coral);
  color: var(--on-primary);
}

.signature-coral .display-md,
.signature-coral p,
.signature-coral li {
  color: var(--on-primary);
}

.signature-coral p {
  margin: 0;
  max-width: 36rem;
  opacity: 0.92;
  line-height: 1.5;
}

.signature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.signature-list li {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-weight: 500;
}

/* Demo grid */
.demo-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .demo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .demo-grid {
    grid-template-columns: 1fr 1.15fr 1fr;
    grid-template-rows: auto auto;
  }

  .demo-tall {
    grid-row: span 2;
  }
}

.demo-card {
  border-radius: 10px;
  padding: 24px;
  min-height: 140px;
}

.demo-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.demo-card p {
  margin: 0;
  color: var(--body);
  line-height: 1.45;
}

.demo-peach { background: var(--signature-peach); }
.demo-mint { background: var(--signature-mint); }
.demo-cream { background: var(--signature-cream); }
.demo-forest {
  background: var(--signature-forest);
  color: var(--on-primary);
}

.demo-forest h3,
.demo-forest p {
  color: var(--on-primary);
}

.demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.demo-tags span {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

/* Ask / form section */
.section-ask {
  background: var(--surface-soft);
}

.ask-layout {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 900px) {
  .ask-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 64px;
  }
}

.ask-intro .display-md {
  color: var(--ink);
}

.ask-aside {
  margin-top: 32px;
}

.cream-callout {
  background: var(--signature-cream);
  border-radius: 10px;
  padding: 24px;
}

.cream-callout strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.cream-callout p {
  margin: 0;
  color: var(--body);
}

.ask-panel .form-panel-inner,
.form-panel-inner {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
}

.ask-panel.is-highlight {
  animation: panel-pulse 0.7s var(--ease-out);
}

@keyframes panel-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.form-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.form-panel-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
}

.field {
  margin-bottom: 16px;
}

.field > label:not(.toggle) {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select,
.field textarea,
.admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.admin-form select,
.admin-form textarea,
.filters input:not([type="checkbox"]):not([type="radio"]),
.filters select,
.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  transition: border-color 0.15s var(--ease-soft), box-shadow 0.15s var(--ease-soft);
}

.field textarea,
.admin-form textarea {
  height: auto;
  min-height: 120px;
  resize: vertical;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.field select:focus,
.field textarea:focus,
.admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.admin-form select:focus,
.admin-form textarea:focus,
.filters input:not([type="checkbox"]):not([type="radio"]):focus,
.filters select:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--info-border);
  box-shadow: 0 0 0 2px rgba(69, 143, 255, 0.25);
}

.field-row {
  display: grid;
  gap: 16px;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 12px;
}

.form-status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.form-status.is-success,
.form-status.is-error {
  opacity: 1;
  transform: translateY(0);
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--danger);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0 0 16px;
  font-size: 14px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.alert-success {
  background: var(--ok-bg);
  color: var(--ok);
}

/* Dark CTA */
.section-dark-cta {
  padding-top: 3rem;
}

.hero-card-dark {
  background: var(--surface-dark);
  color: var(--on-primary);
  border-radius: 12px;
  padding: 48px;
}

.hero-card-dark .display-md {
  color: var(--on-primary);
}

.hero-card-dark p {
  margin: 0 0 28px;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-meta {
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

/* —— Admin —— */
body.admin {
  background: var(--surface-soft);
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 240px 1fr;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
}

.admin-nav {
  background: var(--surface-dark);
  color: #d7e0db;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav .brand {
  color: #fff;
  margin: 0 0.5rem 1.5rem;
  display: block;
}

.admin-nav a {
  color: #c5d2cb;
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
}

.admin-nav a.nav-link-with-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-nav .nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #e85d4c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.admin-nav a:active,
.admin-nav a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.nav-logout-form {
  margin: 0;
}

.nav-logout-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #c5d2cb;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
}

.nav-logout-btn:hover,
.nav-logout-btn:active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-nav .nav-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #8a9a92;
  padding-inline: 0.85rem;
}

.admin-main {
  padding: 1.5rem;
}

.admin-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  user-select: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
}

.live-pill.is-live {
  color: var(--success);
  border-color: rgba(57, 191, 69, 0.35);
  background: var(--ok-bg);
}

.live-pill.is-live .live-dot {
  background: var(--success-border);
  box-shadow: 0 0 0 0 rgba(57, 191, 69, 0.55);
  animation: live-pulse 1.8s var(--ease-soft) infinite;
}

.live-pill.is-error {
  color: var(--danger);
  border-color: rgba(155, 44, 44, 0.28);
  background: var(--danger-bg);
}

.live-pill.is-error .live-dot {
  background: var(--danger);
}

.live-pill.is-paused .live-dot {
  background: var(--border-strong);
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 191, 69, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(57, 191, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 191, 69, 0); }
}

.admin-top h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink);
}

.admin-top p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card + .card {
  margin-top: 1rem;
}

.card h2,
.card h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}

.stat.is-updated {
  border-color: var(--info-border);
  background: #f3f8ff;
}

.stat .label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .value {
  margin-top: 0.35rem;
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

/* Recent questions feed */
.recent-card .split-head {
  margin-bottom: 0.35rem;
}

.recent-card .split-head h2 {
  margin-bottom: 0.2rem;
}

.recent-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.recent-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.recent-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color 0.2s var(--ease-soft), background 0.2s var(--ease-soft);
}

.recent-item.is-new {
  background: #f3f8ff;
  border-color: rgba(69, 143, 255, 0.35);
}

.recent-item-body {
  min-width: 0;
  flex: 1;
}

.recent-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}

.recent-item-top time {
  font-size: 0.8rem;
  color: var(--muted);
}

.recent-item-name {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.recent-item-meta {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.recent-dot {
  opacity: 0.7;
}

.recent-item-preview {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-item-action {
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 640px) {
  .recent-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .recent-item-action {
    align-self: stretch;
    width: 100%;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filters .field,
.filters > * {
  flex: 1 1 160px;
  min-width: 140px;
  margin: 0;
}

.filters label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--canvas);
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  min-width: 640px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  border-bottom-color: var(--hairline);
}

table.data tbody tr {
  transition: background 0.15s var(--ease-soft);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover td {
  background: #f5f7fa;
}

table.data tbody tr.is-new td {
  background: #f7faff;
}

table.data tbody tr.is-new:hover td {
  background: #eef5ff;
}

table.data .cell-id {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

table.data .cell-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

table.data .cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

table.data .cell-stack strong,
table.data .cell-primary {
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

table.data .cell-muted,
table.data .cell-stack small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

table.data .cell-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data .cell-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

table.data .cell-actions .actions {
  justify-content: flex-end;
}

table.data .cell-status {
  white-space: nowrap;
}

.pill-active,
.pill-inactive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.pill-active {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill-inactive {
  background: var(--surface-strong);
  color: var(--muted);
}

.pill-active::before,
.pill-inactive::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-new {
  background: #dceef8;
  color: #1a5f7a;
}

.badge-read {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-replied {
  background: var(--ok-bg);
  color: var(--ok);
}

.question-preview {
  max-width: 360px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--body);
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.actions details {
  position: relative;
}

.actions details > summary {
  list-style: none;
  cursor: pointer;
}

.actions details > summary::-webkit-details-marker {
  display: none;
}

.actions details[open] > summary {
  color: var(--ink);
}

.table-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 5;
  min-width: 260px;
  padding: 0.9rem;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 29, 38, 0.1);
}

.table-dropdown .admin-form {
  margin: 0;
}

.table-dropdown .table-dropdown-danger {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hairline);
}

/* Modals */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 29, 38, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 24px 48px rgba(24, 29, 38, 0.18);
}

.modal-panel--danger {
  border-color: rgba(155, 44, 44, 0.25);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
}

.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:active {
  background: var(--surface-soft);
  color: var(--ink);
}

.modal-sub {
  margin: -0.35rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.modal-actions .btn {
  min-height: 42px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  width: fit-content;
  max-width: 100%;
}

.field .toggle {
  margin-bottom: 0;
}

.toggle input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  box-shadow: none;
}

.toggle-track {
  position: relative;
  z-index: 1;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #c5c9d0;
  border: none;
  box-sizing: border-box;
  transition: background 0.2s var(--ease-soft);
  pointer-events: none;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 29, 38, 0.28);
  transition: transform 0.2s var(--ease-soft);
}

.toggle input[type="checkbox"]:checked + .toggle-track {
  background: var(--primary);
}

.toggle input[type="checkbox"]:checked + .toggle-track::after {
  transform: translateX(18px);
}

.toggle input[type="checkbox"]:focus-visible + .toggle-track {
  outline: 2px solid var(--info-border);
  outline-offset: 2px;
}

.toggle input[type="checkbox"]:disabled + .toggle-track {
  opacity: 0.5;
}

.toggle input[type="checkbox"]:disabled ~ .toggle-label {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle:has(input[type="checkbox"]:disabled) {
  cursor: not-allowed;
}

.toggle-label {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.detail-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .detail-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

.meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.92rem;
}

.meta-list span {
  color: var(--muted);
}

.question-body {
  white-space: pre-wrap;
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 1rem;
  margin: 0;
  font-size: 0.95rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--surface-soft);
}

.login-card {
  width: min(400px, 100%);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 2rem;
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink);
}

.login-card .sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-form .field {
  margin-bottom: 1rem;
}

.login-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.inline-form .field {
  flex: 1 1 160px;
  margin: 0;
}

.split-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.split-head h2 {
  margin: 0;
}

/* Admin user management */
.admin-manage-card {
  max-width: 720px;
}

.admin-manage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-manage-head h2 {
  margin: 0;
}

.admin-manage-form .field-row {
  margin-bottom: 0;
}

.admin-manage-form .form-actions {
  margin-top: 0.5rem;
}

.admin-manage-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-manage-divider::before,
.admin-manage-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.admin-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--canvas);
  overflow: hidden;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
}

.admin-user-row:last-child {
  border-bottom: none;
}

.admin-user-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-user-meta {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.admin-user-name strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.admin-user-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-user-sep {
  opacity: 0.55;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.admin-user-actions form {
  margin: 0;
}

@media (max-width: 640px) {
  .admin-user-row {
    flex-wrap: wrap;
  }

  .admin-user-actions {
    width: 100%;
    padding-left: calc(40px + 1rem);
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
}

.pager-meta {
  color: var(--muted);
}

.pager-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pager-label {
  color: var(--body);
  font-weight: 500;
  min-width: 7rem;
  text-align: center;
}

.pager .btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.mobile-nav-toggle {
  display: none;
  margin-bottom: 1rem;
}

@media (max-width: 860px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .admin-nav {
    display: none;
  }

  .admin-nav.is-open {
    display: flex;
  }
}

/* Header legacy (unused public, keep for safety) */
.site-header {
  padding: 1.25rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--body);
}

/* —— Public site: mobile polish —— */
@media (max-width: 720px) {
  .top-nav {
    height: 56px;
  }

  .nav-inner {
    position: relative;
    height: 56px;
  }

  .brand {
    font-size: 1rem;
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-menu-btn {
    display: inline-flex;
    z-index: 2;
  }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0.75rem 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 12px 28px rgba(24, 29, 38, 0.08);
    backdrop-filter: blur(10px);
  }

  .top-nav.is-menu-open .nav-links {
    display: flex;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.85rem;
    border-radius: 10px;
    font-size: 15px;
  }

  .nav-links a:active {
    background: var(--surface-soft);
  }

  .nav-links .nav-cta {
    background: var(--primary);
    color: var(--on-primary);
    justify-content: center;
    font-weight: 500;
    margin-top: 0.25rem;
  }

  .nav-links .nav-cta:active {
    background: var(--primary-active);
    color: var(--on-primary);
  }

  .hero-band {
    padding: 40px 0 32px;
    gap: 1.75rem;
  }

  .brand-display {
    font-size: clamp(32px, 9vw, 40px);
    margin-bottom: 14px;
  }

  .lede {
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.55;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-visual {
    min-height: 0;
    justify-content: stretch;
  }

  .hero-stack {
    width: 100%;
    gap: 10px;
  }

  .hero-chip {
    padding: 16px 18px;
    font-size: 15px;
  }

  .hero-chip--mint,
  .hero-chip--cream {
    margin-left: 0;
  }

  .section {
    padding: 56px 0;
  }

  .section-head {
    margin-bottom: 28px;
  }

  .title-lg {
    font-size: 22px;
  }

  .display-md {
    font-size: clamp(24px, 6.5vw, 28px);
  }

  .step-card {
    padding: 22px 20px;
  }

  .signature-card {
    padding: 28px 22px;
    gap: 20px;
  }

  .signature-list li {
    padding: 12px 14px;
  }

  .demo-card {
    padding: 20px;
    min-height: 0;
  }

  .ask-layout {
    gap: 28px;
  }

  .ask-aside {
    margin-top: 20px;
  }

  .cream-callout {
    padding: 18px 20px;
  }

  .ask-panel .form-panel-inner,
  .form-panel-inner {
    padding: 20px 16px;
    border-radius: 10px;
  }

  .field {
    margin-bottom: 14px;
  }

  .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .field select,
  .field textarea {
    font-size: 16px; /* avoids iOS zoom on focus */
    height: 48px;
    padding: 12px 14px;
  }

  .field textarea {
    height: auto;
    min-height: 132px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .section-dark-cta {
    padding-top: 1.5rem;
  }

  .hero-card-dark {
    padding: 28px 22px;
  }

  .hero-card-dark p {
    margin-bottom: 22px;
  }

  .site-footer {
    padding: 32px 0 40px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .hero-band {
    padding: 32px 0 28px;
  }

  .section {
    padding: 48px 0;
  }

  .btn {
    padding: 14px 20px;
  }
}
