/* H2C — light by default, optional dark */

:root {
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.1);
  --accent-hover: #0f766e;
  --mint: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --header-h: 70px;
  --glow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --header-scrolled: rgba(247, 248, 250, 0.9);
  --nav-hover: rgba(15, 23, 42, 0.05);
  --mobile-nav-bg: rgba(247, 248, 250, 0.98);
  --btn-ghost-hover-bg: rgba(15, 23, 42, 0.04);
  --btn-ghost-hover-text: #0f172a;
  --flash-ok-bg: #ecfdf5;
  --flash-ok-border: #a7f3d0;
  --flash-ok-text: #065f46;
  --flash-bad-bg: #fef2f2;
  --flash-bad-border: #fecaca;
  --flash-bad-text: #991b1b;
  --bg-glow-1: rgba(13, 148, 136, 0.08);
  --bg-glow-2: rgba(14, 165, 233, 0.05);
}

html[data-theme="dark"] {
  --bg: #0c0e14;
  --bg-elevated: #12151c;
  --surface: #161a24;
  --surface-hover: #1c2130;
  --text: #f0f2f5;
  --muted: #8b95a8;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #4ecdc4;
  --accent-dim: rgba(78, 205, 196, 0.12);
  --accent-hover: #6dd9d2;
  --mint: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --glow: 0 0 80px rgba(78, 205, 196, 0.08);
  --header-scrolled: rgba(12, 14, 20, 0.88);
  --nav-hover: rgba(255, 255, 255, 0.04);
  --mobile-nav-bg: rgba(12, 14, 20, 0.97);
  --btn-ghost-hover-bg: rgba(255, 255, 255, 0.04);
  --btn-ghost-hover-text: #ffffff;
  --flash-ok-bg: rgba(52, 211, 153, 0.08);
  --flash-ok-border: rgba(52, 211, 153, 0.2);
  --flash-ok-text: #a7f3d0;
  --flash-bad-bg: rgba(248, 113, 113, 0.08);
  --flash-bad-border: rgba(248, 113, 113, 0.2);
  --flash-bad-text: #fecaca;
  --bg-glow-1: rgba(78, 205, 196, 0.09);
  --bg-glow-2: rgba(78, 205, 196, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 20% -5%, var(--bg-glow-1), transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 10%, var(--bg-glow-2), transparent 50%),
    var(--bg);
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 0 clamp(20px, 5vw, 64px);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.site-header.is-scrolled {
  background: var(--header-scrolled);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.1em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover { color: var(--text); text-decoration: none; }

.brand .two {
  color: var(--accent);
  letter-spacing: -0.1em;
}

.brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.brand-product {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-mark img { width: 100%; height: 100%; display: block; }

.brand-tag { display: none; }

.header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: nowrap;
  margin-left: 0;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--nav-hover);
  text-decoration: none;
}

.site-nav .btn { margin-left: 6px; }

.nav-logout {
  display: inline-flex;
  margin: 0;
  margin-left: 6px;
}

.nav-logout .btn { margin-left: 0; }

.footer-logout {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: inherit;
}

.footer-logout:hover { color: var(--text); }

.nav-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 8px;
  background: var(--line-strong);
  flex-shrink: 0;
  align-self: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  flex-shrink: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--nav-hover);
  color: var(--text);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: none;
}

html:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

html[data-theme="dark"] .btn,
html[data-theme="dark"] button.btn,
html[data-theme="dark"] a.btn {
  background: #0d9488;
  box-shadow: 0 0 24px rgba(78, 205, 196, 0.2);
}

/* ── Buttons ── */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, color 0.15s;
  background: #0d9488;
  color: #ffffff !important;
  box-shadow: 0 0 24px rgba(13, 148, 136, 0.25);
}

.btn:hover, button.btn:hover, a.btn:hover {
  background: #14b8a6;
  color: #ecfeff !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 0 32px rgba(20, 184, 166, 0.35);
}

