/* ============================================================
   AITAIWAN.CLOUD — design tokens + shared styles (redesign v2)
   Signature: the 五維 (five-dimension) pentagon mark — an outline
   glyph on the landing page, traced dimension-by-dimension as the
   quiz is answered, fully resolved as the real data radar on the
   result page. One shape, three states, always real data (never
   pure decoration) — see src/radar.mjs + partials/pentagon-mark.ejs.
   ============================================================ */

:root {
  /* Color — dark surface family (kept from the share cards already live
     on social media: og:image continuity result-page -> card is a real
     product argument, not a default reach). Differentiated from the
     generic "near-black + one accent" look via a two-stop brand gradient
     PLUS a distinct gold "instrument reading" hue for scores/tiers, plus
     four narrowly-scoped Gallup domain hues used only inside the picker. */
  /* Titanium aurora palette D — titanium-ink surfaces + teal→indigo aurora accent. */
  --bg: #0B0F16;
  --surface: #131A26;
  --elevated: #182234;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #EDF1F7;
  --text-2: #93A0B4;
  --violet: #2DD4BF;  /* accent gradient stop 1 (teal) — legacy var name */
  --cyan: #818CF8;    /* accent gradient stop 2 (indigo) — legacy var name */
  --gold: #F0C987;
  --danger: #f2647a;

  --gradient-brand: linear-gradient(120deg, var(--violet), var(--cyan));

  /* Gallup domain hues (quiz picker + result chips ONLY — never the base UI).
     MUST match GALLUP_DOMAINS in src/constants.mjs (that JS constant is the
     real source of truth; the live chips read from it, these vars mirror it). */
  --domain-executing: #c084fc;
  --domain-influencing: #fb923c;
  --domain-relationship: #38bdf8;
  --domain-strategic: #facc15;

  /* Type scale (12/14/16/20/28/40), tabular numerals for every number. */
  --font-body: 'Noto Sans TC', -apple-system, 'PingFang TC', 'Segoe UI', sans-serif;
  --step-2: 0.75rem;   /* 12px — utility/caption */
  --step-1: 0.875rem;  /* 14px */
  --step0: 1rem;       /* 16px — body */
  --step1: 1.25rem;    /* 20px */
  --step2: 1.75rem;    /* 28px */
  --step3: 2.5rem;     /* 40px — display */

  --radius: 12px;
  --radius-sm: 8px;
  --content-max: 720px;
  --motion-fast: 160ms;
  --motion-med: 320ms;
}

