/* ============================================================
   Live Subtitle · landing & member center
   Warm risograph palette + Fraunces display + transcript layout
   ============================================================ */

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;

  /* Warm cream background system */
  --bg: #fff4e6;
  --bg-2: #fce9d4;
  --bg-3: #f8dcbe;
  --surface: #fffaf2;
  --surface-warm: #ffe9d2;
  --paper: #fef0de;

  /* Ink (warm near-black) */
  --ink: #2a1f1a;
  --ink-2: #4a3a32;
  --ink-3: #7d6960;
  --soft: #b8a399;

  /* Warm accents */
  --accent: #c4421b;      /* burnt sienna */
  --accent-2: #a5331a;    /* deeper for hover */
  --amber: #d77a2c;
  --gold: #efc23a;
  --ember: #e85c2b;
  --rose: #d05050;

  /* Cool counterweight — keeps it from being templated warm */
  --cool: #1a2742;        /* deep prussian */
  --cool-2: #2a3858;
  --cool-soft: #e8eaf4;

  /* Status */
  --success: #5a7d3a;
  --success-soft: #e9f0d8;
  --warning: #b8741c;
  --warning-soft: #fbecd0;
  --danger: #b53d28;
  --danger-soft: #fbe2da;

  --line: #ead4be;
  --line-strong: #d8b896;
  --line-ink: rgba(42, 31, 26, 0.12);

  /* Typography */
  --font-display: "Fraunces", "Source Han Serif TC", "Noto Serif TC", "Songti TC", serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  /* Layout */
  --col: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --rail: clamp(56px, 6vw, 84px);
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body.extension-auth-page { min-height: 100vh; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .18s ease;
}

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }

ul, ol { list-style: none; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hidden { display: none !important; }

/* ============================================================
   Paper grain texture overlay (subtle risograph feel)
   ============================================================ */

.paper-grain {
  background-image:
    radial-gradient(circle at 25% 30%, rgba(196, 66, 27, 0.025), transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(215, 122, 44, 0.030), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(26, 39, 66, 0.012), transparent 60%),
    url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
  position: fixed;
  z-index: 1;
}

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  align-items: center;
  background: rgba(255, 244, 230, 0.88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-ink);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px var(--gutter);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  height: 36px;
  justify-content: center;
  padding: 0 6px;
  position: relative;
  width: 36px;
}

.brand-mark .brand-dot {
  background: var(--accent);
  border-radius: 999px;
  display: block;
  height: 6px;
  width: 6px;
}

.brand-mark .brand-bar {
  background: var(--paper);
  border-radius: 1px;
  display: block;
  height: 10px;
  width: 2px;
}

.brand-mark .brand-bar:nth-child(3) { height: 6px; }

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-tag {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar-nav {
  align-items: center;
  display: flex;
  gap: 26px;
  justify-content: center;
}

.topbar-nav a {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: color .15s ease;
}

.topbar-nav a:hover { color: var(--accent); }

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

.auth-badge {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  text-transform: uppercase;
}

.auth-badge.signed-in {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.30);
  color: var(--success);
}

body[data-view="guest"] .member-only { display: none !important; }
body[data-view="member"] .guest-only { display: none !important; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  letter-spacing: -0.005em;
  line-height: 1;
  min-height: 40px;
  padding: 0 18px;
  transition: background-color .18s ease, border-color .18s ease,
    color .18s ease, transform .08s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn:focus-visible {
  outline: 3px solid rgba(196, 66, 27, 0.32);
  outline-offset: 2px;
}

.btn-lg { font-size: 15px; min-height: 50px; padding: 0 22px; }
.btn-block { width: 100%; }

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

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

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

.btn-secondary:hover:not(:disabled) {
  background: var(--accent-2);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-warm);
  border-color: var(--ink-3);
}

.btn-link {
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-weight: 700;
  padding: 0;
}

.btn-link:hover:not(:disabled) { color: var(--accent); }