.btn:focus-visible, a.btn:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}

.btn-ghost, a.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.btn-ghost:hover, a.btn-ghost:hover {
  background: var(--btn-ghost-hover-bg);
  color: var(--btn-ghost-hover-text) !important;
  box-shadow: none;
}

.btn-wide { width: 100%; }

/* ── Layout ── */
main {
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px) 88px;
  max-width: 1180px;
  margin: 0 auto;
}

main.main-wide { max-width: 1180px; }

.kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  line-height: 1.12;
}

h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); }

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 460px;
  line-height: 1.65;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ── Landing hero ── */
.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 6vw, 56px);
  align-items: center;
  padding-bottom: 56px;
}

.hero-wordmark {
  font-family: var(--display);
  font-size: clamp(5rem, 14vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.1em;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
  white-space: nowrap;
}

.hero-wordmark .two {
  color: var(--accent);
  letter-spacing: -0.1em;
}

.hero-main h1 { margin-top: 0; }

.flow-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--glow);
}

.flow-label {
  margin: 0 0 22px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.flow-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 50%;
}

.step-text {
  font-size: 0.92rem;
  color: var(--muted);
  padding-top: 4px;
}

.step-text strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

.flow-result {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.flow-result-label { color: var(--muted); font-weight: 500; }

.flow-result-value {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--mint);
}

/* ── H2C meaning ── */
.meaning-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 8px 0 48px;
}

.meaning-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.meaning-letter {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
}

.meaning-item h3 {
  font-size: 0.95rem;
  margin: 2px 0 6px;
}

.meaning-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Partners ── */
.partners-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.partners-head {
  margin-bottom: 28px;
  max-width: 560px;
}

.partners-head h2 { margin-bottom: 8px; }

.partners-empty {
  padding: 36px 28px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.partners-empty p {
  color: var(--muted);
  margin: 0 0 18px;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}

.partner-card:hover {
  border-color: rgba(78, 205, 196, 0.25);
  background: var(--surface-hover);
}

.partner-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.partner-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.partner-initial {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
}

.partner-card h3 {
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.3;
}

.partner-badge {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.partner-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.partner-preview img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}

input[type="file"] {
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  cursor: pointer;
}

/* ── Features ── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.feature {
  padding: 24px 24px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  transition: border-color 0.2s, background 0.2s;
}

.feature:hover {
  background: var(--surface-hover);
  border-left-color: var(--accent-hover);
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.feature p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Section block ── */
.section-block {
  padding: 56px 0 0;
  border-top: 1px solid var(--line);
}

.section-lede {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 32px;
  max-width: 400px;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step-card {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.step-card:hover { border-color: var(--line-strong); }

.step-card-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 14px;
}

.step-card h3 { font-size: 1rem; margin-bottom: 6px; }

.step-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Inner pages ── */
.hero { padding: 36px 0 24px; max-width: 720px; }

/* ── Auth (login / register) ── */
.auth-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 0 40px;
  min-height: calc(100vh - var(--header-h) - 220px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glow);
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-sub {
  margin: 0 0 22px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-card form {
  max-width: none;
  width: 100%;
}

.auth-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.code-input {
  font-family: var(--mono) !important;
  font-size: 1.5rem !important;
  letter-spacing: 0.35em !important;
  text-align: center;
  font-weight: 600;
}

.verify-form { margin-bottom: 10px; }

.verify-timers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 18px;
}

.verify-timer {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.verify-timer-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0;
}

.verify-timer-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
}

.verify-timer-value.is-expired {
  color: var(--bad);
  letter-spacing: 0;
  font-size: 1rem;
}

#resend-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#resend-btn.resend-btn-active {
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-weight: 600;
}

.resend-form .btn-ghost {
  width: 100%;
}

.account-meta {
  margin-top: 10px;
  font-size: 0.9rem;
}

.account-meta a { font-weight: 600; }