@media (prefers-color-scheme: light) {
  :root {
    /* The brief pins a dark product identity for continuity with the share
       cards; light-mode support here is a safety net for OS-level forced
       light themes, not a second design direction. */
    --bg: #0B0F16;
    --surface: #131A26;
    --elevated: #182234;
    --text: #EDF1F7;
    --text-2: #93A0B4;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); }

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

/* --- numerals: every score/count/rank uses tabular figures --- */
.num, .tier, .total, .bar-value, .progress-count, .chip-rank, .rank-badge {
  font-variant-numeric: tabular-nums;
}

/* --- eyebrow / structural labels (instrument-panel vernacular) --- */
.eyebrow {
  display: inline-block;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

h1 {
  font-size: var(--step3);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0.2rem 0 0.6rem;
}

h2 {
  font-size: var(--step1);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.8rem;
  color: var(--text);
}

h3 { font-size: var(--step-1); font-weight: 700; margin: 0 0 0.4rem; }

p { margin: 0.6rem 0; }

.sub { color: var(--text-2); font-size: var(--step1); line-height: 1.6; }

.muted { color: var(--text-2); font-size: var(--step-1); }

ul { padding-left: 1.2rem; margin: 0.5rem 0; }
li { margin: 0.4rem 0; }

/* --- site chrome --- */
.site-header {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  font-size: var(--step-1);
}

/* --- cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem;
  margin: 1rem 0;
}

/* --- buttons --- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-brand);
  color: #0B0F16;
  font-weight: 700;
  font-size: var(--step0);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 1rem;
  border: none;
  cursor: pointer;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
  box-shadow: 0 8px 24px -8px rgba(45, 212, 191, 0.55);
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -6px rgba(45, 212, 191, 0.65); }
.cta:active { transform: translateY(0); }

button {
  font: inherit;
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
  min-height: 48px;
}
button.secondary { background: transparent; }
button.primary {
  background: var(--gradient-brand);
  color: #0B0F16;
  font-weight: 700;
  border: none;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Signature: pentagon mark (partials/pentagon-mark.ejs)
   ============================================================ */
.pentagon-mark { display: block; overflow: visible; }
.pentagon-outline { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.pentagon-edge {
  stroke: var(--border-strong);
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke var(--motion-med) ease, opacity var(--motion-med) ease;
  opacity: 0.6;
}
.pentagon-edge.lit { stroke: var(--violet); opacity: 0.9; }
.pentagon-edge.complete { stroke: url(#brand-gradient); opacity: 1; }
.pentagon-vertex {
  fill: var(--elevated);
  stroke: var(--border-strong);
  stroke-width: 1.5;
  transition: fill var(--motion-med) ease, r var(--motion-med) ease;
}
.pentagon-vertex.lit { fill: var(--violet); }
.pentagon-vertex.complete { fill: var(--cyan); r: 6; }

.pentagon-ambient .pentagon-edge,
.pentagon-ambient .pentagon-vertex {
  animation: pentagon-breathe 3.6s ease-in-out infinite;
}
@keyframes pentagon-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pentagon-ambient .pentagon-edge,
  .pentagon-ambient .pentagon-vertex { animation: none; }
  .cta, button, .pentagon-edge, .pentagon-vertex { transition: none; }
}

/* ============================================================
   Landing
   ============================================================ */
.hero {
  padding: 2rem 0 1rem;
  text-align: center;
}
.hero .pentagon-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.hero h1 { font-size: var(--step2); }
@media (min-width: 480px) {
  .hero h1 { font-size: var(--step3); }
}
.hero .cta { font-size: var(--step1); padding: 1rem 2rem; }

.feature-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
@media (min-width: 560px) {
  .feature-row { grid-template-columns: repeat(3, 1fr); }
}
.feature-item {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: var(--step-1);
  color: var(--text-2);
}
.feature-item strong { color: var(--text); display: block; margin-bottom: 0.2rem; font-size: var(--step0); }

.pdpa { font-size: var(--step-2); color: var(--text-2); }
.pdpa h2 { font-size: var(--step-1); color: var(--text-2); }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.progress-count { font-size: var(--step-1); color: var(--text-2); }
.progress-count .num { color: var(--text); font-weight: 700; }

.step { display: none; padding-bottom: 4.5rem; }
.step.active { display: block; animation: step-in var(--motion-med) ease both; }
@keyframes step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
}

.step h2 { font-size: var(--step1); line-height: 1.4; }

.options { display: grid; gap: 0.6rem; margin-top: 1rem; }
.options label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  min-height: 48px;
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.options label:hover { border-color: var(--border-strong); }
.options input { accent-color: var(--violet); width: 20px; height: 20px; flex-shrink: 0; }
.options label:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              var(--gradient-brand) border-box;
  background-clip: padding-box, border-box;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 0.6rem;
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
#submit-error { color: var(--danger); min-height: 1.2rem; }

select, input[type=text] {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  margin: 0.4rem 0;
  min-height: 48px;
  font: inherit;
}

/* --- Gallup ranked picker (feedback #5) --- */
.gallup-preview {
  min-height: 2.2rem;
  padding: 0.5rem 0;
  font-size: var(--step-1);
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.gallup-domain-group { margin: 1rem 0; }
.domain-label { font-size: var(--step-2); letter-spacing: 0.08em; text-transform: uppercase; }
.gallup-chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.gallup-chip {
  --chip-color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  min-height: 40px;
  font-size: var(--step-1);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.gallup-chip:hover { border-color: var(--chip-color); }
.gallup-chip.selected { border-color: var(--chip-color); background: color-mix(in srgb, var(--chip-color) 16%, var(--surface)); }
.gallup-chip .chip-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--chip-color);
  color: #0B0F16;
  font-size: var(--step-2);
  font-weight: 800;
}
.gallup-chip:not(.selected) .chip-rank { display: none; }
.chip-en { color: var(--text-2); font-size: var(--step-2); }

/* --- 16-type selector (slimmed quiz final step): one compact button row.
   Single-select, tap-again-to-clear; borrows the chip vernacular but tuned to
   a tidy 4-across grid on mobile so all 16 codes read as one instrument. --- */
.ptype-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.ptype-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.3rem;
  min-height: 44px;
  font: inherit;
  font-size: var(--step-1);
  letter-spacing: 0.03em;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.ptype-btn:hover { border-color: var(--border-strong); }
.ptype-btn.selected {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 16%, var(--surface));
  font-weight: 700;
}
.ptype-hint { margin-top: 0.75rem; font-size: var(--step-2); }
@media (min-width: 480px) {
  .ptype-row { grid-template-columns: repeat(8, 1fr); }
}

/* --- Gallup upfront (quiz v2, spec 2026-07-18): a collapsed, zero-friction
   invitation on the quiz's profile step. The expanded picker below it reuses
   the result page's gallup-chip/gallup-domain-group/gallup-preview classes
   verbatim (see the Result-page progressive enrichment block below) — this
   just styles the collapsed summary toggle itself. --- */
.gallup-quiz-section { margin-top: 1.25rem; }
.gallup-quiz-summary {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: var(--step-2);
  color: var(--mut);
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease;
}
.gallup-quiz-summary:hover { border-color: var(--border-strong); color: var(--text); }

/* --- Result-page progressive enrichment (owner-only cards). Reuses the chip /
   picker / vocab vernacular; the invitation card echoes the "unlit slot you can
   light" motif of the pentagon mark — a quiet lime eyebrow signals it unlocks
   more customization. --- */
.enrich-invite .eyebrow { display: block; color: var(--cyan); }
.enrich-actions { margin-top: 1rem; }
.enrich-status:empty { display: none; }
.gallup-enrich-picker[hidden] { display: none; }
.gallup-enrich-picker { margin-top: 1rem; }

/* ============================================================
   Result
   ============================================================ */
.result-hero { text-align: center; }
.result-hero .eyebrow { display: block; }
.result-hero .tier { font-size: var(--step3); font-weight: 800; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-hero .combo-name { font-size: var(--step1); color: var(--text); margin-top: 0.2rem; }

/* Gallup domain modifier chip (Feature 2): "戰略腦型 · 系統建築師", colored by
   the rank-1 theme's domain hue (src/constants.mjs GALLUP_DOMAINS). Sits
   between the tier and the combo-name line — only rendered when a session
   actually has a gallup ranking. */
.gallup-modifier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.5rem auto 0;
  padding: 0.35rem 0.9rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: var(--step-1);
  font-weight: 700;
  width: fit-content;
}
.result-hero .total { font-size: var(--step2); font-weight: 800; color: var(--gold); margin-top: 0.6rem; }
.result-hero .radar-wrap { display: flex; justify-content: center; margin: 1.25rem 0 0.5rem; }

.dim-bars { display: grid; gap: 0.7rem; margin-top: 0.75rem; }
.dim-bar-row { display: grid; grid-template-columns: 6.5rem 1fr 3.2rem; align-items: center; gap: 0.6rem; }
.dim-bar-label { font-size: var(--step-2); color: var(--text-2); }
/* Guide feature: a dimension label links out once a guide covers it — kept
   visually quiet (inherits the muted label color, dotted underline) so it
   reads as "more on this" rather than competing with the bar itself. */
.dim-bar-label a { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.dim-bar-label a:hover { color: var(--cyan); }
.dim-bar-track { height: 8px; border-radius: 999px; background: var(--elevated); overflow: hidden; }
.dim-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gradient-brand); }
.dim-bar-value { font-size: var(--step-2); color: var(--text); text-align: right; }

/* ============================================================
   Guide section + takeaway card (feat)
   Signature: the takeaway card is the one moment on the result
   page framed as a TIME (「明天早上」) rather than a score — it
   borrows the vocab-def-item's accent-left-border idiom but in
   the full brand gradient (not the single cyan hairline), so it
   reads as "the one decisive next action" among the score cards.
   ============================================================ */
.takeaway-card {
  border-left: 3px solid transparent;
  border-image: var(--gradient-brand) 1;
}
.takeaway-card .eyebrow { color: var(--violet); }
.takeaway-headline {
  font-size: var(--step1);
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-top: 0.2rem;
}
.takeaway-toolbox-title { margin-top: 1.1rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--step-2); }
.takeaway-tools { margin-top: 0.5rem; }
.takeaway-tool-chip { flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; }
.takeaway-tool-for { display: block; }
.takeaway-tool-free {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--violet);
  border: 1px solid color-mix(in srgb, var(--violet) 55%, transparent);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.takeaway-why { margin-top: 0.9rem; font-size: var(--step-1); }
.takeaway-why a { font-weight: 600; }

/* Guide index (GET /guide) + guide page (GET /guide/:slug) */
.guide-index-group h2 { margin-bottom: 0.9rem; }
.guide-card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.guide-card {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.guide-card:last-child { border-bottom: none; padding-bottom: 0; }
.guide-card a { display: block; text-decoration: none; }
.guide-card a:hover strong { color: var(--cyan); }
.guide-card-dim {
  display: block;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.2rem;
}
.guide-card strong { display: block; font-size: var(--step0); color: var(--text); }
.guide-card p { margin-top: 0.25rem; }
.guide-section .guide-body p { margin: 0.6rem 0; }
.guide-section .guide-body ul { margin: 0.6rem 0; }
.guide-further ul { list-style: disc; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: var(--step-2);
  color: var(--text-2);
}
.chip.gallup-chip { color: inherit; border-color: currentColor; background: transparent; cursor: default; min-height: unset; }

.roadmap-cards { display: grid; gap: 0.8rem; margin-top: 0.75rem; list-style: none; padding: 0; counter-reset: roadmap; }
.roadmap-card {
  counter-increment: roadmap;
  position: relative;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1rem 3.2rem;
}
.roadmap-card::before {
  content: counter(roadmap);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #0B0F16;
  font-weight: 800;
  font-size: var(--step-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.roadmap-card strong { display: block; font-size: var(--step0); margin-bottom: 0.3rem; }
.roadmap-card p { margin: 0.3rem 0; font-size: var(--step-1); }

/* Honest 生成中 state (feat): while a real roadmap is generating, show a
   pulsing pentagon mark + skeleton placeholder cards instead of the fallback
   actions, so we never pass off a placeholder as the finished path. */
.roadmap-generating-mark { display: flex; justify-content: center; margin: 0.6rem 0 0.2rem; }
.roadmap-generating-mark .pentagon-mark {
  animation: roadmap-gen-pulse 1.8s ease-in-out infinite;
}
.roadmap-generating-copy { text-align: center; margin-top: 0.4rem; }
.roadmap-skeleton .skeleton-card {
  min-height: 3.4rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(90deg, var(--elevated) 25%, var(--border) 37%, var(--elevated) 63%);
  background-size: 400% 100%;
  animation: roadmap-skeleton-shimmer 1.4s ease-in-out infinite;
}
.roadmap-skeleton .skeleton-card::before { content: none; }
@keyframes roadmap-gen-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes roadmap-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .roadmap-generating-mark .pentagon-mark,
  .roadmap-skeleton .skeleton-card { animation: none; }
}

.share-tag { display: inline-block; border-radius: 999px; padding: 0.2rem 0.75rem; font-size: var(--step-2); margin: 0.2rem 0 0.6rem; border: 1px solid currentColor; }
.share-tag.persona { color: var(--violet); }
.share-tag.score { color: var(--cyan); }
.card-preview { width: 100%; border-radius: var(--radius); display: block; margin: 0.6rem 0; border: 1px solid var(--border); }
.share-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.share-actions button { min-width: 10rem; }

.email-card { display: flex; flex-direction: column; gap: 0.5rem; }
.email-card .icon-row { display: flex; align-items: center; gap: 0.6rem; }
/* #type-email-form (type quiz, Phase 2 F2) and #pair-form (Phase 2 F3) reuse
   these same grid/input/label rules — extended selector lists rather than
   duplicated blocks. */
#email-form, #type-email-form, #pair-form { display: grid; gap: 0.6rem; margin-top: 0.4rem; }
#email-form input[type=email], #email-form textarea,
#type-email-form input[type=email], #pair-form input[type=text] {
  background: var(--elevated); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 0.8rem; min-height: 48px; font: inherit;
}
#email-form textarea { min-height: 4.5rem; resize: vertical; line-height: 1.5; }
#email-form label, #type-email-form label { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step-1); color: var(--text-2); }
#email-form label.note-label { display: block; margin-bottom: -0.2rem; color: var(--text); }
#email-form .note-hint { margin-top: -0.25rem; font-size: var(--step-2); }

@media (min-width: 560px) {
  .dim-bar-row { grid-template-columns: 8rem 1fr 3.2rem; }
}

/* ============================================================
   Site footer (landing + result — link to /about)
   ============================================================ */
.site-footer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2rem;
  text-align: center;
}
.site-footer a { color: var(--text-2); font-size: var(--step-1); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ============================================================
   Admin dashboard — same instrument-panel vernacular as the result
   page (eyebrow labels, tabular numerals, gradient bars), denser
   layout for an internal tool rather than a consumer page.
   ============================================================ */
.admin-wrap { max-width: 960px; }
.admin-top { margin-bottom: 0.5rem; }
/* Some admin-top h1s render a raw email address (report workbench) — must
   wrap, never force a horizontal scrollbar on narrow viewports. */
.admin-top h1 { overflow-wrap: anywhere; }
.admin-section h3 {
  margin-top: 1.2rem;
  color: var(--text-2);
  font-size: var(--step-1);
}
.admin-section h3:first-of-type { margin-top: 0.6rem; }
.admin-note { margin-top: 0.75rem; }

.stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}
.stat-tile {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-label { font-size: var(--step-2); color: var(--text-2); }
.stat-value { font-size: var(--step2); font-weight: 800; color: var(--gold); }

.admin-bar-list { display: grid; gap: 0.55rem; margin-top: 0.6rem; }
.admin-bar-row { display: grid; grid-template-columns: 8rem 1fr 3rem; align-items: center; gap: 0.6rem; }
.admin-bar-label { font-size: var(--step-2); color: var(--text-2); overflow-wrap: anywhere; }
.admin-bar-track { height: 8px; border-radius: 999px; background: var(--elevated); overflow: hidden; }
.admin-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--gradient-brand); }
.admin-bar-value { font-size: var(--step-2); color: var(--text); text-align: right; }