.btn-google {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-google:hover:not(:disabled) {
  background: var(--surface-warm);
  border-color: var(--line-strong);
}

.g-mark {
  align-items: center;
  background: conic-gradient(from 90deg at 50% 50%, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  width: 20px;
}

.btn-arrow {
  display: inline-block;
  font-size: 14px;
  transform: translateX(0);
  transition: transform .18s ease;
}

.btn-primary:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

/* ============================================================
   Main + sections shared layout
   ============================================================ */

main {
  position: relative;
  z-index: 2;
}

.section {
  padding: clamp(72px, 9vw, 144px) var(--gutter);
  position: relative;
}

.section-head {
  display: grid;
  gap: 14px;
  margin: 0 auto clamp(36px, 5vw, 64px);
  max-width: var(--col);
}

.cue {
  align-items: center;
  color: var(--ink-3);
  display: flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cue-time {
  background: var(--ink);
  border-radius: 4px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 8px;
}

.cue-dot {
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.cue-dot.is-pulse {
  animation: pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(196, 66, 27, 0.18);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(196, 66, 27, 0.18); }
  50%      { box-shadow: 0 0 0 9px rgba(196, 66, 27, 0.06); }
}

.cue-label {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.section-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 18ch;
}

.section-lead {
  color: var(--ink-2);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.65;
  max-width: 56ch;
}

.ink-accent {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 70;
}

.ink-soft {
  color: var(--ink-3);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 500;
  font-style: italic;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background:
    radial-gradient(ellipse 80% 70% at 20% 10%, rgba(239, 194, 58, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 60% at 90% 90%, rgba(196, 66, 27, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: clamp(18px, 2.5vw, 40px) var(--gutter) 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  align-items: center;
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  margin: 0 auto;
  max-width: var(--col);
  padding-bottom: clamp(28px, 3.5vw, 56px);
  position: relative;
}

.hero-stage {
  position: relative;
}

.hero-stage .cue { margin-bottom: 14px; }

.hero-headline {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(46px, 7vw, 96px);
  font-variation-settings: "opsz" 144, "SOFT" 38;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin-bottom: 20px;
}

.hl-line {
  display: block;
  position: relative;
}

.hl-line.hl-accent {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80;
}

.hl-word {
  display: inline-block;
  position: relative;
}

.hl-caret {
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
  height: 0.78em;
  margin-bottom: -0.06em;
  margin-left: 0.04em;
  vertical-align: baseline;
  width: 0.10em;
  animation: caret-blink 0.95s steps(1, end) infinite;
}

@keyframes caret-blink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-lead {
  color: var(--ink-2);
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 36em;
}

.hero-cta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-meta {
  border-top: 1px dashed var(--line-strong);
  display: grid;
  gap: 4px 28px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  padding-top: 16px;
}

.hero-meta div {
  display: grid;
  gap: 4px;
}

.hero-meta dt {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-meta dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.hero-meta strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 35;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-right: 6px;
}

/* Hero stream visual */
.hero-stream {
  background: var(--cool);
  border: 1px solid var(--cool-2);
  border-radius: 16px;
  box-shadow:
    0 30px 80px rgba(26, 39, 66, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f6e9d8;
  display: grid;
  font-size: 14px;
  gap: 14px;
  overflow: hidden;
  padding: 18px 18px 16px;
  position: relative;
  transform-origin: center top;
}

.hero-stream::before {
  background:
    radial-gradient(ellipse 70% 50% at 30% 10%, rgba(239, 194, 58, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 70% 90%, rgba(196, 66, 27, 0.16), transparent 70%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.stream-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  position: relative;
  z-index: 1;
}

.stream-status {
  align-items: center;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 8px;
}

.stream-dot {
  background: var(--ember);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(232, 92, 43, 0.30);
  display: inline-block;
  height: 8px;
  width: 8px;
  animation: pulse-ember 1.4s ease-in-out infinite;
}

@keyframes pulse-ember {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 92, 43, 0.30); }
  50%      { box-shadow: 0 0 0 9px rgba(232, 92, 43, 0.10); }
}

.stream-meta { color: rgba(246, 233, 216, 0.65); }

.stream-lines {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.stream-line {
  background: rgba(255, 244, 230, 0.06);
  border: 1px solid rgba(255, 244, 230, 0.08);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  opacity: 0.45;
  padding: 11px 13px;
  position: relative;
  transition: opacity .25s ease, background-color .25s ease;
}

.stream-line:nth-child(1) { opacity: 0.35; }
.stream-line:nth-child(2) { opacity: 0.55; }
.stream-line:nth-child(3) { opacity: 0.75; }

.stream-line.is-active {
  background: rgba(239, 194, 58, 0.12);
  border-color: rgba(239, 194, 58, 0.30);
  box-shadow: inset 0 0 0 1px rgba(239, 194, 58, 0.18);
  opacity: 1;
}

.stream-time {
  color: rgba(246, 233, 216, 0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stream-line.is-active .stream-time { color: var(--gold); }

.stream-original {
  color: rgba(246, 233, 216, 0.85);
  font-size: 13px;
  line-height: 1.35;
}

.stream-line.is-active .stream-original {
  color: rgba(246, 233, 216, 1);
}

.stream-translation {
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.stream-line.is-active .stream-translation {
  color: var(--gold);
}

.stream-caret {
  background: var(--gold);
  border-radius: 1px;
  display: inline-block;
  height: 0.95em;
  margin-bottom: -0.12em;
  margin-left: 2px;
  vertical-align: middle;
  width: 0.06em;
  animation: caret-blink 0.95s steps(1, end) infinite;
}

.stream-foot {
  align-items: center;
  border-top: 1px dashed rgba(246, 233, 216, 0.18);
  color: rgba(246, 233, 216, 0.65);
  display: flex;
  font-size: 10.5px;
  gap: 10px;
  justify-content: space-between;
  padding-top: 10px;
  position: relative;
  z-index: 1;
}

/* Hero ticker */
.hero-ticker {
  border-top: 1px solid var(--line-ink);
  border-bottom: 1px solid var(--line-ink);
  margin-top: clamp(12px, 1.5vw, 24px);
  overflow: hidden;
  padding: 10px 0;
  width: 100%;
}

.ticker-track {
  align-items: center;
  display: flex;
  gap: 56px;
  white-space: nowrap;
  width: max-content;
}

.ticker-track span {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: lowercase;
}

.ticker-track span:nth-child(odd) { color: var(--accent); }

/* ============================================================
   FEATURES — long-form transcript style
   ============================================================ */

.section-features {
  background:
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
}

.features {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  margin: 0 auto;
  max-width: var(--col);
}

.feature {
  border-top: 1px solid var(--line-ink);
  display: grid;
  gap: 24px;
  grid-template-columns: clamp(48px, 5vw, 80px) minmax(0, 1fr);
  padding-top: clamp(22px, 3vw, 36px);
  position: relative;
}

.feature::after {
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  top: -1px;
  width: clamp(48px, 5vw, 80px);
}

.feature-num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.feature-body {
  display: grid;
  gap: 14px;
  max-width: 70ch;
}

.feature-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-variation-settings: "opsz" 96, "SOFT" 36;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.feature-body p {
  color: var(--ink-2);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.7;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.feature-tags li {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 12px;
}

/* ============================================================
   PROCESS
   ============================================================ */

.section-process {
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(239, 194, 58, 0.14), transparent 70%),
    var(--bg);
}

.process {
  counter-reset: stepcount;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 0 auto;
  max-width: var(--col);
}

.process-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 18px;
  padding: 32px 28px 30px;
  position: relative;
}

.process-step::before {
  background: var(--accent);
  border-radius: 14px 14px 0 0;
  content: "";
  height: 5px;
  left: 24px;
  position: absolute;
  right: 24px;
  top: -1px;
}

.process-step:nth-child(2)::before { background: var(--amber); }
.process-step:nth-child(3)::before { background: var(--gold); }

.step-marker {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.step-time {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.step-glyph {
  align-items: center;
  background: var(--ink);
  border-radius: 12px;
  color: var(--paper);
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  font-weight: 700;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.step-body h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.step-body p {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ============================================================
   PRICING
   ============================================================ */

.section-pricing {
  background:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* ============================================================
   Rate board — diptych with shared-axis meter bars
   Single editorial panel split by a hairline divider. The two
   meter bars beneath the prices share one cost axis (0 → NT$20),
   so the precision bar visibly fills 3× the economy bar.
   ============================================================ */

.rate-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(42, 31, 26, 0.07);
  display: grid;
  gap: 24px;
  margin: 0 auto 44px;
  max-width: var(--col);
  overflow: hidden;
  padding: 34px 38px 28px;
  position: relative;
}

.rate-board::before {
  background: radial-gradient(ellipse at top right,
    rgba(196, 66, 27, 0.08),
    transparent 55%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.rate-board > * { position: relative; }

.rate-board-head {
  display: grid;
  gap: 6px;
}

.rate-board-eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.rate-board-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-variation-settings: "opsz" 72, "SOFT" 48;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0;
  max-width: 32ch;
}

.rate-board-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  overflow: hidden;
}

.rate-board-divider {
  background: var(--line);
  margin: 28px 0;
}

.rate-tier {
  display: grid;
  gap: 16px;
  padding: 30px 32px;
  position: relative;
}

.rate-tier-precision {
  background:
    linear-gradient(180deg, var(--surface-warm) 0%, transparent 80%);
}

.rate-tier-eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

.rate-tier-precision .rate-tier-eyebrow {
  color: var(--accent);
}

.rate-tier-price {
  align-items: baseline;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  gap: 4px;
  margin: 2px 0 0;
}

.rate-tier-currency {
  color: var(--ink-2);
  font-size: 20px;
  font-weight: 700;
}

.rate-tier-price strong {
  font-size: 68px;
  font-variation-settings: "opsz" 144, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

.rate-tier-unit {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 600;
  margin-left: 6px;
}

/* Shared-axis meter: same scale for both tiers, so the
   precision bar is literally 3× the economy bar visually */
.rate-tier-meter {
  background: rgba(42, 31, 26, 0.06);
  border-radius: 3px;
  height: 6px;
  overflow: visible;
  position: relative;
  width: 100%;
}

.rate-tier-meter-fill {
  background: linear-gradient(90deg, var(--amber) 0%, var(--accent) 100%);
  border-radius: 3px;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  transition: width .6s cubic-bezier(.2,.7,.2,1);
  width: var(--fill, 0%);
}

.rate-tier-meter-tick {
  background: var(--ink);
  border-radius: 1px;
  bottom: -12px;
  font-family: var(--font-mono);
  font-size: 0;
  height: 8px;
  left: calc(var(--at, 0%));
  position: absolute;
  transform: translateX(-50%);
  width: 1.5px;
}

.rate-tier-stack {
  align-items: center;
  background: rgba(196, 66, 27, 0.08);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  justify-self: start;
  letter-spacing: 0.02em;
  margin: 8px 0 0;
  padding: 7px 14px;
}

.rate-tier-precision .rate-tier-stack {
  background: rgba(196, 66, 27, 0.14);
}

.rate-tier-list {
  color: var(--ink-2);
  display: grid;
  font-size: 13px;
  gap: 8px;
  line-height: 1.5;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rate-tier-list li {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: 6px minmax(0, 1fr);
}

.rate-tier-list li::before {
  background: var(--accent);
  border-radius: 50%;
  content: "";
  display: block;
  height: 5px;
  margin-top: 7px;
  width: 5px;
}

.rate-board-foot {
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin: 0;
  padding-top: 14px;
}

@media (max-width: 720px) {
  .rate-board {
    border-radius: 20px;
    padding: 26px 22px 22px;
  }
  .rate-board-title {
    font-size: 22px;
  }
  .rate-board-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1px auto;
  }
  .rate-board-divider {
    height: 1px;
    margin: 0 24px;
  }
  .rate-tier {
    padding: 24px 24px;
  }
  .rate-tier-price strong {
    font-size: 56px;
  }
}

.tiers {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0 auto;
  max-width: var(--col);
  position: relative;
}

.tier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 28px 30px;
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease;
}

.tier-loading {
  grid-column: 1 / -1;
  min-height: 180px;
}

.tier-head { display: grid; gap: 8px; }

.tier-eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.tier-head h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.tier-price {
  align-items: baseline;
  display: flex;
  gap: 4px;
}

.tier-currency {
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 18px;
  font-variation-settings: "opsz" 30, "SOFT" 30;
  font-weight: 700;
}

.tier-price strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(48px, 5.5vw, 68px);
  font-variation-settings: "opsz" 144, "SOFT" 36;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.tier-plus {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 28px;
  font-variation-settings: "opsz" 60, "SOFT" 60;
  font-weight: 800;
}

.tier-summary {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
}

.tier-list {
  border-top: 1px dashed var(--line-strong);
  display: grid;
  gap: 9px;
  padding-top: 18px;
}

.tier-cta {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
  min-height: 48px;
}

.tier-list li {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  padding-left: 20px;
  position: relative;
}

.tier-list li::before {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  top: 8px;
  width: 6px;
}

.tier-featured {
  background: var(--ink);
  border-color: var(--cool);
  color: var(--paper);
  transform: translateY(-12px);
}

.tier-featured .tier-head h3,
.tier-featured .tier-price strong { color: var(--paper); }

.tier-featured .tier-eyebrow { color: var(--gold); }
.tier-featured .tier-currency { color: rgba(246, 233, 216, 0.7); }
.tier-featured .tier-summary,
.tier-featured .tier-list li { color: rgba(246, 233, 216, 0.85); }
.tier-featured .tier-list { border-top-color: rgba(246, 233, 216, 0.2); }
.tier-featured .tier-list li::before { background: var(--gold); }

.tier-flag {
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  position: absolute;
  right: 20px;
  text-transform: uppercase;
  top: -14px;
}

.tier-footnote {
  margin: 28px auto 0;
  max-width: var(--col);
  text-align: center;
}

.tier-footnote a {
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  padding-bottom: 2px;
}

.tier-footnote a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* ============================================================
   SIGN IN
   ============================================================ */

.section-signin {
  background: var(--bg);
  padding-bottom: clamp(96px, 11vw, 160px);
}

.signin-grid {
  align-items: start;
  display: grid;
  gap: clamp(36px, 5vw, 72px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  margin: 0 auto;
  max-width: var(--col);
}

.signin-copy { display: grid; gap: 22px; }

.signin-lead {
  color: var(--ink-2);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.7;
  max-width: 48ch;
}

.checklist {
  display: grid;
  gap: 12px;
  max-width: 46ch;
}

.checklist li {
  align-items: baseline;
  color: var(--ink);
  display: grid;
  font-size: 15px;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr);
  line-height: 1.55;
}

.checklist strong {
  color: var(--ink);
  font-weight: 800;
  margin-right: 4px;
}

.checklist-mark {
  align-items: center;
  background: var(--success-soft);
  border: 1px solid rgba(90, 125, 58, 0.34);
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  margin-top: 1px;
  width: 24px;
}

.signin-help {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.55;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(42, 31, 26, 0.10);
  padding: 30px 30px 26px;
  position: relative;
}

.auth-panel::before {
  background: var(--accent);
  border-radius: 20px 20px 0 0;
  content: "";
  height: 6px;
  left: 28px;
  position: absolute;
  right: 28px;
  top: -1px;
}

.auth-panel-head {
  border-bottom: 1px dashed var(--line);
  margin-bottom: 22px;
  padding-bottom: 16px;
}

.auth-panel-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.auth-panel-head h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-top: 4px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-form input,
.history-search input,
.admin-grid input,
.referral-link-input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  width: 100%;
}

.login-form input:focus,
.history-search input:focus,
.admin-grid input:focus,
.referral-link-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 66, 27, 0.16);
}

.auth-divider {
  align-items: center;
  color: var(--ink-3);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 12px;
  margin: 16px 0;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--line);
  content: "";
  flex: 1 1 auto;
  height: 1px;
}

.message {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
  min-height: 18px;
}

/* ============================================================
   MEMBER · GREETING
   ============================================================ */

.section-greeting {
  background: var(--bg);
  padding-top: clamp(48px, 6vw, 96px);
}

.greeting-grid {
  display: grid;
  gap: 26px;
  margin: 0 auto;
  max-width: var(--col);
}

.greeting-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.member-id {
  align-items: baseline;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  gap: 10px;
}

.member-id-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.member-id strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 36;
  font-weight: 800;
}

.member-stats { display: grid; gap: 14px; }

.metrics {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  overflow: hidden;
}

.metrics > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 26px 24px;
  position: relative;
}

.metrics > div:last-child { border-right: 0; }
.metrics > div::before {
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  content: "";
  height: 3px;
  left: 24px;
  position: absolute;
  top: 0;
  width: 36px;
}

.metric-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-variation-settings: "opsz" 96, "SOFT" 36;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backend-strip {
  align-items: center;
  background: var(--ink);
  border-radius: 12px;
  color: var(--paper);
  display: flex;
  font-size: 12px;
  gap: 10px;
  overflow: hidden;
  padding: 12px 16px;
}

.backend-strip span { color: var(--gold); white-space: nowrap; }
.backend-strip code {
  color: rgba(246, 233, 216, 0.85);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   MEMBER · REFERRAL
   ============================================================ */

.section-referral {
  background: var(--bg-2);
}

.referral-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: var(--col);
  padding: 26px 24px;
}

.referral-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.referral-summary > div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
}

.referral-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.referral-code {
  color: var(--accent) !important;
  font-size: 28px !important;
  letter-spacing: 0.08em;
}

.referral-link-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.referral-link-input {
  color: var(--ink-2);
  min-width: 0;
}

.referral-note {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ============================================================
   MEMBER · plans + billing readiness + ledger + history + admin
   ============================================================ */

.billing-state {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 12px;
}

.billing-state.ready {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.28);
  color: var(--success);
}

.billing-state.warning {
  background: var(--warning-soft);
  border-color: rgba(184, 116, 28, 0.30);
  color: var(--warning);
}

.billing-state.blocked {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.28);
  color: var(--danger);
}

.plans {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0 auto;
  max-width: var(--col);
}

.plans .empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-3);
  grid-column: 1 / -1;
  padding: 36px 28px;
  text-align: center;
}

.plans article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 12px;
  padding: 26px 24px 24px;
  position: relative;
}

.plans article.payment-disabled {
  opacity: 0.72;
}

.plans article.plan-admin-only {
  border-color: rgba(196, 66, 27, 0.42);
  box-shadow: 0 18px 42px rgba(196, 66, 27, 0.10);
}

.plans article header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.plans h3 {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
}

.plan-admin-badge {
  background: var(--danger-soft);
  border: 1px solid rgba(181, 61, 40, 0.22);
  border-radius: 999px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
}

.plans .plan-price {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 30px;
  font-variation-settings: "opsz" 144, "SOFT" 36;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.plan-button {
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  color: var(--paper);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  margin-top: auto;
  padding: 12px 14px;
  transition: background-color .18s ease;
}

.plan-button:hover:not(:disabled) { background: var(--accent); }
.plan-button:disabled { background: var(--soft); cursor: not-allowed; }

.service-status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 28px auto 0;
  max-width: var(--col);
  padding: 0;
}

.service-status summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  padding: 18px 24px;
}

.service-status summary::-webkit-details-marker { display: none; }
.service-status summary span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.service-status[open] summary {
  border-bottom: 1px solid var(--line);
}

.readiness-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.readiness-grid article {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 18px 22px;
}

.readiness-grid article:last-child { border-right: 0; }
.readiness-grid article span { color: var(--accent); }
.readiness-grid article strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.readiness-message {
  color: var(--ink-2);
  font-size: 13.5px;
  padding: 18px 24px 0;
}

.readiness-checklist {
  display: grid;
  gap: 10px;
  padding: 18px 24px 22px;
}

.readiness-checklist .empty {
  color: var(--ink-3);
  font-size: 13px;
}

.section-ledger,
.section-history { background: var(--bg-2); }

.section-member-credits { background: var(--bg); }

.history-list {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: var(--col);
}

.history-list .empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-3);
  padding: 36px 28px;
  text-align: center;
}