.password-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 12px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list li:last-child { border-bottom: 0; }

.activity-summary { color: var(--text); font-size: 0.92rem; }

.audit-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  white-space: nowrap;
}

.activity-table td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.small { font-size: 0.8rem; }

.audit-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
}

.audit-search input[type="search"] {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .activity-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── Split pages (pricing / subscribe) ── */
.split-page {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
  padding: 24px 0 16px;
}

.split-copy h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  max-width: 560px;
}

.split-copy .lede {
  max-width: 480px;
  margin-bottom: 28px;
}

.split-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  max-width: 460px;
}

.split-points li {
  position: relative;
  padding: 12px 14px 12px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.split-points li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.45);
}

.split-card {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.pricing-card {
  width: 100%;
  padding: 28px;
}

.pricing-card .price {
  margin: 8px 0 12px;
}

.pricing-card ul {
  margin: 16px 0 24px;
}

.pricing-card form {
  max-width: none;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.card h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }

.price {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.featured {
  border-color: rgba(78, 205, 196, 0.35);
  box-shadow: var(--glow);
}

.badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card ul { padding-left: 18px; color: var(--muted); font-size: 0.88rem; }
.card li { margin-bottom: 4px; }

/* ── Forms ── */
form { display: grid; gap: 16px; max-width: 400px; }
label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(78, 205, 196, 0.45);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

code, .mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 5px;
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ── Flash / status ── */
.flash {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.flash-ok { background: var(--flash-ok-bg); border-color: var(--flash-ok-border); color: var(--flash-ok-text); }
.flash-bad { background: var(--flash-bad-bg); border-color: var(--flash-bad-border); color: var(--flash-bad-text); }

.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-elevated); }
.status-active { color: var(--mint); font-weight: 600; }
.status-pending { color: var(--warn); font-weight: 600; }
.status-expired { color: var(--bad); font-weight: 600; }

/* ── Footer ── */
.site-footer {
  padding: 48px clamp(20px, 5vw, 64px) 40px;
  border-top: 1px solid var(--line);
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 28px;
  text-align: left;
  justify-items: center;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.footer-brand {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.1em;
  color: var(--text);
  margin-bottom: 10px;
  white-space: nowrap;
}

.footer-brand .two { color: var(--accent); }
.footer-brand .brand-product { margin-left: 8px; letter-spacing: 0.1em; }

.footer-about {
  text-align: center;
  justify-self: center;
}

.footer-about p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 auto 8px;
  max-width: 280px;
  line-height: 1.55;
}

.footer-tag {
  color: var(--accent) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.footer-col h4 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-col a {
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-col a:hover { color: var(--text); }

.footer-copy {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: rgba(139, 149, 168, 0.7);
  margin: 0;
  text-align: center;
}

/* ── Dashboard / admin ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.stat-card .muted {
  margin: 0;
  font-size: 0.82rem;
}

.checklist {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--muted);
}

.checklist li.done {
  color: var(--text);
  border-color: rgba(78, 205, 196, 0.2);
}

.checklist li span:first-child {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
}

.checklist li a {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
}

.settings-form {
  max-width: none;
  display: block;
}

.settings-form .panel { margin-bottom: 0; }

.settings-shell {
  max-width: 840px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

.settings-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.settings-tab.is-active:hover {
  color: #fff;
  background: var(--accent-hover);
}

.settings-panel {
  margin-top: 0;
}

.settings-panel[hidden] {
  display: none !important;
}

.field-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.help-btn {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.help-btn:hover,
.help-btn[aria-expanded="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.help-pop {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--accent-dim);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
}

.help-pop p { margin: 0; }

.help-example {
  margin-top: 8px !important;
  color: var(--text);
}

.help-example .mono {
  font-weight: 600;
}


.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.sub-countdown-display {
  font-size: 0.95rem;
  margin-top: 6px !important;
  letter-spacing: 0.5px;
}

.sub-countdown-display.is-expired {
  color: var(--bad);
  font-weight: 700;
}

.btn-subscribed {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  cursor: default;
  pointer-events: none;
  font-weight: 700;
  text-align: center;
}

.btn-pending {
  background: rgba(217, 119, 6, 0.1) !important;
  color: var(--warn) !important;
  border: 1px solid var(--warn) !important;
  cursor: default;
  pointer-events: none;
  font-weight: 700;
  text-align: center;
}

.db-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.db-preset-hint {
  margin: 0 0 14px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-actions form {
  display: inline;
  max-width: none;
}

/* ── Reveal ── */
[data-reveal] { animation: reveal 0.55s ease both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Base overflow / media safety ── */
img, svg, video { max-width: 100%; height: auto; }
pre, .mono, .table-wrap { max-width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }
.btn, button.btn { min-height: 44px; }
.site-nav a { min-height: 40px; display: inline-flex; align-items: center; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

body.nav-locked { overflow: hidden; }

.nav-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  html[data-theme="dark"] .nav-backdrop {
    background: rgba(0, 0, 0, 0.45);
  }

  body.nav-locked .nav-backdrop,
  .nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* ── Responsive: tablet landscape / small laptop ── */
@media (max-width: 1024px) {
  .landing-hero {
    gap: 28px;
  }

  .hero-wordmark {
    font-size: clamp(3.8rem, 12vw, 5.5rem);
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .partners-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ── Responsive: tablet / large phone ── */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .site-header {
    height: auto;
    min-height: var(--header-h);
    padding: 12px clamp(16px, 4vw, 32px);
    flex-wrap: nowrap;
    position: sticky;
  }

  .header-end {
    position: static;
    flex: 1;
    justify-content: flex-end;
  }

  .header-actions {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 12px 16px 20px;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--glow);
    z-index: 60;
    margin-left: 0;
  }

  .site-header.nav-open .site-nav {
    display: flex;
  }

  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav a {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
  }

  .site-nav .btn,
  .site-nav .btn-ghost {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .nav-sep {
    display: none;
  }

  main {
    padding: 28px clamp(16px, 4vw, 28px) 64px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 36px;
  }

  .hero-main { order: 0; }
  .flow-card { order: 1; }

  .features,
  .meaning-row,
  .steps-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    max-width: 520px;
  }

  .footer-about {
    grid-column: 1 / -1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .split-page {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .split-card {
    position: static;
    order: -1;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .auth-center {
    min-height: auto;
    padding: 12px 0 32px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  th, td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .admin-actions {
    flex-direction: column;
  }

  .admin-actions .btn,
  .admin-actions .btn-ghost {
    width: 100%;
  }
}

/* ── Responsive: phone ── */
@media (max-width: 600px) {
  :root { --header-h: 60px; }

  .brand { font-size: 1.2rem; }

  h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); }

  .hero-wordmark {
    font-size: clamp(3.2rem, 18vw, 4.2rem);
  }

  .lede {
    font-size: 0.98rem;
    max-width: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-footer {
    padding: 36px clamp(16px, 4vw, 24px) 32px;
  }

  .card, .panel, .flow-card, .feature, .step-card, .meaning-item {
    padding: 20px;
  }

  .price { font-size: 1.75rem; }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .partners-grid {
    grid-template-columns: 1fr 1fr;
  }

  .checklist li a {
    margin-left: 0;
    width: 100%;
  }

  .flow-result {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  pre {
    font-size: 0.72rem;
    padding: 12px;
  }
}

/* ── Responsive: small phone ── */
@media (max-width: 380px) {
  .stat-grid,
  .partners-grid {
    grid-template-columns: 1fr;
  }

  .hero-wordmark {
    font-size: 2.8rem;
  }
}

/* ── Large desktop ── */
@media (min-width: 1280px) {
  main,
  main.main-wide,
  .site-footer {
    max-width: 1200px;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