.trend-chart-wrap { margin-top: 0.5rem; }
.trend-chart-wrap svg { width: 100%; height: auto; display: block; }

@media (min-width: 560px) {
  .admin-bar-row { grid-template-columns: 10rem 1fr 3rem; }
}

/* Admin email list (Feature 2): one card-like entry per opt-in row. Card
   layout (not a table) so it reads cleanly on mobile and matches the app's
   card idiom; the free-text note is the only user input here, always escaped
   in the template. */
.admin-cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.email-list-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.email-list { display: grid; gap: 0.8rem; margin-top: 0.9rem; }
.email-entry {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.55rem;
}
.email-entry-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.email-addr { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.email-consent { min-height: unset; cursor: default; }
.email-consent.is-active { color: var(--cyan); border-color: var(--cyan); background: transparent; }
.email-consent.is-unsub { color: var(--danger); border-color: var(--danger); background: transparent; }
.email-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.email-ts { font-size: var(--step-2); font-variant-numeric: tabular-nums; }
.email-gallup { margin-top: 0; }
.email-note-field { display: grid; gap: 0.2rem; }
.email-note-label { font-size: var(--step-2); color: var(--text-2); font-weight: 700; }
.email-note {
  border-left: 2px solid var(--border-strong);
  padding-left: 0.7rem;
}
.email-note summary { cursor: pointer; color: var(--text-2); }
.email-note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.35rem; }
.email-note-empty { font-size: var(--step-2); font-style: italic; }
.email-result-link {
  justify-self: start;
  font-size: var(--step-1);
  color: var(--cyan);
  text-decoration: none;
}
.email-result-link:hover { text-decoration: underline; }

/* ============================================================
   About (宗旨頁) — typography-led, quiet register. No cards, no
   chrome beyond the shared header — the pentagon mark (already this
   product's signature) is the only ornament, and the five dimensions
   get the one deliberate typographic moment (.about-manifesto).
   Display type: a serif stack (system-available, no webfont fetch —
   keeps the "self-contained asset" rule) so the page reads distinctly
   calmer than the sans-only instrument-panel voice used elsewhere.
   ============================================================ */
.about-wrap { max-width: 640px; }
.about-hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.about-hero .pentagon-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }

.about-h1 {
  font-family: 'Noto Serif TC', 'PingFang TC', Georgia, serif;
  font-weight: 700;
  font-size: var(--step2);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 1rem;
}
@media (min-width: 480px) {
  .about-h1 { font-size: var(--step3); }
}

.about-lead {
  font-size: var(--step1);
  color: var(--text-2);
  line-height: 1.75;
  max-width: 34rem;
  margin: 0 auto;
}

.about-section { padding: 1.6rem 0; border-top: 1px solid var(--border); }
.about-section h2 {
  font-family: 'Noto Serif TC', 'PingFang TC', Georgia, serif;
  font-size: var(--step1);
  font-weight: 700;
}
.about-section p { color: var(--text-2); line-height: 1.8; }
.about-section p + p { margin-top: 0.9rem; }

.about-manifesto {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-manifesto-lede {
  color: var(--text-2);
  font-size: var(--step-1);
  margin-bottom: 1.1rem;
}
.about-manifesto-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.about-manifesto-list li {
  font-family: 'Noto Serif TC', 'PingFang TC', Georgia, serif;
  font-weight: 700;
  font-size: var(--step2);
  letter-spacing: -0.01em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}
@media (min-width: 480px) {
  .about-manifesto-list li { font-size: var(--step3); }
}

/* ---------- Admin: self-service password change (Feature 1) ---------- */
.admin-back-link { display: inline-block; margin-top: 0.4rem; font-size: var(--step-1); color: var(--text-2); text-decoration: none; }
.admin-back-link:hover { color: var(--cyan); }
.admin-links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.5rem; }
.admin-links a { font-size: var(--step-1); color: var(--text-2); text-decoration: none; }
.admin-links a:hover { color: var(--cyan); }

.admin-form-section { max-width: 28rem; }
.admin-form-section.admin-form-wide { max-width: 42rem; }
.admin-form { display: grid; gap: 0.9rem; margin-top: 0.5rem; }
.admin-form-field { display: grid; gap: 0.35rem; }
.admin-form-field span { font-size: var(--step-1); color: var(--text-2); }
.admin-form-field input,
.admin-form-field select,
.admin-form-field textarea {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: var(--step0);
  color: var(--text);
  font-family: inherit;
}
.admin-form-field textarea { resize: vertical; min-height: 6rem; line-height: 1.6; }
.admin-form-field input:focus-visible,
.admin-form-field select:focus-visible,
.admin-form-field textarea:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.admin-form button.cta { justify-self: start; }
.admin-form-msg { border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; font-size: var(--step-1); margin-bottom: 0.5rem; }
.admin-form-msg.success { background: color-mix(in srgb, var(--cyan) 14%, var(--surface)); color: var(--cyan); }
.admin-form-msg.error { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }

/* ---------- Admin: read-only scoring map (Feature 2) ---------- */
.scoring-dim-row .admin-bar-value { text-align: left; }

.scoring-question {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: 0.9rem;
}
.scoring-question-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.scoring-qid { font-weight: 700; color: var(--text); }
.scoring-top-chip { font-size: var(--step-2); color: var(--text-2); }
.scoring-question-text { margin-top: 0.55rem; color: var(--text); line-height: 1.6; }
.scoring-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: var(--step-2);
  font-weight: 600;
}
.scoring-badge.ok { background: color-mix(in srgb, var(--cyan) 16%, var(--surface)); color: var(--cyan); }
.scoring-badge.warn { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }

.scoring-options { display: grid; gap: 0.5rem; margin-top: 0.8rem; }
.scoring-option-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--elevated);
}
.scoring-option-row.is-max { outline: 1px solid var(--cyan); background: color-mix(in srgb, var(--cyan) 8%, var(--elevated)); }
.scoring-option-key { font-weight: 700; color: var(--text-2); }
.scoring-option-label { color: var(--text); font-size: var(--step-1); }
.scoring-option-score { color: var(--gold); font-size: var(--step-1); }
.scoring-impact { color: var(--text-2); font-size: var(--step-2); white-space: nowrap; }

.scoring-warning-list { margin-top: 0.6rem; }
.scoring-warning { color: var(--danger); font-size: var(--step-1); }

@media (max-width: 480px) {
  .scoring-option-row { grid-template-columns: 1.2rem 1fr; }
  .scoring-option-score, .scoring-impact, .scoring-option-row .scoring-badge {
    grid-column: 2;
    justify-self: start;
  }
}

/* ---------- Admin: content editor (Feature 1) ---------- */
.content-field-list, .content-combo-list { display: grid; gap: 0.5rem; margin-top: 0.7rem; }

.content-field-row, .content-combo-row {
  display: grid;
  grid-template-columns: 6rem 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
}
.content-combo-row { grid-template-columns: 4.5rem 6.5rem 1fr auto auto; }

.content-field-key, .content-ptype-code { font-size: var(--step-1); font-weight: 700; color: var(--text-2); }