.history-tools {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 auto 24px;
  max-width: var(--col);
}

.history-search {
  display: grid;
  gap: 6px;
}

.history-search span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.history-actions {
  align-items: end;
  display: flex;
  gap: 10px;
}

.history-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0 auto 22px;
  max-width: var(--col);
  padding: 22px 24px;
}

.history-detail-header {
  align-items: flex-start;
  border-bottom: 1px dashed var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.history-detail-header span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.history-detail-header h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
  margin: 6px 0 4px;
}

.history-detail-header p {
  color: var(--ink-3);
  font-size: 13px;
}

.history-segments .empty {
  color: var(--ink-3);
  font-size: 13.5px;
  padding: 18px 0;
  text-align: center;
}

.section-admin { background: var(--bg); padding-bottom: clamp(64px, 8vw, 120px); }

.section-admin details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 auto;
  max-width: var(--col);
  padding: 0;
}

.section-admin summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  padding: 22px 28px;
}

.section-admin summary::-webkit-details-marker { display: none; }

.section-admin summary span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.section-admin details[open] summary { border-bottom: 1px solid var(--line); }

.section-copy {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
  padding: 18px 28px 0;
}

.admin-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 18px 28px;
}

.admin-grid label { display: grid; gap: 6px; }
.admin-grid span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 28px 14px;
}

.admin-result {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 0 28px 24px;
  overflow-x: auto;
  padding: 14px 16px;
  white-space: pre;
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */

.admin-page {
  background: #f7efe4;
  min-height: 100vh;
}

.admin-topbar {
  background: rgba(255, 250, 242, 0.94);
}

.admin-topbar .brand-mark {
  color: var(--paper);
  font-weight: 900;
}

.admin-shell {
  margin: 0 auto;
  max-width: 1480px;
  padding: 32px var(--gutter) 80px;
}

.admin-auth-card,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(42, 31, 26, 0.06);
}

.admin-auth-card {
  display: grid;
  gap: 14px;
  margin: 48px auto;
  max-width: 520px;
  padding: 32px;
}

.admin-auth-card button,
.nav-action {
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  color: var(--paper);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
}

.nav-action.ghost {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.admin-workspace,
.admin-section {
  display: grid;
  gap: 22px;
}

.admin-heading,
.admin-section-head {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.admin-heading h1,
.admin-section-head h2 {
  color: var(--ink);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 80, "SOFT" 34;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.admin-heading h1 { font-size: clamp(28px, 4vw, 48px); }
.admin-section-head h2 { font-size: clamp(24px, 3vw, 34px); }

.admin-heading p,
.admin-section-head p {
  color: var(--ink-2);
}

.admin-refresh,
.topbar-cta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.auth-badge,
.status-pill {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 11px;
}

.status-pill.ok {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.26);
  color: var(--success);
}

.status-pill.danger {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.26);
  color: var(--danger);
}

.admin-metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.admin-metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
}