.content-field-row input, .content-combo-row input {
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font: inherit;
  min-height: 44px;
  width: 100%;
}
.content-field-row input:focus-visible, .content-combo-row input:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

/* Reset is its own tiny <form> so it can sit inside a bigger group's rows
   without ever nesting <form> tags (illegal in HTML) — the group's own
   inputs point at their form via the `form="..."` attribute instead, see
   views/admin-content.ejs. */
.content-reset-form { margin: 0; }
.content-reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--step-2);
  padding: 0.5rem 0.7rem;
  min-height: 44px;
  white-space: nowrap;
}
.content-reset-btn:hover { border-color: var(--danger); color: var(--danger); }

/* Admin email list: per-subscriber report-workbench entry point (feat: report
   workbench, replaces the old inline "寄送報告" textarea+button). Just a
   status line + a link — the actual review/revise/send flow lives on its own
   page (views/report-workbench.ejs). */
.email-send-report {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.email-sent-status { margin: 0 0 0.5rem; font-size: var(--step-1); }
.report-workbench-link { display: inline-block; }

/* Status chip on the /admin/emails row (feat: report workbench) — one color
   per stage of the generating -> draft -> (revising -> draft)* -> sent /
   error lifecycle, so the list is scannable without opening each row. */
.chip.report-status { cursor: default; min-height: unset; }
.report-status-generating,
.report-status-revising { color: var(--text-2); border-color: var(--text-2); }
.report-status-draft { color: var(--gold); border-color: var(--gold); }
.report-status-sent { color: var(--cyan); border-color: var(--cyan); }
.report-status-error { color: var(--danger); border-color: var(--danger); }

/* ---------- Report workbench page (feat) ---------- */
.report-status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: var(--step-1);
  font-weight: 700;
  border: 1px solid currentColor;
}
.report-status-badge.report-status-generating,
.report-status-badge.report-status-revising {
  color: var(--text-2);
  background: color-mix(in srgb, var(--text-2) 10%, var(--surface));
}
.report-status-badge.report-status-draft { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.report-status-badge.report-status-sent { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); }
.report-status-badge.report-status-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }

.report-progress-note { margin-top: 0.8rem; }
.report-error-reason {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--step-1);
  white-space: pre-wrap;
}
.report-revision-note { margin-top: 0.6rem; }

.report-body h2 {
  font-size: var(--step0);
  color: var(--cyan);
  margin: 1.6rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.report-body h2:first-of-type { margin-top: 1.2rem; }
.report-section { color: var(--text); line-height: 1.85; }
.report-section p { white-space: pre-wrap; }
.report-opening { margin-top: 0.9rem; font-size: var(--step0); }

/* 30 天週計畫: a connected vertical rail — this IS a real sequence (week 1
   through 4 build on each other), so the left border + numbered heading earn
   their place here (unlike a decorative 01/02/03 marker on non-sequential
   content). */
.report-weeks { margin-top: 0.6rem; display: grid; gap: 1rem; }
.report-week {
  border-left: 3px solid var(--violet);
  padding-left: 1rem;
}
.report-week h3 { font-size: var(--step-1); color: var(--text); margin: 0 0 0.3rem; }
.report-week ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.report-week li { margin: 0.3rem 0; font-size: var(--step-1); color: var(--text-2); }

.report-zhanzhang-sent {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--cyan) 8%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .report-status-badge { font-size: var(--step-2); padding: 0.25rem 0.7rem; }
  .report-body h2 { font-size: var(--step-1); }
}

/* ============================================================
   Report workbench v2 — recipient-view + per-section margin comments.
   Signature: the dark operator console frames a single luminous "sheet"
   (收件人視角) that is literally the recipient's email rendered inside the
   admin page — the shared renderReportBody() output on white paper, floated
   above the dark surface with a jade top-rule echoing the email itself. The
   contrast between dark chrome and light sheet IS the feature (所見即所寄):
   Bruce reviews the real artifact, not a re-styled paraphrase, and pins
   marginalia to each section like doc comments.
   ============================================================ */
.report-wb-page { max-width: 1080px; }
.wb-panel-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.report-review .report-revision-note { margin: 0; }

.wb-eyebrow { display: flex; align-items: baseline; gap: 0.6rem; margin: 1.1rem 0 0.5rem; flex-wrap: wrap; }
.wb-eyebrow-label {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0B0F16;
  background: var(--gradient-brand);
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
}
.wb-eyebrow-sub { font-size: var(--step-1); color: var(--text-2); }

.wb-grid { position: relative; margin-top: 0.5rem; }

/* Narrow / mobile default: single column. Each rendered section is a light
   card (the recipient view stays intact); its ✎ 評註 box follows, collapsed. */
.wb-sec {
  position: relative;
  z-index: 1;
  background: #ffffff;
  color: #131A26;
  padding: 0.1rem 1.1rem;
}
.wb-sec:first-of-type { padding-top: 1.2rem; border-top: 4px solid #0d9488; border-radius: 14px 14px 0 0; }
.wb-sec:last-of-type { padding-bottom: 1.2rem; border-radius: 0 0 14px 14px; }
.wb-paper-bg { display: none; }

.wb-note {
  position: relative;
  z-index: 1;
  margin: 0 0 0.9rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 0.9rem;
}
.wb-note.is-filled { border-left-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 8%, var(--elevated)); }
.wb-note > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0;
  color: var(--text-2);
  font-size: var(--step-1);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.wb-note > summary::-webkit-details-marker { display: none; }
.wb-note-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--cyan); opacity: 0; transition: opacity var(--motion-fast) ease; }
.wb-note.is-filled .wb-note-dot { opacity: 1; }
.wb-note-label { display: block; font-size: var(--step-2); color: var(--text-2); margin: 0.1rem 0 0.35rem; }
.wb-note-input {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: var(--step-1);
  line-height: 1.6;
  resize: vertical;
  min-height: 3.2rem;
}
.wb-note-input:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.wb-note-status { display: block; font-size: var(--step-2); color: var(--text-2); min-height: 1rem; margin: 0.25rem 0 0.6rem; }
.wb-note-status.is-saved { color: var(--cyan); }
.wb-note-status.is-error { color: var(--danger); }

.wb-actions form { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.wb-revise-hint { font-size: var(--step-1); }

/* Desktop: recipient sheet (left) + marginalia rail (right). Each comment cell
   shares its section's grid row, so their tops align automatically — no JS
   positioning. The floating white sheet spans the whole left column via a
   backdrop element (grid-row: 1 / -1). The report column is capped at 640px
   and free to shrink on narrower desktops, so the rail always stays usable. */
@media (min-width: 900px) {
  .wb-grid {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(210px, 300px);
    column-gap: 1.5rem;
    row-gap: 0;
    align-items: start;
  }
  .wb-paper-bg {
    display: block;
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch; /* the grid is align-items:start; the sheet must fill all its rows */
    background: #ffffff;
    border: 1px solid #E3E7ED;
    border-top: 4px solid #0d9488;
    border-radius: 14px;
    box-shadow: 0 26px 64px -34px rgba(0, 0, 0, 0.85);
  }
  .wb-sec {
    grid-column: 1;
    background: transparent;
    padding: 0 1.7rem;
    border: 0;
    border-radius: 0;
  }
  .wb-sec:first-of-type { padding-top: 1.7rem; border-top: 0; border-radius: 0; }
  .wb-sec:last-of-type { padding-bottom: 1.7rem; border-radius: 0; }
  .wb-note {
    grid-column: 2;
    margin: 0.25rem 0;
  }
  .wb-note > summary { display: none; }
  .wb-note-label { margin-top: 0.7rem; }
}

.content-tier-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-top: 0.9rem;
}
.content-tier-group summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}
.content-tier-group summary::-webkit-details-marker { display: none; }
.content-tier-group summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--text-2);
  transition: transform var(--motion-fast) ease;
}
.content-tier-group[open] summary::before { transform: rotate(90deg); }
.content-tier-group .cta { margin-top: 0.9rem; }

@media (max-width: 640px) {
  .content-field-row, .content-combo-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.7rem;
  }
  .content-field-key, .content-ptype-code { margin-bottom: 0.1rem; }
}

/* ============================================================
   AI-vocabulary easter egg (unscored self-report)
   Reuses the existing chip/card/bar vernacular — the quiz chips
   are literally .gallup-chip (lime --chip-color), the result card
   borrows the "radar" instrument framing already established by
   the five-dimension mark. Only the result def-list and the lit
   result chips are genuinely new, kept quiet on purpose.
   ============================================================ */