.admin-metric-card span,
.admin-card-title-row span,
.admin-table span,
.admin-kv-grid span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 800;
}

.admin-metric-card strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.admin-metric-card p {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.admin-workspace .admin-grid.two,
.admin-workspace .admin-chart-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-workspace .admin-chart-grid,
.admin-workspace .admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.admin-card {
  min-width: 0;
  padding: 18px;
}

.admin-card h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.admin-card-title-row {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-chart {
  min-height: 280px;
  overflow-x: auto;
}

.admin-chart-svg {
  display: block;
  min-width: 640px;
  width: 100%;
}

.admin-chart-axis {
  fill: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
}

.admin-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.admin-chart-legend span {
  align-items: center;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.admin-chart-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.admin-provider-latency-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  margin-top: 14px;
}

.admin-provider-latency-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.admin-provider-latency-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-provider-latency-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-provider-latency-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-provider-latency-head span:not(.status-pill) {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-latency-percentile-plot {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  padding: 8px;
}

.admin-latency-percentile-plot .admin-chart-svg {
  min-width: 620px;
}

@media (max-width: 560px) {
  .admin-provider-latency-grid {
    grid-template-columns: 1fr;
  }

  .admin-provider-latency-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.admin-chart-empty,
.admin-empty,
.admin-load-errors {
  color: var(--ink-3);
  font-size: 13px;
}

.admin-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.admin-table strong {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
}

.admin-table span {
  display: block;
  font-family: var(--font-body);
  line-height: 1.45;
  margin-top: 4px;
}

.admin-kv-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.admin-kv-grid div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.admin-kv-grid strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.admin-glossary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.admin-glossary-card h3 {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-glossary-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.admin-glossary-card span,
.admin-glossary-card p {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .admin-heading,
  .admin-section-head {
    align-items: start;
    display: grid;
  }

  .admin-workspace .admin-grid.two,
  .admin-workspace .admin-chart-grid.two {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(56px, 7vw, 96px) var(--gutter) clamp(32px, 4vw, 48px);
  position: relative;
}

.footer::before {
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent) 70%, transparent 100%);
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.footer-grid {
  align-items: end;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  margin: 0 auto;
  max-width: var(--col);
}

.footer-brand { display: grid; gap: 12px; }

.footer-mark {
  background: var(--accent);
  border-radius: 12px;
  color: var(--paper);
  display: inline-block;
  font-family: var(--font-display);
  font-size: 32px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-weight: 900;
  height: 64px;
  letter-spacing: -0.04em;
  line-height: 64px;
  text-align: center;
  width: 64px;
}

.footer-brand p {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 26px;
  font-variation-settings: "opsz" 60, "SOFT" 34;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.footer-tag {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.footer-nav a {
  color: rgba(246, 233, 216, 0.7);
  font-size: 13.5px;
  font-weight: 600;
  transition: color .18s ease;
}

.footer-nav a:hover { color: var(--gold); }

.footer-credit {
  color: rgba(246, 233, 216, 0.45);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 980px) {
  .hero-grid,
  .signin-grid,
  .greeting-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-stream { order: -1; }

  .greeting-row { flex-direction: column; align-items: flex-start; }

  .topbar-nav { display: none; }

  .feature {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
  }

  .tier-featured { transform: none; }

  .history-tools { grid-template-columns: 1fr; }

  .footer-grid { gap: 24px; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 18px; }
  .topbar-cta .btn { display: none; }
  .auth-badge { display: none; }
  .brand-text { display: none; }
  .brand-tag { display: block; }

  .hero-headline { font-size: clamp(46px, 11vw, 76px); }
  .section-title { font-size: clamp(30px, 7vw, 44px); }
  .feature-num { font-size: 32px; }
  .tier-price strong { font-size: 44px; }

  .metrics { grid-template-columns: 1fr; }
  .metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .metrics > div:last-child { border-bottom: 0; }

  .referral-link-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   GSAP animation hooks
   - <html.no-anim>: GSAP failed → reveal everything
   - <html.has-anim>: GSAP is taking over visibility
   - <html.reduced-motion>: respect user preference
   ============================================================ */

.has-anim .feature,
.has-anim .process-step,
.has-anim .tier,
.has-anim .metrics > div,
.has-anim .hl-word,
.has-anim .stream-line {
  will-change: transform, opacity;
}

/* Only pre-hide below-the-fold scroll-revealed sections — the hero is above
   the fold and must appear immediately to avoid a blank flash on first paint.
   GSAP layers a quick entrance motion on top of the already-visible hero. */
.has-anim:not(.reduced-motion) .feature,
.has-anim:not(.reduced-motion) .process-step,
.has-anim:not(.reduced-motion) .tier {
  opacity: 0;
  visibility: hidden;
}

.reduced-motion .feature,
.reduced-motion .process-step,
.reduced-motion .tier {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  .paper-grain, .topbar, .footer { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ============================================================
   Admin dashboard · enhanced chart system
   - dual Y-axis with labeled tick marks
   - summary header with latest values + delta pills
   - hover crosshair + HTML tooltip overlay
   - KPI sparklines
   ============================================================ */

.admin-chart {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 380px;
  padding: 14px 16px;
}

.admin-chart-card-shell {
  display: grid;
  gap: 12px;
}

.admin-chart-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-chart-summary--grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-chart-summary-fraction {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  margin-left: 4px;
}

.admin-chart-summary-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.admin-chart-summary-row > div {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.admin-chart-summary-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-chart-summary-value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chart-swatch {
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.admin-chart-swatch.line {
  border-radius: 999px;
  height: 12px;
  width: 12px;
}

.admin-chart-delta {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 4px 9px;
}

.admin-chart-delta.up {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.34);
  color: var(--success);
}

.admin-chart-delta.down {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.34);
  color: var(--danger);
}

.admin-chart-delta.neutral {
  color: var(--ink-3);
}

/* SVG chart */
.admin-chart-plot {
  position: relative;
}

.admin-chart-svg {
  display: block;
  min-width: 0;
  width: 100%;
}

.admin-chart-axis-y {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-chart-axis-y.line {
  fill: var(--cool);
  text-anchor: start;
}

.admin-chart-axis-x {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}

.admin-chart-axis-title {
  fill: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-chart-axis-title.line {
  fill: var(--cool);
}

.admin-chart-bar {
  transition: opacity .15s ease;
}

.admin-chart-hit:hover ~ .admin-chart-bar,
.admin-chart-hit:hover {
  cursor: crosshair;
}

.admin-chart-crosshair {
  pointer-events: none;
}

.admin-chart-tooltip {
  background: var(--ink);
  border: 1px solid var(--cool-2);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(42, 31, 26, 0.28);
  color: var(--paper);
  font-size: 12px;
  left: 0;
  min-width: 180px;
  padding: 12px 14px;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 5;
}

.admin-chart-tooltip-head {
  border-bottom: 1px dashed rgba(246, 233, 216, 0.22);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  text-transform: uppercase;
}

.admin-chart-tooltip-total {
  color: rgba(246, 233, 216, 0.7);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 6px;
}

.admin-chart-tooltip-total strong {
  color: var(--paper);
  font-size: 14px;
  font-weight: 800;
  margin-left: 6px;
}

.admin-chart-tooltip-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  padding: 3px 0;
}

.admin-chart-tooltip-label {
  color: rgba(246, 233, 216, 0.75);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chart-tooltip-value {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.admin-chart-tooltip-footer {
  border-top: 1px dashed rgba(246, 233, 216, 0.22);
  color: rgba(246, 233, 216, 0.55);
  font-family: var(--font-mono);
  font-size: 10.5px;
  margin-top: 6px;
  padding-top: 6px;
}

/* KPI metric cards (enhanced with sparklines + delta) */
.admin-metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-metric-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(196, 66, 27, 0.10);
  transform: translateY(-2px);
}

.admin-metric-card.accent-primary {
  border-left-color: var(--accent);
}

.admin-metric-card.accent-danger {
  border-left-color: var(--danger);
}

.admin-metric-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 2px;
}

.admin-metric-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-metric-value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.4vw, 32px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.admin-metric-spark {
  margin-top: 2px;
}

.admin-sparkline {
  display: block;
  height: 28px;
  width: 100%;
}

.admin-metric-hint {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 2px;
}

.admin-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.admin-chart-legend span {
  align-items: center;
  color: var(--ink-2);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
}

.admin-chart-legend i {
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

/* ============================================================
   Expandable KPI cards
   ============================================================ */

.admin-metric-head-right {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.admin-metric-toggle {
  align-items: center;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
  width: 26px;
}

.admin-metric-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  transform: scale(1.05);
}

.admin-metric-card.is-expanded {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .admin-metric-card.is-expanded {
    grid-column: 1 / -1;
  }
}

.admin-metric-card.is-expanded .admin-metric-toggle {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  font-size: 16px;
}

.admin-metric-expanded {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 10px;
  padding: 12px 12px 8px;
}

.admin-metric-chart-plot {
  margin: 0 auto;
  max-width: 640px;
  position: relative;
}

.admin-metric-chart-svg {
  display: block;
  height: auto;
  max-width: 640px;
  width: 100%;
}

.admin-metric-collapse {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 10px auto 2px;
  padding: 6px 18px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.admin-metric-collapse:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

/* ============================================================
   Time period selector (in expanded KPI charts)
   ============================================================ */

.admin-metric-period {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 12px;
}

.admin-period-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 44px;
  padding: 6px 12px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.admin-period-btn:hover {
  background: var(--surface-warm);
  border-color: var(--line-strong);
  color: var(--ink);
}

.admin-period-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.admin-metric-chart-host {
  display: block;
}

/* ============================================================
   Member center (post-login) — full redesign
   - Welcome strip
   - Balance hero (dark navy + gold) + quick stats
   - Referral card with prominent code + link
   - Plans, History, Ledger sections with cleaner cards
   ============================================================ */

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* --- Welcome strip ----------------------------------------- */

.member-welcome {
  align-items: flex-end;
  border-bottom: 1px solid var(--line-ink);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--col);
  padding: clamp(24px, 4vw, 36px) var(--gutter) clamp(20px, 3vw, 28px);
}

.member-welcome-text { min-width: 0; }

.member-welcome-eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.member-welcome-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-variation-settings: "opsz" 144, "SOFT" 36;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.member-welcome-comma { color: var(--ink-3); }

.member-welcome-email {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 72;
  word-break: break-all;
}

.member-welcome-signout {
  flex: 0 0 auto;
}

/* --- Balance hero + quick stats ----------------------------- */

.member-overview {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  margin: 0 auto;
  max-width: var(--col);
  padding: clamp(28px, 4vw, 44px) var(--gutter) clamp(20px, 3vw, 32px);
}

@media (max-width: 940px) {
  .member-overview { grid-template-columns: 1fr; }
}

.member-balance-card {
  background:
    linear-gradient(135deg, var(--ink) 0%, var(--cool) 65%, var(--cool-2) 100%);
  border-radius: 22px;
  box-shadow:
    0 28px 60px rgba(26, 39, 66, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--paper);
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 40px);
  position: relative;
}

.member-balance-glow {
  background:
    radial-gradient(ellipse 70% 60% at 90% -10%, rgba(239, 194, 58, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 70% at 0% 110%, rgba(196, 66, 27, 0.30), transparent 60%);
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.member-balance-card > *:not(.member-balance-glow) { position: relative; z-index: 1; }

.member-balance-eyebrow {
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.member-balance-value {
  color: var(--gold);
  display: block;
  font-family: var(--font-display);
  font-size: clamp(54px, 9vw, 104px);
  font-variation-settings: "opsz" 144, "SOFT" 36;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 2px 0 4px;
  text-shadow: 0 2px 24px rgba(239, 194, 58, 0.25);
  word-break: break-word;
}

.member-balance-hint {
  color: rgba(246, 233, 216, 0.78);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 6px;
  max-width: 36ch;
}

.member-balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.member-balance-cta {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.member-balance-cta:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.btn-balance-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(246, 233, 216, 0.30);
  color: var(--paper);
}

.btn-balance-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(246, 233, 216, 0.55);
}

/* --- Quick stats grid --------------------------------------- */

.member-quick-stats {
  align-content: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-quick-stat {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.member-quick-stat:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(42, 31, 26, 0.08);
  transform: translateY(-2px);
}

.quick-stat-glyph {
  align-items: center;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.member-quick-stat:nth-child(2) .quick-stat-glyph { color: var(--amber); }
.member-quick-stat:nth-child(3) .quick-stat-glyph { color: var(--ember); }
.member-quick-stat:nth-child(4) .quick-stat-glyph {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.30);
  color: var(--success);
}

.quick-stat-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quick-stat-label {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quick-stat-value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-variation-settings: "opsz" 96, "SOFT" 36;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-backend-stub { display: none; }

/* --- Generic member section --------------------------------- */

.member-section {
  margin: 0 auto;
  max-width: var(--col);
  padding: clamp(36px, 5vw, 64px) var(--gutter);
}

.member-section + .member-section { padding-top: 0; }

.member-section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.member-section-head-text { display: grid; gap: 10px; }

.member-section-eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.member-section-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-variation-settings: "opsz" 144, "SOFT" 36;
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.1;
  max-width: 22ch;
}

.member-section-lead {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 58ch;
}

.member-state-pill {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  white-space: nowrap;
}

.member-state-pill.ready {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.32);
  color: var(--success);
}
.member-state-pill.warning {
  background: var(--warning-soft);
  border-color: rgba(184, 116, 28, 0.32);
  color: var(--warning);
}
.member-state-pill.blocked {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.30);
  color: var(--danger);
}

/* --- Referral card ----------------------------------------- */

.member-referral-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3vw, 36px);
  position: relative;
}

.member-referral-card::before {
  background: linear-gradient(90deg, var(--accent), var(--amber), var(--gold));
  border-radius: 20px 20px 0 0;
  content: "";
  height: 4px;
  left: 24px;
  position: absolute;
  right: 24px;
  top: -1px;
}

.member-referral-code-block {
  align-items: baseline;
  border-bottom: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
}

.member-referral-code-label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.member-referral-code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 38px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.member-referral-link-row {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 560px) {
  .member-referral-link-row { grid-template-columns: 1fr; }
}

.member-referral-link-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
  padding: 0;
}

.member-referral-link-input {
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  padding: 12px 14px;
  width: 100%;
}

.member-referral-link-input:focus {
  border-radius: 9px;
  box-shadow: 0 0 0 3px rgba(196, 66, 27, 0.18);
}

.member-referral-stats {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  overflow: hidden;
}

.member-referral-stats > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.member-referral-stats > div:last-child { border-right: 0; }

.member-referral-stats dt {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.member-referral-stats dd {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-variation-settings: "opsz" 60, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.member-referral-note {
  background: var(--surface-warm);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
}

/* --- Plans (kept compatible with existing .plans) ----------- */

.member-plans-section .plans {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0 auto;
  max-width: var(--col);
}

.member-plans-section .plans article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(42, 31, 26, 0.06);
  display: grid;
  gap: 12px;
  padding: 24px 22px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.member-plans-section .plans article:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 48px rgba(42, 31, 26, 0.10);
  transform: translateY(-3px);
}

/* --- Service status details (admin-style readiness) ---------- */

.member-service-status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: clamp(24px, 3vw, 36px);
  padding: 0;
}

.member-service-status summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  padding: 18px 22px;
}

.member-service-status summary::-webkit-details-marker { display: none; }
.member-service-status summary span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.member-service-status[open] summary { border-bottom: 1px solid var(--line); }

/* --- History tools ------------------------------------------ */

.member-history-tools {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: clamp(18px, 2vw, 24px);
  padding: 12px 14px;
}

@media (max-width: 640px) {
  .member-history-tools { grid-template-columns: 1fr; }
}

.member-search-field {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 8px 14px;
}

.member-search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 66, 27, 0.16);
}

.member-search-icon {
  color: var(--ink-3);
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

.member-search-field input {
  background: transparent;
  border: 0;
  color: var(--ink);
  flex: 1 1 auto;
  font-size: 14px;
  outline: none;
  padding: 6px 0;
}

.member-history-actions {
  display: flex;
  gap: 8px;
}

/* --- History detail panel ---------------------------------- */

.member-history-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: clamp(18px, 2vw, 24px);
  padding: 22px 24px;
}

.history-detail-eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Sections share the existing .history-list rules ------- */

.member-history-section .history-list,
.member-ledger-section .history-list,
.member-orders-section .history-list {
  display: grid;
  gap: 12px;
}

.member-history-section .history-list .empty,
.member-ledger-section .history-list .empty,
.member-orders-section .history-list .empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-3);
  font-size: 13.5px;
  padding: 32px 24px;
  text-align: center;
}

.order-card {
  border-left: 5px solid var(--line-strong);
}

.order-card.order-status-paid {
  border-left-color: var(--success);
}

.order-card.order-status-failed {
  border-left-color: var(--danger);
}

.order-card.order-status-checkout_created,
.order-card.order-status-pending {
  border-left-color: var(--warning);
}

.order-meta {
  color: var(--ink-3);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.order-card-pill {
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 8px;
  padding: 3px 9px;
  text-transform: uppercase;
  vertical-align: middle;
}

.order-card.order-status-paid .order-card-pill {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.34);
  color: var(--success);
}

.order-card.order-status-failed .order-card-pill,
.order-card.order-status-cancelled .order-card-pill,
.order-card.order-status-canceled .order-card-pill {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.32);
  color: var(--danger);
}

.order-card.order-status-checkout_created .order-card-pill,
.order-card.order-status-pending .order-card-pill {
  background: var(--warning-soft);
  border-color: rgba(184, 116, 28, 0.32);
  color: var(--warning);
}

/* --- Body view-mode toggle hides legacy section in member ---- */

body[data-view="member"] .section-greeting,
body[data-view="member"] .section-referral,
body[data-view="member"] .section-member-credits,
body[data-view="member"] .section-history,
body[data-view="member"] .section-ledger {
  display: none;
}

/* --- Responsive ---------------------------------------------- */

@media (max-width: 720px) {
  .member-welcome { flex-direction: column; align-items: flex-start; }
  .member-quick-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   Extension auth bridge (extension-login.html)
   ============================================================ */

.extension-auth-page {
  background:
    radial-gradient(80% 60% at 8% 0%, rgba(196, 66, 27, 0.10), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(26, 39, 66, 0.10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.ext-auth-shell {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  grid-template-rows: auto 1fr auto;
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 5vw, 56px) clamp(28px, 4vw, 48px);
  position: relative;
  z-index: 2;
}

/* --- Header ------------------------------------------------- */

.ext-auth-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.ext-auth-badge {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.04em;
  padding: 8px 14px 8px 12px;
  text-transform: uppercase;
}

.ext-auth-badge-dot {
  background: var(--soft);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(184, 163, 153, 0.18);
  height: 8px;
  transition: background-color .18s ease, box-shadow .18s ease;
  width: 8px;
}

.ext-auth-badge[data-state="busy"] .ext-auth-badge-dot {
  animation: extAuthPulse 1.2s ease-in-out infinite;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(215, 122, 44, 0.22);
}

.ext-auth-badge[data-state="ok"] {
  background: var(--success-soft);
  border-color: rgba(90, 125, 58, 0.32);
  color: var(--success);
}

.ext-auth-badge[data-state="ok"] .ext-auth-badge-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(90, 125, 58, 0.22);
}

.ext-auth-badge[data-state="warn"] {
  background: var(--warning-soft);
  border-color: rgba(184, 116, 28, 0.30);
  color: var(--warning);
}

.ext-auth-badge[data-state="warn"] .ext-auth-badge-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(184, 116, 28, 0.22);
}

.ext-auth-badge[data-state="error"] {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.30);
  color: var(--danger);
}

.ext-auth-badge[data-state="error"] .ext-auth-badge-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(181, 61, 40, 0.22);
}

@keyframes extAuthPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.85; }
}

/* --- Stage layout ------------------------------------------- */

.ext-auth-stage {
  align-items: center;
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
}

@media (max-width: 880px) {
  .ext-auth-stage { grid-template-columns: minmax(0, 1fr); }
}

.ext-auth-copy {
  display: grid;
  gap: 22px;
  max-width: 56ch;
}

.ext-auth-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ext-auth-headline {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(36px, 5.4vw, 56px);
  font-variation-settings: "opsz" 80, "SOFT" 38;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.ext-auth-headline-accent {
  background-image: linear-gradient(120deg, var(--accent) 0%, var(--ember) 60%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ext-auth-lead {
  color: var(--ink-2);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.7;
}

.ext-auth-checklist {
  display: grid;
  gap: 12px;
}

.ext-auth-checklist li {
  align-items: baseline;
  color: var(--ink);
  display: grid;
  font-size: 14.5px;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr);
  line-height: 1.55;
}

.ext-auth-checklist strong { font-weight: 800; }

.ext-auth-check {
  align-items: center;
  background: var(--success-soft);
  border: 1px solid rgba(90, 125, 58, 0.34);
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  margin-top: 1px;
  width: 24px;
}

.ext-auth-fineprint {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
}

.ext-auth-fineprint a {
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-2);
  transition: color .18s ease, border-color .18s ease;
}

.ext-auth-fineprint a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* --- Card --------------------------------------------------- */

.ext-auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 30px 60px rgba(42, 31, 26, 0.12),
    0 8px 20px rgba(42, 31, 26, 0.06);
  overflow: hidden;
  padding: clamp(28px, 3vw, 38px) clamp(24px, 3vw, 36px) clamp(26px, 3vw, 34px);
  position: relative;
}