.vocab-egg { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.vocab-egg-title { font-size: var(--step1); margin-bottom: 0.15rem; }
.vocab-chip-row { margin-top: 0.7rem; }

.vocab-radar-card .vocab-known-count { font-size: var(--step1); margin: 0.35rem 0 0.75rem; color: var(--gold); font-weight: 800; }
/* Lit chip = a term the person can already explain. Reads as "on" against the
   emerald→lime accent, distinct from the quiet unknown-term list below it. */
.vocab-chip-lit {
  color: var(--text);
  border-color: color-mix(in srgb, var(--cyan) 55%, var(--border));
  background: color-mix(in srgb, var(--cyan) 12%, var(--surface));
}
.vocab-next-title {
  font-size: var(--step-1);
  color: var(--text-2);
  letter-spacing: 0.02em;
  margin: 1.25rem 0 0.5rem;
}
.vocab-def-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.vocab-def-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0.8rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-left: 2px solid color-mix(in srgb, var(--cyan) 45%, var(--border));
  border-radius: var(--radius-sm);
}
.vocab-def-term { font-weight: 700; color: var(--text); }
.vocab-def-text { font-size: var(--step-1); color: var(--text-2); line-height: 1.6; }

/* ============================================================
   Feature 1 — 揭曉儀式 (reveal ceremony)
   A one-time, owner-only page-load sequence: the pentagon mark
   draws itself, the score counts up, then the tier + combo name
   stamp in with a decisive settle before handing off to the era
   strip. Server-gated (owner + ?reveal=1); JS-gated on a
   sessionStorage flag so it never replays on reload; fully
   neutralized under prefers-reduced-motion.
   ============================================================ */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* Titanium aurora palette D: the original teal-only glow at .14 alpha read
     as green "jade" residue against the titanium-ink surface on screenshot
     review. Dropped to .06 (mid of the .05-.08 subtle-sheen range) and
     blended teal->indigo (two stops instead of one, matching the site's own
     --gradient-brand direction) so any residual tint reads as a neutral
     aurora sheen rather than pure green. */
  background:
    radial-gradient(120% 90% at 50% 38%, rgba(45, 212, 191, 0.06), rgba(129, 140, 248, 0.05) 45%, transparent 65%),
    var(--bg);
  opacity: 0;
  transition: opacity var(--motion-med) ease;
  cursor: pointer;
}
.reveal-overlay--playing { opacity: 1; }
.reveal-overlay--out { opacity: 0; }

.reveal-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  max-width: 30rem;
}
.reveal-mark { filter: drop-shadow(0 0 24px rgba(45, 212, 191, 0.25)); }