.ext-auth-card-ribbon {
  background: linear-gradient(90deg, var(--accent), var(--ember), var(--amber));
  border-radius: 24px 24px 0 0;
  height: 6px;
  left: 24px;
  position: absolute;
  right: 24px;
  top: -1px;
}

.ext-auth-card-head {
  border-bottom: 1px dashed var(--line);
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.ext-auth-card-cue {
  color: var(--cool);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ext-auth-card-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-variation-settings: "opsz" 60, "SOFT" 32;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.ext-auth-card-sub {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.ext-auth-card-body { display: grid; gap: 14px; }

.ext-auth-google {
  align-items: center;
  display: inline-flex;
  font-weight: 700;
  gap: 10px;
  height: 50px;
  justify-content: center;
}

.ext-auth-divider {
  align-items: center;
  color: var(--ink-3);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  letter-spacing: 0.10em;
  margin: 6px 0;
  text-transform: uppercase;
}

.ext-auth-divider::before,
.ext-auth-divider::after {
  background: var(--line);
  content: "";
  height: 1px;
}

.ext-auth-form { display: grid; gap: 12px; }

.ext-auth-form label {
  display: grid;
  gap: 6px;
}

.ext-auth-form label > span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ext-auth-form input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
  padding: 13px 14px;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}

.ext-auth-form input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 66, 27, 0.16);
}