.reveal-readout { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.reveal-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  font-size: clamp(3.5rem, 18vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* Tier + combo start collapsed; the --stamp class settles them in with a
   short overshoot — the signature "decisive, not bouncy" beat. */
.reveal-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: scale(0.82);
}
.reveal-overlay--stamp .reveal-caption { animation: reveal-stamp 360ms cubic-bezier(0.2, 0.9, 0.25, 1) forwards; }
.reveal-tier { font-size: var(--step2); font-weight: 800; color: var(--text); }
.reveal-combo {
  font-size: var(--step1);
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.reveal-skip {
  font-size: var(--step-2);
  color: var(--text-2);
  letter-spacing: 0.16em;
  opacity: 0.7;
}
@keyframes reveal-stamp {
  0% { opacity: 0; transform: scale(0.82); }
  70% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* Reduced motion: never show the overlay at all (belt-and-suspenders alongside
   the client-side matchMedia bail-out) so the markup-present / JS-disabled case
   still renders the final page cleanly. This block intentionally leads with
   #reveal-ceremony. */
@media (prefers-reduced-motion: reduce) {
  #reveal-ceremony { display: none !important; }
  .reveal-overlay, .reveal-overlay--playing, .reveal-overlay--out { transition: none; }
  .reveal-overlay--stamp .reveal-caption { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   Feature 2 — 毒舌模式 (roast mode) tone toggle + share pair
   ============================================================ */
.tone-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0.5rem 0 0.35rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tone-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--step-1);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.tone-btn.is-active { color: var(--bg); background: var(--gradient-brand); font-weight: 700; }
.tone-btn:not(.is-active):hover { color: var(--text); }
.combo-tagline { transition: opacity var(--motion-fast) ease; }

.share-card-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}
.share-card-variant { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.share-card-variant .card-preview { width: 100%; height: auto; }
.share-card-label {
  font-size: var(--step-2);
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.08em;
}
@media (prefers-reduced-motion: reduce) {
  .tone-btn, .combo-tagline { transition: none; }
}

/* ============================================================
   Feature 3 — 稀有度 (rarity line)
   ============================================================ */
.rarity-line {
  margin-top: 0.5rem;
  font-size: var(--step-1);
  color: var(--text-2);
}
.rarity-figure {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
}

/* ============================================================
   Feature 4 — AI 時代對照 (evolution-era timeline + totems)
   A horizontal 4-node timeline; the user's own era is lit (colored
   totem via the jade accent), the rest dimmed. The lit node also
   receives a brief flash as the reveal ceremony hands off to it.
   ============================================================ */
.era-timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  position: relative;
}
/* Connector rail behind the totems. */
.era-timeline::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 36px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.era-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: opacity var(--motion-med) ease, transform var(--motion-med) ease;
}
.era-totem-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border);
}
.era-totem { display: block; }
.era-year { font-size: var(--step-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.era-name { font-size: var(--step-2); }
.era-line {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  font-size: var(--step-1);
  color: var(--text);
}

/* Lit node — the user's own era. */
.era-node--current { color: var(--violet); }
.era-node--current .era-totem-wrap {
  border-color: var(--violet);
  box-shadow: 0 0 0 1px var(--violet), 0 0 18px rgba(45, 212, 191, 0.28);
}
.era-node--current .era-year { color: var(--gold); }
.era-node--current .era-name { color: var(--text); font-weight: 700; }
/* The lit node's own line spans the full row so it reads as a sentence, not a
   caption crammed under one column. */
.era-node--current .era-line { text-align: center; }

/* Dimmed nodes — faint outline only. */
.era-node--dim { color: var(--text-2); opacity: 0.4; }
.era-node--dim .era-name { color: var(--text-2); }

/* Reveal hand-off (Feature 1 (d)): a brief pulse on the lit node. */
.era-node--flash { animation: era-flash 900ms ease; }
@keyframes era-flash {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .era-node, .era-node--flash { transition: none; animation: none; }
}

/* --- AI 使用說明書 (feat: 2nd product surface) ------------------------------ */
/* select/input[type=text] already share this treatment (see rule above); date
   inputs and textareas need their own selector since the base rule doesn't
   cover either element. */
input[type=date], .manual-textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  margin: 0.4rem 0;
  min-height: 48px;
  font: inherit;
}
.manual-textarea { min-height: 6rem; resize: vertical; line-height: 1.6; }
.zodiac-privacy-note { margin-top: 0.3rem; }
#manual-zodiac-result { margin-top: 0.6rem; }

.manual-hero { text-align: center; }
.manual-one-liner {
  margin: 0;
  font-size: var(--step2);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.manual-generating { text-align: center; }
.manual-entrance-line { margin-top: 0.9rem; }

/* ============================================================
   1a 藍金 (blue-gold) redesign — landing / quiz / result /
   guide-index / guide ONLY. Scoped entirely under `body.theme-1a`
   (set by partials/head.ejs's `bodyClass` local, passed only by
   those 5 views) so admin/manual/report-workbench/about/unsub
   keep the original titanium-aurora dark theme untouched — this
   block only ever ADDS a class-scoped override, it never edits an
   unscoped selector above. Reuses the existing token NAMES
   (--bg/--surface/--elevated/--border/--border-strong/--text/
   --text-2/--gold/--violet/--cyan/--danger) so every generic
   component already defined above (.card, .cta, button, .chip,
   .eyebrow, .muted, focus-visible, the whole enrichment/roadmap/
   vocab/era/reveal/roast vernacular) re-themes for free; only a
   handful of genuinely new tokens are introduced (dark-hero-card
   colors, --mut tertiary label, per-dimension colors).
   ============================================================ */
body.theme-1a {
  --bg: #F7F5F0;
  --surface: #FCFAF5;
  --elevated: #F1ECDD;
  --border: #E3DFD3;
  --border-strong: #DED9CC;
  --text: #1E3250;
  --text-2: #5A6A80;
  --gold: #B08A3E;
  --violet: #4A7BA6;
  --cyan: #4A7BA6;
  --danger: #B3454A;

  /* New tokens, spec names (aitaiwan-redesign-spec.md "1a blue-gold") that
     have no existing equivalent above. */
  --mut: #8A94A2;
  --acc: #4A7BA6;
  --gold-lt: #C9A25E;
  --bd: var(--border);
  --chip: var(--border-strong);
  --hero-ink: #33465F;
  --body-c: #46566B;
  --track: #E9E5D9;
  --hair: #EEEAE0;
  /* Dark "instrument" card family — the result-hero share card and the
     landing teaser card are deliberately dark regardless of the light page
     bg (a persistent, screenshot-stable brand asset), so they get their own
     fixed palette rather than following --surface/--text. */
  --dk: #1E3250;
  --lt: #F5F2EA;
  --dk-sub: #A8BDD4;
  --dk-line: #3A4E6E;
  --dk-mut: #71839A;

  --font-serif: 'Noto Serif TC', 'PingFang TC', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}
body.theme-1a { background: var(--bg); }

/* Per-dimension colors (spec table), applied via whichever data attribute a
   given element already carries: quiz steps already have data-dimension
   (partials + quiz.ejs's own progress JS depend on that attribute existing
   exactly as-is, so this reads it rather than adding a new one); result's
   dimension-bar rows and guide-index's guide cards get a new, purely
   presentational `data-dim` attribute. Sets one custom prop (--dc) that the
   rules below consume — never touches color directly on tested elements. */
body.theme-1a [data-dimension="tools"],
body.theme-1a [data-dim="tools"] { --dc: #4A7BA6; }
body.theme-1a [data-dimension="prompting"],
body.theme-1a [data-dim="prompting"] { --dc: #B08A3E; }
body.theme-1a [data-dimension="integration"],
body.theme-1a [data-dim="integration"] { --dc: #7A8A5C; }
body.theme-1a [data-dimension="judgment"],
body.theme-1a [data-dim="judgment"] { --dc: #A65D57; }
body.theme-1a [data-dimension="learning"],
body.theme-1a [data-dim="learning"] { --dc: #6C5D8F; }

/* Base type: serif display headings, mono eyebrows/labels/numerals, sans body. */
body.theme-1a h1, body.theme-1a h2, body.theme-1a h3 { font-family: var(--font-serif); letter-spacing: -0.01em; }
body.theme-1a h1 { font-weight: 900; }
body.theme-1a h2, body.theme-1a h3 { font-weight: 700; }
body.theme-1a p { color: var(--body-c); }
body.theme-1a .eyebrow {
  font-family: var(--font-mono);
  color: var(--gold);
  letter-spacing: 0.16em;
  font-weight: 600;
}
body.theme-1a .num, body.theme-1a .progress-count, body.theme-1a .tier,
body.theme-1a .total { font-family: var(--font-mono); }
body.theme-1a .muted { color: var(--mut); }
body.theme-1a a { color: var(--acc); }
body.theme-1a .card { border-radius: 16px; }

/* Buttons (spec: pill / dark-navy primary / ghost secondary) — overrides the
   gradient-brand primary treatment used on the dark-theme pages above. */
body.theme-1a .cta,
body.theme-1a button.primary {
  background: var(--dk);
  color: var(--lt);
  font-weight: 700;
  box-shadow: none;
  border-radius: 999px;
}
body.theme-1a .cta:hover,
body.theme-1a button.primary:hover { background: #28406A; box-shadow: none; transform: none; }
body.theme-1a button.secondary,
body.theme-1a a.secondary {
  background: transparent;
  border: 1px solid var(--chip);
  color: var(--text-2);
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
body.theme-1a a.secondary:hover,
body.theme-1a button.secondary:hover { border-color: var(--acc); color: var(--text); }
body.theme-1a :focus-visible { outline-color: var(--acc); }

/* --- Header (brand + optional right-nav) --- */
body.theme-1a .site-header {
  border-bottom: 1px solid var(--bd);
  padding-bottom: 1rem;
  justify-content: space-between;
}
body.theme-1a .brand {
  font-family: var(--font-mono);
  color: var(--mut);
  letter-spacing: 0.1em;
  font-size: var(--step-2);
  font-weight: 700;
}
body.theme-1a .site-header-nav { display: flex; gap: 1rem; }
body.theme-1a .site-header-nav a { color: var(--text-2); text-decoration: none; font-size: var(--step-1); }
body.theme-1a .site-header-nav a:hover { color: var(--acc); }

/* --- Footer --- */
body.theme-1a .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--bd);
  padding-top: 1rem;
  text-align: left;
}
body.theme-1a .site-footer-links { display: flex; gap: 1rem; }
body.theme-1a .site-footer-copyright { font-family: var(--font-mono); color: var(--mut); font-size: var(--step-2); }

/* ---------------------------------------------------------
   Landing
   --------------------------------------------------------- */
body.theme-1a .hero { text-align: left; padding: 2.25rem 0 1rem; }
body.theme-1a .hero .eyebrow { display: block; }
body.theme-1a .hero h1 { color: var(--hero-ink); font-size: var(--step2); line-height: 1.3; }
@media (min-width: 480px) { body.theme-1a .hero h1 { font-size: 2.75rem; } }
body.theme-1a .hero .sub { color: var(--body-c); font-family: var(--font-body); }
body.theme-1a .hero .cta { width: 100%; justify-content: center; font-size: var(--step0); padding: 1rem 1.5rem; margin-top: 1.25rem; }
body.theme-1a .manual-entrance-line { text-align: center; color: var(--mut); }
body.theme-1a .manual-entrance-line a { color: var(--acc); font-weight: 600; }

/* Teaser result card — the signature landing element: a dark instrument
   card showing a SAMPLE (not real) radar + tier ladder, previewing what the
   quiz produces. Static illustrative values, deliberately never wired to
   any session data. */
.teaser-card {
  background: var(--dk);
  color: var(--lt);
  border-radius: 16px;
  padding: 1.4rem;
  margin: 1.5rem 0;
  border: 1px solid var(--dk-line);
}
.teaser-label {
  font-family: var(--font-mono);
  color: var(--dk-sub);
  font-size: var(--step-2);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.9rem;
}
.teaser-body { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.teaser-radar-wrap { flex: 0 0 auto; }
.teaser-radar text { font-family: var(--font-mono); }
.teaser-info { flex: 1 1 8rem; min-width: 8rem; }
.teaser-info-label { font-size: var(--step-2); color: var(--dk-sub); margin: 0; }
.teaser-tier { font-family: var(--font-serif); font-weight: 700; font-size: var(--step2); color: var(--lt); margin: 0.15rem 0 0.7rem; }
.ladder-pills { display: flex; gap: 4px; margin-bottom: 0.4rem; }
.ladder-pills span { display: block; width: 22px; height: 5px; border-radius: 3px; background: var(--dk-line); }
.ladder-pills span.is-active { background: var(--gold-lt); }
.ladder-text { font-size: var(--step-2); color: var(--dk-mut); font-family: var(--font-mono); margin: 0; }
.ladder-text .is-active { color: var(--gold-lt); font-weight: 700; }
/* Result-page ladder reuses the same idiom at a larger size (30x6). */
.ladder-pills.ladder-pills-lg span { width: 30px; height: 6px; }

/* Value props (01/02/03) */
.value-props { margin: 1.5rem 0; }
.value-prop-row {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bd);
}
.value-prop-row:last-child { border-bottom: none; }
.value-prop-num { font-family: var(--font-mono); color: var(--gold); font-weight: 700; flex: 0 0 auto; }
.value-prop-title { font-weight: 700; color: var(--hero-ink); display: block; margin-bottom: 0.2rem; font-family: var(--font-serif); }
.value-prop-desc { color: var(--body-c); font-size: var(--step-1); margin: 0; }

/* Advanced-analysis structured render (report-layout batch B, spec
   2026-07-19): headline -> up to 3 angle-lenses (MBTI/蓋洛普/工作, each
   labeled with a colored dot) -> a watch-out callout -> 3 numbered next
   steps (reuses .value-props/.value-prop-row above for the steps footer).
   Namespaced .adv-* so it never collides with the old single-paragraph
   render it sits alongside (views/type-result.ejs's backward-compat
   branch). Mirrors bruce-profile/aitaiwan-report-layout-mockup.html's
   approved right column 1:1, values pulled from theme-1a's own vars. */
.adv-headline {
  font: 700 18px/1.5 var(--font-serif);
  color: var(--text);
  margin: 0.4rem 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bd);
}
.adv-lens { margin-bottom: 0.95rem; }
.adv-lens-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.adv-lens-dot { width: 7px; height: 7px; border-radius: 50%; }
.adv-lens-mbti { color: var(--acc); }
.adv-lens-mbti .adv-lens-dot { background: var(--acc); }
.adv-lens-gallup { color: var(--gold); }
.adv-lens-gallup .adv-lens-dot { background: var(--gold); }
.adv-lens-work { color: #7A8A5C; }
.adv-lens-work .adv-lens-dot { background: #7A8A5C; }
.adv-lens p { font-size: var(--step-1); line-height: 1.8; color: var(--body-c); margin: 0; }
.adv-watch {
  background: #F7EEED;
  border: 1px solid #E3C9C6;
  border-radius: 12px;
  padding: 13px 16px;
  margin: 1rem 0;
}
.adv-watch-label { font: 500 11px var(--font-mono); letter-spacing: 0.06em; color: #A65D57; margin-bottom: 4px; }
.adv-watch p { font-size: var(--step-1); line-height: 1.8; color: #7A4A46; margin: 0; }
.adv-steps { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--bd); }
.adv-steps-head { font: 500 11px var(--font-mono); letter-spacing: 0.12em; color: var(--mut); margin-bottom: 0.5rem; }
.adv-steps .value-props { margin: 0; }

body.theme-1a .pdpa { font-size: var(--step-2); color: var(--mut); background: transparent; border: none; padding: 0.5rem 0; }
body.theme-1a .pdpa h2 { font-size: var(--step-2); color: var(--mut); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------------------------------------------------------
   Quiz — one-question-per-screen with a real progress bar +
   dimension chip (spec 1b). Preserves the existing .step /
   .options / #prev-btn / #next-btn / #submit-btn structure and
   its POST-at-the-end contract; only the surrounding chrome and
   option affordance are new.
   --------------------------------------------------------- */
body.theme-1a .quiz-header { justify-content: space-between; margin-bottom: 0.75rem; }
.quiz-exit { color: var(--mut); text-decoration: none; font-size: var(--step-1); }
.quiz-exit:hover { color: var(--acc); }
body.theme-1a .progress-count { font-family: var(--font-mono); }
.quiz-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  margin-bottom: 1rem;
}
.quiz-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s ease;
}
.dim-chip-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.dim-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc, var(--mut)); flex: 0 0 auto; }
.dim-chip-label {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dc, var(--mut));
  font-weight: 700;
}
body.theme-1a .step h2 { font-family: var(--font-serif); font-weight: 700; font-size: var(--step1); line-height: 1.5; color: var(--text); }

body.theme-1a .options label {
  border: 1.5px solid var(--bd);
  border-radius: 14px;
  padding: 15px 18px;
  background: var(--surface);
  gap: 0.8rem;
}
body.theme-1a .options label:hover { border-color: var(--acc); }
body.theme-1a .options label.selected {
  background: #EFE9DB;
  border-color: var(--gold);
}
/* a11y: the native radio is visually hidden (see .opt-letter below) but
   still keyboard-focusable — surface focus on the wrapping label instead. */
body.theme-1a .options label:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }
/* Hides the native radio dot; the lettered circle carries the selected state
   instead (spec: "left circle 22px with option letter"). */
body.theme-1a .options input.q-option { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--chip);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  flex: 0 0 auto;
}
body.theme-1a .options label.selected .opt-letter {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--lt);
}
body.theme-1a .nav-buttons { background: linear-gradient(to top, var(--bg) 75%, transparent); align-items: center; }
.quiz-auto-hint { font-size: var(--step-2); color: var(--mut); }

/* na-option (aitaiwan-na-option-spec.md, ratified 2026-07-19): the type
   quiz's 5th "沒遇過／不確定" scale value is scored by EXCLUSION, never as a 0
   (src/type-affinity-rating.mjs), so it must read as an escape hatch, not a
   5th intensity level — separated from the four real levels by a hairline +
   extra gap, and muted (lighter, smaller text) at rest. Still picks up the
   shared .options label selected/hover rules when actually chosen, so
   choosing it reads as a deliberate, visible pick rather than staying
   invisible. Auto-advance behaviour is unchanged (data-auto on the .step). */
.rating-options label.rating-na {
  margin-top: 0.9rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
body.theme-1a .rating-options label.rating-na { border-top-color: var(--bd); }
.rating-options label.rating-na .opt-label-text { color: var(--mut); font-size: var(--step-1); }
.rating-options label.rating-na.selected .opt-label-text,
.rating-options label.rating-na:has(input:checked) .opt-label-text { color: inherit; }

/* ---------------------------------------------------------
   Result — dark share hero + per-dimension breakdown + 30-day
   path + email card. The radar SVG itself (src/radar.mjs) keeps
   its existing teal/indigo palette on purpose this round: it is
   shared byte-for-byte with the PNG/SVG share-card pipeline
   (src/card.mjs), which the redesign brief explicitly says to
   leave alone — recoloring radar.mjs would also recolor every
   share image already circulating. See the implementation report
   for detail.
   --------------------------------------------------------- */
body.theme-1a .result-hero {
  background: var(--dk);
  color: var(--lt);
  border: 1px solid var(--dk-line);
  border-radius: 16px;
}
.result-hero-topline {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--step-2);
  color: var(--dk-mut);
  margin-bottom: 0.75rem;
}
body.theme-1a .result-hero .eyebrow { color: var(--dk-sub); font-weight: 400; letter-spacing: 0.05em; }
body.theme-1a .result-hero .tier {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--lt);
  background: none;
  -webkit-text-fill-color: initial;
}
body.theme-1a .result-hero .combo-name { color: var(--dk-sub); }
body.theme-1a .result-hero .total { color: var(--gold-lt); }
body.theme-1a .result-hero p.muted { color: var(--dk-mut); }
body.theme-1a .result-hero .rarity-line { color: var(--dk-mut); }
body.theme-1a .result-hero .rarity-figure { color: var(--gold-lt); }
body.theme-1a .gallup-modifier-chip { color: var(--gold-lt); border-color: var(--gold-lt); }
body.theme-1a .tone-toggle { background: var(--dk-line); border-color: var(--dk-line); }
body.theme-1a .tone-btn { color: var(--dk-mut); }
body.theme-1a .tone-btn.is-active { background: var(--gold-lt); color: var(--dk); }
body.theme-1a .tone-btn:not(.is-active):hover { color: var(--lt); }

/* Second .result-hero (radar + dim-bars) reuses the same dark card look,
   but the breakdown bars themselves want light-surface contrast, so the
   inner block gets its own light inset. */
body.theme-1a .dim-bars { background: var(--surface); border: 1px solid var(--bd); border-radius: 12px; padding: 1rem 1.1rem; margin-top: 1.25rem; }
body.theme-1a .dim-bar-label { color: var(--hero-ink); font-family: var(--font-body); font-size: var(--step-1); }
body.theme-1a .dim-bar-value { color: var(--dc, var(--text-2)); font-family: var(--font-mono); font-weight: 700; }
body.theme-1a .dim-bar-track { background: var(--track); }
body.theme-1a .dim-bar-fill { background: var(--dc, var(--gold)); }

body.theme-1a .takeaway-card { border-image: none; border-left: 3px solid var(--gold); background: var(--surface); }
body.theme-1a .takeaway-card .eyebrow { color: var(--gold); }
body.theme-1a .takeaway-headline { color: var(--text); }

/* Archetype (second identity layer, spec 2026-07-18): hero name suffix
   («實踐者 · 建造者») + small tagline under the ladder, plus the standalone
   archetype-card between the five-dim breakdown and the 30-day path. Reuses
   the landing page's 01/02/03 .value-prop-row idiom for the tier-gated
   next-steps list — same "numbered row" vernacular, no new pattern. */
body.theme-1a .result-hero .archetype-hero-name { color: var(--gold-lt); }
body.theme-1a .archetype-tagline-hero { color: var(--dk-sub); font-size: var(--step-2); margin-top: 0.35rem; }
.archetype-name { font-family: var(--font-serif); font-weight: 700; font-size: var(--step1); margin: 0.2rem 0 0.6rem; }
body.theme-1a .archetype-name { color: var(--hero-ink); }
.archetype-desc { margin-bottom: 0.6rem; }
.archetype-pair { font-size: var(--step-1); margin: 0; }
body.theme-1a .archetype-pair { color: var(--text-2); }
.archetype-next-title { margin-top: 1.4rem; }
.archetype-next-steps { margin-top: 0.4rem; }

body.theme-1a .roadmap-card::before { background: var(--gold); color: var(--lt); }
body.theme-1a .roadmap-card { background: var(--surface); border-color: var(--bd); }

body.theme-1a .era-timeline::before { background: var(--bd); }
body.theme-1a .era-totem-wrap { background: var(--surface); border-color: var(--bd); }
body.theme-1a .era-node--current { color: var(--acc); }
body.theme-1a .era-node--current .era-totem-wrap { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
body.theme-1a .era-node--current .era-year { color: var(--gold); }
body.theme-1a .era-node--dim { color: var(--mut); }

body.theme-1a .vocab-chip-lit { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, var(--surface)); }
body.theme-1a .vocab-def-item { background: var(--elevated); border-left-color: var(--acc); }

body.theme-1a .email-card #email-form button.primary { background: var(--gold); color: var(--lt); }
body.theme-1a .email-card #email-form button.primary:hover { background: var(--gold-lt); }
body.theme-1a #email-form input, body.theme-1a #email-form textarea,
body.theme-1a select, body.theme-1a input[type=text], body.theme-1a input[type=date] {
  background: var(--surface); border-color: var(--bd); color: var(--text);
  border-radius: 999px;
}
body.theme-1a #email-form textarea { border-radius: 12px; }

body.theme-1a .reveal-overlay { background: radial-gradient(120% 90% at 50% 38%, rgba(74,123,166,0.08), rgba(176,138,62,0.05) 45%, transparent 65%), var(--bg); }
body.theme-1a .reveal-number { color: var(--gold); }
body.theme-1a .reveal-tier { color: var(--text); font-family: var(--font-serif); }
body.theme-1a .reveal-combo { color: var(--acc); background: none; -webkit-text-fill-color: initial; }

body.theme-1a .result-bottom-link { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: var(--step-2); color: var(--mut); }
body.theme-1a .result-bottom-link a { color: var(--acc); }

/* ---------------------------------------------------------
   Guide index + guide article
   --------------------------------------------------------- */
body.theme-1a .guide-card { border-bottom-color: var(--bd); }
.guide-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
.guide-card-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc, var(--mut)); flex: 0 0 auto; }
body.theme-1a .guide-card-dim {
  color: var(--dc, var(--mut));
  font-family: var(--font-mono);
  margin: 0;
}
body.theme-1a .guide-card strong { font-family: var(--font-serif); font-size: var(--step0); }
body.theme-1a .guide-card a:hover strong { color: var(--acc); border-color: #C4A96A; }
body.theme-1a .guide-card:hover { border-color: #C4A96A; }
body.theme-1a .guide-section h2 { font-family: var(--font-serif); }
body.theme-1a .guide-body { color: var(--body-c); }

/* a11y: reduced motion — disable the new transitions/animations too. */
@media (prefers-reduced-motion: reduce) {
  body.theme-1a .quiz-progress-fill,
  body.theme-1a .cta,
  body.theme-1a button,
  body.theme-1a .options label,
  body.theme-1a a.secondary,
  body.theme-1a button.secondary { transition: none; }
}

/* ---------------------------------------------------------
   Type quiz (人格版, Phase 1 spec, ratified 2026-07-19) — the
   new lighter main-entry product. Its quiz screen (views/
   type-quiz.ejs) and most of its result page (views/type-
   result.ejs) reuse EVERY class above verbatim (.step/.options/
   .card/.result-hero/.tier/.gallup-modifier-chip/.dim-bars/
   .value-props/.archetype-pair etc.) — only the handful of
   genuinely new bits (dual-badge spacing, the combo section's
   second/reverse segment, and the Phase-2 "進階分析" placeholder's
   spinner) get new rules here.
   --------------------------------------------------------- */
.type-combo-reverse { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px dashed var(--bd); }
.type-combo-note { font-size: var(--step-2); }

.advanced-placeholder-spinner {
  display: inline-flex;
  gap: 5px;
  margin-top: 0.6rem;
}
.advanced-placeholder-spinner span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: advanced-placeholder-pulse 1.1s ease-in-out infinite;
}
.advanced-placeholder-spinner span:nth-child(2) { animation-delay: 0.15s; }
.advanced-placeholder-spinner span:nth-child(3) { animation-delay: 0.3s; }
@keyframes advanced-placeholder-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .advanced-placeholder-spinner span { animation: none; opacity: 0.7; }
}

/* ============================================================
   Type quiz Phase 2 additions (spec 2026-07-19)
   F1: the "CROSS-READ" mono tag on the done-state advanced card.
   F3: friend-pairing own-code display + existing-pairs list.
   ============================================================ */
.mono-tag {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-left: 0.5rem;
}
.pair-card { display: flex; flex-direction: column; gap: 0.5rem; }
.pair-code-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pair-code-value {
  font-family: var(--font-mono);
  font-size: var(--step2);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.pair-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.6rem; }
.pair-list-row { padding-top: 0.7rem; border-top: 1px solid var(--border); }
.pair-list-row:first-child { padding-top: 0; border-top: none; }
.pair-list-row h3 { margin: 0 0 0.35rem; font-size: var(--step1); }

/* Type-result: Claude Design 1c hero desc + 50/50 action row (share + retake).
   Colors resolve from the body.theme-1a token block; classes are unique to
   views/type-result.ejs so they need no theme prefix. */
.result-hero-desc { font-size: 14px; line-height: 1.75; color: var(--dk-sub); max-width: 300px; margin: 14px auto 0; text-align: center; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.result-actions > * { flex: 1; text-align: center; border-radius: 99px; padding: 13px 12px; font-size: 14.5px; line-height: 1.2; cursor: pointer; box-sizing: border-box; }
.result-action-primary { background: var(--dk); color: var(--lt); border: none; font-weight: 700; }
.result-action-ghost { background: transparent; color: #5A6A80; border: 1px solid var(--chip); font-weight: 500; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.result-action-primary:hover { opacity: .92; }
.result-action-ghost:hover { border-color: var(--gold); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .result-action-primary, .result-action-ghost { transition: none; } }
/* 存成分享圖 (批次 C): a minor secondary download link on its own row, below the
   50/50 分享/重測 row (which it deliberately leaves untouched). */
.result-actions-save { display: flex; margin-top: 10px; }
.result-action-save { flex: 1; text-align: center; border-radius: 99px; padding: 11px 12px; font-size: 13.5px; line-height: 1.2; background: transparent; color: #5A6A80; border: 1px dashed var(--chip); font-weight: 500; text-decoration: none; box-sizing: border-box; }
.result-action-save:hover { border-color: var(--gold); color: var(--text); }

/* ---------------------------------------------------------
   GET /types — six-archetype explainer (aitaiwan-simplify-spec.md,
   ratified 2026-07-19). Mirrors the Claude Design 1d guide-card element
   (see .guide-card above) but each archetype gets its own bordered/backed
   box rather than a shared list with row separators, and its accent comes
   from the per-type --dc custom property (same TYPE_COLORS values as
   views/type-result.ejs's six-型光譜 bars/hexagon), fed inline per card
   exactly like .dim-bar-row already does.
   --------------------------------------------------------- */
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.archetype-card {
  background: var(--surface);
  border: 1px solid var(--bd, var(--border));
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s ease;
}
.archetype-card:hover { border-color: var(--gold); }
.archetype-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.archetype-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc, var(--mut, var(--text-2))); flex: 0 0 auto; }
.archetype-name { font-family: var(--font-serif); font-weight: 700; font-size: var(--step0); color: var(--text); }
.archetype-tagline { color: var(--gold); font-size: var(--step-1); font-weight: 600; margin: 0 0 0.5rem; }
.archetype-desc { margin: 0; }
@media (prefers-reduced-motion: reduce) { .archetype-card { transition: none; } }

/* ── 批次 A (2026-07-19): 手機優先 hero 壓縮 + 吸底 CTA ── */
.mobile-start-bar { display: none; }
@media (max-width: 720px) {
  /* 手機:把「開始測驗」排到預覽卡前面(緊接標語),保證第一屏就看得到;
     預覽卡降到 CTA 下方當示意。用 flex order 換位,不動 DOM。 */
  body.theme-1a .hero { padding-top: 1.25rem; display: flex; flex-direction: column; }
  body.theme-1a .hero .cta { order: 1; margin-top: 1.25rem; }
  body.theme-1a .hero .teaser-card { order: 2; margin: 1.25rem 0 0; padding: 1.1rem; }
  body.theme-1a .teaser-radar { width: 100px; height: 100px; }
  /* 吸底 CTA:主 CTA 捲出後滑出 */
  .mobile-start-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg); border-top: 1px solid var(--bd);
    transform: translateY(130%); transition: transform .22s ease;
  }
  .mobile-start-bar.show { transform: translateY(0); }
  .mobile-start-bar a {
    display: flex; align-items: center; justify-content: center; width: 100%;
    background: var(--dk); color: var(--lt); border-radius: 99px;
    padding: 14px; font-weight: 700; text-decoration: none;
  }
  body.has-start-bar { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { .mobile-start-bar { transition: none; } }