.ext-auth-form input:disabled {
  background: var(--bg-2);
  color: var(--ink-3);
  cursor: not-allowed;
}

.ext-auth-form-row { display: grid; }

.ext-auth-submit {
  margin-top: 4px;
}

.ext-auth-mode-switch {
  align-items: baseline;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
  text-align: center;
}

.ext-auth-mode-switch .btn-link {
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ext-auth-account {
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 6px;
  min-height: 1em;
  text-align: center;
}

.ext-auth-message {
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  min-height: 1em;
  padding: 0;
  text-align: center;
}

.ext-auth-message:not(:empty) {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 10px 12px;
}

.ext-auth-message[data-tone="error"]:not(:empty) {
  background: var(--danger-soft);
  border-color: rgba(181, 61, 40, 0.32);
  color: var(--danger);
}

.ext-auth-message[data-tone="warn"]:not(:empty) {
  background: var(--warning-soft);
  border-color: rgba(184, 116, 28, 0.32);
  color: var(--warning);
}

/* --- Success state ----------------------------------------- */

.ext-auth-card-success {
  display: grid;
  gap: 14px;
  text-align: center;
}

.ext-auth-success-check {
  align-items: center;
  background: var(--success-soft);
  border: 2px solid rgba(90, 125, 58, 0.38);
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  font-size: 26px;
  font-weight: 900;
  height: 64px;
  justify-self: center;
  margin: 4px 0 4px;
  width: 64px;
}

.ext-auth-success-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-variation-settings: "opsz" 60, "SOFT" 32;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.ext-auth-success-sub {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 36ch;
}

.ext-auth-success-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 6px;
}

@media (min-width: 480px) {
  .ext-auth-success-actions { grid-template-columns: minmax(0, 1fr) auto; }
}

.ext-auth-success-hint {
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  margin-top: 2px;
  text-transform: uppercase;
}

/* --- Footer ------------------------------------------------ */

.ext-auth-footer {
  align-items: center;
  border-top: 1px solid var(--line-ink);
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  font-size: 11.5px;
  gap: 10px;
  justify-content: center;
  letter-spacing: 0.04em;
  padding-top: 18px;
  text-transform: uppercase;
}

.ext-auth-footer a {
  border-bottom: 1px solid transparent;
  color: var(--ink-2);
  transition: border-color .15s ease, color .15s ease;
}

.ext-auth-footer a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.ext-auth-footer-dot { opacity: 0.55; }
