:root {
  --navy-950: #090f63;
  --navy-900: #141a86;
  --navy-800: #2829ba;
  --ink: #151d55;
  --muted: #5d6688;
  --line: #dadcf7;
  --blue: #3f42dc;
  --blue-dark: #2726b6;
  --blue-soft: #f0f1ff;
  --electric-blue: #0614f5;
  --orange: #ff5a0a;
  --orange-soft: #fff1e9;
  --teal: #00a8ad;
  --teal-dark: #007f8b;
  --teal-soft: #e8fbfa;
  --green: var(--teal-dark);
  --green-soft: var(--teal-soft);
  --amber: #c6500b;
  --amber-soft: var(--orange-soft);
  --white: #fff;
  --shadow: 0 20px 70px rgba(15, 20, 125, 0.2);
  --shadow-soft: 0 10px 30px rgba(15, 20, 125, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "Noto Sans Thai", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #fff; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 102, 244, 0.12), transparent 30rem),
    radial-gradient(circle at 94% 25%, rgba(0, 168, 173, 0.08), transparent 24rem),
    linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.page-glow {
  position: fixed;
  z-index: 0;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.22;
}

.page-glow-one { top: -16rem; right: -9rem; background: #6f66f4; }
.page-glow-two { bottom: -20rem; left: -12rem; background: #00a8ad; opacity: 0.16; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid #dce1f6;
  border-radius: 14px;
  padding: 4px 10px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(8, 15, 101, 0.24);
}

.brand-logo { display: block; width: 136px; height: auto; }

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--electric-blue), var(--blue));
  box-shadow: 0 9px 24px rgba(6, 20, 245, 0.35);
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-text { font-family: Inter, sans-serif; font-weight: 800; font-size: 1.02rem; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem; }
.topbar-note { color: var(--muted); font-size: 0.79rem; }
.inherit-color { color: inherit; }

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid #dfe3ff;
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(15, 20, 125, 0.07);
  font-size: 0.74rem;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.theme-toggle:hover { border-color: #aeb7ee; background: #f6f7ff; box-shadow: 0 10px 22px rgba(15, 20, 125, 0.12); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid rgba(6, 20, 245, 0.2); outline-offset: 2px; }
.theme-toggle-icon { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #c6500b; background: var(--orange-soft); font-size: 0.9rem; line-height: 1; }

.surface {
  border: 1px solid rgba(218, 220, 247, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 2.75rem;
  align-items: center;
  margin-top: 34px;
  padding: clamp(1.5rem, 4vw, 3.75rem);
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(6, 20, 245, 0.16);
  content: "";
}

h1, h2, h3, p { margin-top: 0; }

.hero h1 {
  max-width: 640px;
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.hero h1 span { color: var(--blue); }

/* Conversational landing variant
   A single focused surface keeps the first click obvious for visitors coming
   from Messenger, while preserving the configurable copy used by Admin. */
.app-shell.is-landing .topbar-note { display: none; }
.hero-conversational {
  position: relative;
  display: block;
  width: min(760px, 100%);
  margin: 42px auto 0;
  overflow: hidden;
  border-color: #dfe3ff;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 2%, rgba(255, 90, 10, 0.12), transparent 31%),
    radial-gradient(circle at 6% 100%, rgba(0, 210, 214, 0.1), transparent 30%),
    linear-gradient(145deg, #fff 0%, #fbfbff 100%);
  box-shadow: 0 24px 70px rgba(15, 20, 125, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.hero-conversational::before {
  position: absolute;
  top: -8rem;
  right: -7rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(111, 102, 244, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(111, 102, 244, 0.035), 0 0 0 56px rgba(111, 102, 244, 0.02);
  content: "";
  pointer-events: none;
}

.hero-conversational::after {
  position: absolute;
  right: -2rem;
  bottom: 18%;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: rgba(0, 168, 173, 0.12);
  filter: blur(26px);
  content: "";
  pointer-events: none;
}

.hero-conversation-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.hero-chat-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1.25rem;
  border: 1px solid rgba(255, 90, 10, 0.34);
  border-radius: 999px 999px 999px 7px;
  padding: 0.5rem 0.9rem;
  color: #c6500b;
  background: #fff2eb;
  box-shadow: 0 8px 24px rgba(255, 90, 10, 0.1);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-spark { color: var(--orange); font-size: 1.15rem; line-height: 1; }

.hero-conversational h1 {
  max-width: 650px;
  margin: 0 auto 1.1rem;
  color: var(--ink);
  font-size: clamp(2.35rem, 6vw, 4.55rem);
  line-height: 1.04;
  letter-spacing: -0.07em;
}

.hero-conversational h1 .hero-headline-accent {
  color: #e34f06;
  background: linear-gradient(100deg, #ff7a36 0%, #d9460b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-conversational .hero-lede {
  max-width: 570px;
  margin: 0 auto 1.65rem;
  color: #4d5780;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  width: min(100%, 520px);
  margin: 0 auto;
  border: 1px solid #dfe3ff;
  border-radius: 18px;
  padding: 0.78rem 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(15, 20, 125, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.hero-meta-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.58rem;
  flex: 1 1 0;
  text-align: left;
}

.hero-meta-item > span:last-child { min-width: 0; }
.hero-meta-item strong { display: block; color: var(--ink); font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 1rem; line-height: 1.2; }
.hero-meta-item small { display: block; margin-top: 0.18rem; overflow: hidden; color: var(--muted); font-size: 0.68rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.hero-meta-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid #cfd4ff; border-radius: 11px; color: var(--blue-dark); background: var(--blue-soft); font-family: Inter, sans-serif; font-size: 1rem; font-weight: 800; }
.hero-meta-icon-clock { border-color: #bdebe8; color: var(--teal-dark); background: var(--teal-soft); font-size: 1.25rem; }
.hero-meta-divider { width: 1px; flex: 0 0 1px; margin: 0.15rem 0; background: #dfe3ff; }

.hero-conversational .hero-actions { justify-content: center; margin-top: 1.4rem; }
.hero-conversational .primary-button { min-height: 58px; border-radius: 18px; padding: 0.86rem 1.55rem; color: #fff; background: linear-gradient(115deg, #0614f5 0%, #4547e8 54%, #ff5a0a 145%); box-shadow: 0 16px 32px rgba(6, 20, 245, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.18) inset; font-size: clamp(1rem, 2.5vw, 1.14rem); }
.hero-conversational .primary-button:hover { transform: translateY(-2px); box-shadow: 0 20px 38px rgba(6, 20, 245, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.24) inset; }
.hero-reassurance { display: flex; max-width: 520px; align-items: center; justify-content: center; gap: 0.52rem; margin: 1.1rem auto 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.hero-reassurance-icon { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(111, 255, 241, 0.62); border-radius: 50%; color: #9bfff4; background: rgba(0, 168, 173, 0.24); font-weight: 900; }
.hero-conversational .alert-error { border-color: #f0caca; color: #9d3030; background: #fff3f3; text-align: left; }

.hero-asset-card {
  position: relative;
  width: min(250px, 100%);
  margin: 1.45rem auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 164, 125, 0.48);
  border-radius: 26px;
  background: #302fc7;
  box-shadow: 0 18px 42px rgba(8, 15, 101, 0.42), 0 0 0 7px rgba(255, 90, 10, 0.1);
  transform: rotate(-1.5deg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-asset-card:hover { transform: rotate(0deg) translateY(-2px); box-shadow: 0 22px 48px rgba(8, 15, 101, 0.48), 0 0 0 7px rgba(255, 90, 10, 0.14); }
.hero-asset-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.hero-asset-caption { position: absolute; right: 0.7rem; bottom: 0.7rem; left: 0.7rem; max-width: 76%; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px; padding: 0.55rem 0.65rem; color: #fff; background: rgba(10, 18, 105, 0.76); backdrop-filter: blur(8px); text-align: left; }
.hero-asset-caption span { display: block; margin-bottom: 0.16rem; color: #ffb08a; font-family: Inter, sans-serif; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; }
.hero-asset-caption strong { display: block; color: #fff; font-size: 0.76rem; line-height: 1.35; }

.hero-graph-card {
  min-height: 250px;
  padding: 1rem;
  color: #fff;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 90, 10, 0.32), transparent 8rem),
    radial-gradient(circle at 12% 90%, rgba(0, 210, 214, 0.18), transparent 8rem),
    linear-gradient(145deg, #090f63 0%, #2829ba 64%, #3f42dc 100%);
  box-shadow: 0 18px 42px rgba(8, 15, 101, 0.42), 0 0 0 7px rgba(255, 90, 10, 0.1);
}

.hero-graph-card:hover { box-shadow: 0 22px 48px rgba(8, 15, 101, 0.48), 0 0 0 7px rgba(255, 90, 10, 0.14); }
.hero-graph-topline, .hero-graph-heading, .hero-graph-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; }
.hero-graph-topline { color: rgba(229, 235, 255, 0.72); font-family: Inter, sans-serif; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.12em; }
.hero-graph-live { display: inline-flex; align-items: center; gap: 0.28rem; color: #a9fff7; font-size: 0.54rem; }
.hero-graph-live i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #00d2d6; box-shadow: 0 0 0 4px rgba(0, 210, 214, 0.15); animation: hero-live-pulse 1.8s ease-in-out infinite; }
.hero-graph-heading { margin-top: 0.5rem; align-items: end; }
.hero-graph-heading strong { color: #fff; font-size: 1rem; letter-spacing: -0.03em; }
.hero-graph-heading span { color: #ffb08a; font-family: Inter, sans-serif; font-size: 0.58rem; font-weight: 800; }
.hero-graph-svg { position: relative; z-index: 1; display: block; width: 100%; height: auto; margin: 0.5rem 0 0.15rem; overflow: visible; }
.hero-graph-grid line { stroke: rgba(220, 228, 255, 0.18); stroke-width: 1; stroke-dasharray: 2 4; }
.hero-graph-area { fill: url(#hero-graph-fill); opacity: 0.82; }
.hero-graph-line { fill: none; stroke: url(#hero-graph-stroke); stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; stroke-dasharray: 410; stroke-dashoffset: 410; animation: hero-graph-draw 4.8s ease-in-out infinite alternate; }
.hero-graph-dots circle { fill: #f7ffff; stroke: #4fe6df; stroke-width: 2; animation: hero-graph-dot 2.8s ease-in-out infinite; }
.hero-graph-dots circle:nth-child(2) { animation-delay: 0.16s; }
.hero-graph-dots circle:nth-child(3) { animation-delay: 0.32s; }
.hero-graph-dots circle:nth-child(4) { animation-delay: 0.48s; }
.hero-graph-dots circle:nth-child(5) { animation-delay: 0.64s; }
.hero-graph-dots circle:nth-child(6) { animation-delay: 0.8s; }
.hero-graph-dots circle:nth-child(7) { fill: #ffb08a; stroke: #fff0e3; animation-delay: 0.96s; }
.hero-graph-focus { fill: #ff7a36; stroke: #fff; stroke-width: 3; animation: hero-graph-focus 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.hero-graph-footer { margin-top: 0.15rem; align-items: end; }
.hero-graph-footer > div:first-child { display: flex; align-items: baseline; gap: 0.45rem; }
.hero-graph-footer span { color: rgba(229, 235, 255, 0.68); font-family: Inter, sans-serif; font-size: 0.54rem; font-weight: 800; letter-spacing: 0.08em; }
.hero-graph-footer strong { color: #fff; font-family: Inter, sans-serif; font-size: 1.5rem; line-height: 1; }
.hero-graph-footer strong small { color: #9bfff4; font-size: 0.7rem; }
.hero-graph-trend { display: inline-flex; align-items: center; gap: 0.32rem; color: #a9fff7; }
.hero-graph-trend span { color: #a9fff7; font-family: "Noto Sans Thai", sans-serif; font-size: 0.58rem; letter-spacing: 0; }
.hero-graph-trend b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 7px; color: #fff; background: rgba(0, 168, 173, 0.36); font-family: Inter, sans-serif; font-size: 0.85rem; }
.hero-graph-caption { position: relative; z-index: 1; margin-top: 0.55rem; border-top: 1px solid rgba(224, 231, 255, 0.18); padding-top: 0.5rem; text-align: left; }
.hero-graph-caption span { display: block; margin-bottom: 0.1rem; color: #ffb08a; font-family: Inter, sans-serif; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.08em; }
.hero-graph-caption strong { display: block; color: #fff; font-size: 0.7rem; line-height: 1.35; }
@keyframes hero-graph-draw { from { stroke-dashoffset: 410; opacity: 0.4; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes hero-graph-dot { 0%, 100% { opacity: 0.55; transform: scale(0.78); } 50% { opacity: 1; transform: scale(1.22); } }
@keyframes hero-graph-focus { 0%, 100% { opacity: 0.7; transform: scale(0.82); } 50% { opacity: 1; transform: scale(1.28); } }
@keyframes hero-live-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }

.hero-lede {
  max-width: 600px;
  margin-bottom: 1.6rem;
  color: #4d5780;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; }
.microcopy-compact { margin: 0; }
.microcopy-no-bottom { margin-bottom: 0; }
.alert-error { margin-top: 1rem; border-color: #f0caca; padding: 0.9rem 1rem; color: #9d3030; background: #fff3f3; font-size: 0.82rem; }

.primary-button, .secondary-button, .line-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 13px;
  padding: 0.72rem 1.2rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--electric-blue), var(--blue) 68%, var(--orange) 135%);
  box-shadow: 0 11px 24px rgba(6, 20, 245, 0.3);
}

.primary-button:hover, .line-button:hover { transform: translateY(-2px); box-shadow: 0 15px 28px rgba(6, 20, 245, 0.34); }

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover { border-color: #aeb7ee; background: #f6f7ff; }

.button-small { min-height: 40px; padding: 0.55rem 0.9rem; font-size: 0.86rem; }

.microcopy { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }

.hero-visual {
  position: relative;
  min-height: 300px;
  border-radius: 24px;
  padding: 1rem;
  background: linear-gradient(145deg, #151b93, #4842e6 55%, #0614f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 23px 48px rgba(14, 20, 129, 0.32);
  overflow: hidden;
}

.hero-visual::after {
  position: absolute;
  top: -7rem;
  right: -5rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.04), 0 0 0 56px rgba(255, 255, 255, 0.03);
  content: "";
}

.hero-visual-title { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.7); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.score-preview {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 1.2rem;
  color: #fff;
  background: rgba(10, 18, 105, 0.66);
  backdrop-filter: blur(12px);
}

.score-preview-label { margin-bottom: 0.35rem; color: rgba(255, 255, 255, 0.62); font-size: 0.72rem; }
.score-preview-value { margin-bottom: 0.55rem; font-family: Inter, sans-serif; font-size: 3rem; font-weight: 800; line-height: 1; }
.score-preview-denom { color: rgba(255, 255, 255, 0.7); font-size: 1.2rem; }
.score-preview-row { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.score-chip { border-radius: 999px; padding: 0.34rem 0.55rem; color: #e4ffff; background: rgba(0, 168, 173, 0.24); font-size: 0.68rem; }

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.benefit-card { padding: 1.15rem 1.2rem; border: 1px solid rgba(218, 220, 247, 0.82); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow-soft); }
.benefit-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 0.75rem; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 800; }
.benefit-card h3 { margin-bottom: 0.32rem; font-size: 0.92rem; }
.benefit-card p { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }

.info-strip { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; align-items: center; margin-top: 1rem; padding: 0.9rem 1.15rem; border: 1px solid #bdebe8; border-radius: 15px; color: #006b72; background: var(--green-soft); font-size: 0.79rem; line-height: 1.45; }
.info-strip strong { color: #00606a; }

.quiz-shell { max-width: 780px; margin: 34px auto 0; padding: clamp(1.2rem, 4vw, 2.4rem); }
.quiz-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.quiz-kicker { margin-bottom: 0.35rem; color: var(--electric-blue); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.quiz-header h1 { margin-bottom: 0; font-size: clamp(1.35rem, 4vw, 2rem); letter-spacing: -0.04em; }
.quiz-time-note { display: inline-flex; align-items: center; gap: 0.42rem; white-space: nowrap; border: 1px solid #bdebe8; border-radius: 999px; padding: 0.45rem 0.7rem; color: var(--teal-dark); background: #effcfb; font-size: 0.78rem; font-weight: 800; }
.progress-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.45rem; color: var(--muted); font-size: 0.76rem; }
.progress-track { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; background: #e3e7fb; appearance: none; }
.progress-track::-webkit-progress-bar { border-radius: inherit; background: #e3e7fb; }
.progress-track::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--electric-blue), #4b43e7 58%, var(--teal)); transition: width 220ms ease; }
.progress-track::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--electric-blue), #4b43e7 58%, var(--teal)); }

.question-card { margin-top: 1.5rem; padding: clamp(1.15rem, 4vw, 2rem); border: 1px solid #dfe2f6; border-radius: 20px; background: #fcfcff; }
.question-number { margin-bottom: 0.85rem; color: var(--electric-blue); font-family: Inter, sans-serif; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; }
.question-prompt { margin-bottom: 1.45rem; color: var(--ink); font-family: Inter, "Noto Sans Thai", sans-serif; font-size: clamp(1.12rem, 3vw, 1.45rem); font-weight: 700; line-height: 1.55; }
.blank { display: inline-block; min-width: 3.5rem; border-bottom: 2px solid var(--electric-blue); color: var(--electric-blue); }
.option-list { display: grid; gap: 0.7rem; }
.option-button { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0.7rem; width: 100%; align-items: center; border: 1px solid #d9ddf2; border-radius: 14px; padding: 0.8rem 0.9rem; color: var(--ink); text-align: left; background: #fff; transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.option-button:hover { border-color: #858bf0; background: #f7f7ff; transform: translateY(-1px); }
.option-button.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(6, 20, 245, 0.12); }
.option-label { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: #51627f; background: #edf0fa; font-family: Inter, sans-serif; font-size: 0.82rem; font-weight: 800; }
.option-button.is-selected .option-label { color: #fff; background: var(--electric-blue); }
.option-text { overflow-wrap: anywhere; font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 0.98rem; line-height: 1.4; }
.quiz-error { min-height: 1.3rem; margin: 0.75rem 0 0; color: #bc3535; font-size: 0.78rem; }
.quiz-actions { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.2rem; }

.result-shell { max-width: 860px; margin: 34px auto 0; padding: clamp(1.2rem, 4vw, 2.4rem); }
.result-hero { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.4rem; align-items: center; }
.result-score { display: grid; min-height: 180px; place-items: center; border-radius: 24px; color: #fff; text-align: center; background: linear-gradient(145deg, var(--electric-blue), #4b43e7 68%, var(--orange) 142%); box-shadow: 0 17px 34px rgba(6, 20, 245, 0.28); }
.result-score small { display: block; margin-bottom: 0.45rem; color: rgba(255, 255, 255, 0.72); font-size: 0.75rem; }
.result-score strong { display: block; font-family: Inter, sans-serif; font-size: 3.25rem; line-height: 1; }
.result-score-denom { color: rgba(255, 255, 255, 0.72); font-size: 1.15rem; }
.result-copy .eyebrow { margin-bottom: 0.5rem; }
.result-copy h1 { margin-bottom: 0.55rem; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -0.045em; }
.result-copy p { margin-bottom: 0.75rem; color: var(--muted); line-height: 1.65; }
.result-band { display: inline-flex; border-radius: 999px; padding: 0.45rem 0.7rem; color: #006b72; background: var(--green-soft); font-size: 0.78rem; font-weight: 800; }
.teaser-insight { display: flex; gap: 0.8rem; align-items: flex-start; margin-top: 1.5rem; padding: 1rem 1.1rem; border: 1px solid #ffd4bd; border-radius: 16px; background: var(--amber-soft); }
.teaser-insight-icon { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: #a53e05; background: #ffd9c4; font-weight: 900; }
.teaser-insight h2 { margin-bottom: 0.2rem; color: #8f3b0c; font-size: 0.95rem; }
.teaser-insight p { margin: 0; color: #84531f; font-size: 0.83rem; line-height: 1.55; }
.result-lock { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid #dfe2f6; border-radius: 18px; background: #f5f6ff; }
.result-lock h2 { margin-bottom: 0.35rem; font-size: 1.1rem; }
.result-lock > p { margin-bottom: 1rem; color: var(--muted); font-size: 0.83rem; line-height: 1.55; }
.locked-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 1.2rem; }
.locked-skill { position: relative; overflow: hidden; border: 1px dashed #bec6ee; border-radius: 12px; padding: 0.8rem; color: #66709a; background: #eef0fc; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72); cursor: not-allowed; font-size: 0.76rem; }
.locked-skill::before { position: absolute; top: 0.65rem; right: 0.7rem; color: #828bc0; content: "🔒"; font-size: 0.72rem; opacity: 0.9; }
.locked-skill span { display: block; margin-bottom: 0.2rem; color: #414b78; font-weight: 800; }
.locked-skill-state { color: #7079a3 !important; font-weight: 600 !important; }

.lead-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #31415f; font-size: 0.79rem; font-weight: 800; }
.form-field input, .form-field select { width: 100%; min-height: 44px; border: 1px solid #cfd4ef; border-radius: 11px; outline: none; padding: 0.62rem 0.75rem; color: var(--ink); background: #fff; }
.form-field input:focus, .form-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6, 20, 245, 0.12); }
.checkbox-field { display: flex; gap: 0.6rem; align-items: flex-start; color: #53627b; font-size: 0.76rem; line-height: 1.55; }
.checkbox-field input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 0.1rem; accent-color: var(--blue); }
.form-note { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.loading-copy { margin: 0; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; grid-column: 1 / -1; }
.lead-error { grid-column: 1 / -1; min-height: 1.3rem; margin: 0; color: #bc3535; font-size: 0.78rem; }

.line-success { margin-top: 1.2rem; padding: 1.15rem; border: 1px solid #bdebe8; border-radius: 16px; background: var(--green-soft); }
.line-success h2 { margin-bottom: 0.35rem; color: #006b72; font-size: 1.05rem; }
.line-success p { margin-bottom: 0.9rem; color: #24787d; font-size: 0.82rem; line-height: 1.55; }
.line-button { color: #fff; background: linear-gradient(135deg, #008f96, #00c4c2); box-shadow: 0 10px 22px rgba(0, 168, 173, 0.24); }
.line-button:hover { box-shadow: 0 14px 28px rgba(0, 168, 173, 0.32); }

.line-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.line-expiry { display: block; margin-top: 0.75rem; color: #24787d; font-size: 0.72rem; }

.full-result-shell { max-width: 980px; margin: 34px auto 0; padding: clamp(1.2rem, 4vw, 2.4rem); }
.full-result-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 1.25rem; align-items: center; }
.full-result-header h1 { margin-bottom: 0.55rem; color: var(--ink); font-size: clamp(1.7rem, 4vw, 2.55rem); letter-spacing: -0.05em; }
.full-result-header p:not(.eyebrow) { max-width: 640px; margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.full-score { display: grid; min-height: unset; place-items: center; border-radius: 30px; padding: 0.45rem; color: var(--ink); text-align: center; background: radial-gradient(circle at 14% 8%, rgba(255, 90, 10, 0.2), transparent 42%), radial-gradient(circle at 90% 84%, rgba(111, 102, 244, 0.3), transparent 46%), linear-gradient(145deg, #fffaf7, #f1f0ff); box-shadow: inset 0 0 0 1px rgba(218, 220, 247, 0.86); }
.score-gauge { --gauge-size: clamp(230px, 29vw, 320px); position: relative; width: var(--gauge-size); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto; }
.score-gauge-face { position: absolute; inset: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 50%; background: radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.99) 0 57%, rgba(246, 247, 249, 0.98) 58% 100%); box-shadow: 0 18px 34px rgba(36, 58, 98, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.7); }
.score-gauge-face::before { position: absolute; inset: 15%; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: inset 0 0 26px rgba(177, 188, 204, 0.1); content: ""; }
.score-gauge-ticks { position: absolute; inset: 0; z-index: 1; }
.score-gauge-tick { position: absolute; top: 50%; left: 50%; width: 5px; height: 14px; margin: -7px 0 0 -2.5px; border-radius: 999px; background: #f2d7d2; opacity: 0.92; transform-origin: 50% 50%; }
.score-gauge-tick.is-filled { opacity: 1; }
.score-gauge-tick-red { background: #f1caca; }
.score-gauge-tick-red.is-filled { background: #dc5a5a; }
.score-gauge-tick-yellow { background: #ffe5c1; }
.score-gauge-tick-yellow.is-filled { background: #ff9a3d; }
.score-gauge-tick-green { background: #c9f0ed; }
.score-gauge-tick-green.is-filled { background: #00a8ad; }
.score-gauge-marker { position: absolute; top: 50%; left: 50%; z-index: 2; width: 7px; height: 28px; margin: -14px 0 0 -3.5px; border-radius: 999px; background: linear-gradient(180deg, #63eee0, #008f96); box-shadow: 0 0 0 3px rgba(0, 168, 173, 0.16), 0 3px 11px rgba(0, 127, 139, 0.28); transform-origin: 50% 50%; }
.score-gauge-marker::after { position: absolute; bottom: -4px; left: 50%; width: 11px; height: 11px; border-radius: 2px; background: inherit; content: ""; transform: translateX(-50%) rotate(45deg); }
.score-gauge-center { position: absolute; inset: 23%; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.score-gauge-value { margin: 0; color: #62646a; font-family: Inter, sans-serif; font-size: clamp(4.8rem, 12vw, 7.2rem); font-weight: 500; line-height: 0.86; letter-spacing: -0.09em; animation: score-value-pop 700ms cubic-bezier(.22,.9,.32,1) both; }
.score-gauge-level { max-width: 150px; margin-top: 0.8rem; color: #f57735; font-family: Inter, "Noto Sans Thai", sans-serif; font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 500; line-height: 1.05; }
.score-gauge.is-medium .score-gauge-level { color: #dc8c32; }
.score-gauge.is-build .score-gauge-level { color: #d35b5b; }
.score-gauge-count { margin-top: 0.5rem; color: #a7abb2; font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 0.68rem; font-weight: 700; }
.score-gauge-min, .score-gauge-max { position: absolute; bottom: 10%; z-index: 3; color: #b9bdc3; font-family: Inter, sans-serif; font-size: 1.35rem; font-weight: 600; line-height: 1; }
.score-gauge-min { left: 18%; }
.score-gauge-max { right: 18%; }
@keyframes score-value-pop { from { opacity: .25; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes score-tick-reveal { 0% { opacity: .25; filter: saturate(.45); } 65% { opacity: 1; filter: saturate(1.35); } 100% { opacity: 1; filter: saturate(1); } }
.score-gauge-tick.is-filled { animation: score-tick-reveal 560ms cubic-bezier(.22,.9,.32,1) var(--score-tick-delay, 0ms) both; }
.full-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 1.4rem; }
.full-summary-grid > div { border: 1px solid #dfe2f6; border-radius: 14px; padding: 0.9rem 1rem; background: #f5f6ff; }
.full-summary-grid span { display: block; margin-bottom: 0.28rem; color: var(--muted); font-size: 0.72rem; }
.full-summary-grid strong { color: var(--ink); font-size: 0.86rem; line-height: 1.4; }
.full-result-section { margin-top: 1.8rem; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem 1.2rem; align-items: end; margin-bottom: 0.9rem; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 1.28rem; letter-spacing: -0.035em; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.section-kicker { margin-bottom: 0.25rem; color: var(--blue); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.radar-card { display: grid; grid-template-columns: minmax(250px, 370px) minmax(0, 1fr); gap: 0.8rem 1.4rem; align-items: center; margin-bottom: 1rem; border: 1px solid #dfe2f6; border-radius: 20px; padding: 1rem 1.1rem; background: linear-gradient(145deg, #f7f7ff, #fff); }
.radar-card-heading { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1rem; align-items: end; }
.radar-card-heading .section-kicker { margin-bottom: 0.2rem; }
.radar-card-heading h3 { margin: 0; color: var(--ink); font-size: 1rem; letter-spacing: -0.025em; }
.radar-card-heading > span { color: var(--muted); font-size: 0.7rem; }
.radar-chart-wrap { width: min(100%, 370px); margin: 0 auto; }
.radar-chart { display: block; width: 100%; height: auto; overflow: visible; }
.radar-grid { fill: none; stroke: #dce5f2; stroke-width: 1; }
.radar-axis { stroke: #e4eaf3; stroke-width: 1; stroke-dasharray: 3 3; }
.radar-score-area { fill: rgba(6, 20, 245, 0.16); stroke: #3f42dc; stroke-width: 3; stroke-linejoin: round; }
.radar-score-point { fill: #fff; stroke: #3f42dc; stroke-width: 3; }
.radar-center { fill: #00a8ad; }
.radar-axis-label { fill: #52647e; font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 10px; font-weight: 800; }
.radar-axis-value { fill: #2f40ca; font-size: 11px; }
.radar-card-note { align-self: center; margin: 0; color: var(--muted); font-size: 0.77rem; line-height: 1.65; }
.personal-guidance { margin-top: 1.7rem; border: 1px solid #dfe2f6; border-left: 4px solid var(--orange); border-radius: 16px; padding: 1rem 1.1rem; background: linear-gradient(145deg, #fffaf7, #fff); }
.personal-guidance-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: end; margin-bottom: 0.45rem; }
.personal-guidance-heading .section-kicker { margin-bottom: 0.2rem; }
.personal-guidance h2 { margin: 0; color: var(--ink); font-size: 1.08rem; letter-spacing: -0.03em; }
.personal-guidance p { margin: 0; color: #4f607b; font-size: 0.82rem; line-height: 1.7; }
.personal-guidance p + p { margin-top: 0.45rem; }
.full-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.full-skill-card { border: 1px solid #dfe2f6; border-radius: 16px; padding: 1rem; background: #fff; }
.full-skill-card.is-strong { border-color: #bdebe8; background: #f8fffe; }
.full-skill-card.is-leaky { border-color: #ffd4bd; background: #fffaf7; }
.full-skill-card.is-weak { border-color: #f2caca; background: #fffafa; }
.full-skill-heading { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.full-skill-heading h3 { margin-bottom: 0.25rem; color: var(--ink); font-size: 0.92rem; }
.full-skill-heading p { margin: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.45; }
.full-skill-heading > strong { flex: 0 0 auto; color: var(--blue-dark); font-family: Inter, sans-serif; font-size: 1.2rem; }
.full-skill-track { display: block; width: 100%; height: 8px; margin-top: 0.8rem; overflow: hidden; border: 0; border-radius: 999px; background: #e8edf5; appearance: none; }
.full-skill-track::-webkit-progress-bar { border-radius: inherit; background: #e8edf5; }
.full-skill-track::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--electric-blue), #4b43e7); transition: width 260ms ease; }
.full-skill-track::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--electric-blue), #4b43e7); }
.full-skill-track.is-strong::-webkit-progress-value { background: linear-gradient(90deg, #008f96, #39d5cc); }
.full-skill-track.is-strong::-moz-progress-bar { background: linear-gradient(90deg, #008f96, #39d5cc); }
.full-skill-track.is-leaky::-webkit-progress-value { background: linear-gradient(90deg, #e66b1b, #ffb45f); }
.full-skill-track.is-leaky::-moz-progress-bar { background: linear-gradient(90deg, #e66b1b, #ffb45f); }
.full-skill-track.is-weak::-webkit-progress-value { background: linear-gradient(90deg, #d14949, #f18b70); }
.full-skill-track.is-weak::-moz-progress-bar { background: linear-gradient(90deg, #d14949, #f18b70); }
.full-skill-meta { display: flex; justify-content: space-between; gap: 0.7rem; margin-top: 0.5rem; color: var(--muted); font-size: 0.7rem; }
.full-skill-meta span:last-child { font-weight: 800; }
.full-question-list { display: grid; gap: 0.75rem; }
.full-question-card { border: 1px solid #dfe2f6; border-left-width: 4px; border-radius: 15px; padding: 1rem; background: #fff; }
.full-question-card.is-wrong { border-left-color: #e66b1b; }
.full-question-card.is-correct { border-left-color: #00a8ad; }
.full-question-top { display: flex; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.45rem; color: var(--muted); font-size: 0.7rem; }
.full-question-top strong { color: #b34444; }
.is-correct .full-question-top strong { color: #006b72; }
.full-question-card h3 { margin-bottom: 0.8rem; color: var(--ink); font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 0.98rem; line-height: 1.55; }
.full-question-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 0.7rem; }
.full-question-choices span { color: #68758a; font-size: 0.75rem; line-height: 1.4; }
.full-question-choices .is-answer { color: #006b72; font-weight: 800; }
.full-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.8rem; }
.full-answer-grid > div { border-radius: 10px; padding: 0.6rem 0.7rem; background: #f6f8fb; }
.full-answer-grid small { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.66rem; }
.full-answer-grid strong { display: block; color: var(--ink); font-size: 0.75rem; line-height: 1.4; }
.full-rationale { margin: 0.8rem 0 0; color: #586780; font-size: 0.76rem; line-height: 1.55; }
.full-rationale b { color: #34435f; }
.full-result-note { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-top: 1.5rem; border: 1px solid #bdebe8; border-radius: 13px; padding: 0.8rem 0.9rem; color: #24787d; background: var(--green-soft); font-size: 0.74rem; line-height: 1.5; }
.full-result-note strong { color: #006b72; }
.full-result-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; align-items: center; margin-top: 1.2rem; color: var(--muted); font-size: 0.7rem; }
.line-result-state { max-width: 560px; margin: 80px auto 0; padding: 2rem; text-align: center; }
.line-result-state h1 { margin-bottom: 0.55rem; color: var(--ink); font-size: 1.55rem; letter-spacing: -0.04em; }
.line-result-state p { max-width: 440px; margin-right: auto; margin-left: auto; color: var(--muted); font-size: 0.85rem; line-height: 1.65; }
.line-result-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 1rem; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--electric-blue), #4b43e7 68%, var(--orange)); font-family: Inter, sans-serif; font-weight: 800; }
.empty-copy { color: var(--muted); font-size: 0.8rem; }

.footer-note { margin-top: 1rem; color: var(--muted); text-align: center; font-size: 0.72rem; line-height: 1.55; }
.loading-state, .error-state { display: grid; min-height: 60vh; place-items: center; text-align: center; }
.loading-state .surface, .error-state .surface { max-width: 460px; padding: 2rem; }
.spinner { width: 32px; height: 32px; margin: 0 auto 1rem; border: 3px solid #e0e2fb; border-top-color: var(--electric-blue); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .score-gauge-value, .score-gauge-tick.is-filled, .hero-graph-line, .hero-graph-dots circle, .hero-graph-focus, .hero-graph-live i { animation: none; }
  .hero-graph-line { stroke-dashoffset: 0; opacity: 1; }
}
.no-script { width: min(600px, calc(100% - 32px)); margin: 3rem auto; border-radius: 14px; padding: 1rem; color: #fff; text-align: center; background: #8c2d2d; }

@media (max-width: 780px) {
  .app-shell { width: min(100% - 20px, 700px); padding-top: 18px; }
  .topbar-note { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 22px; }
  .hero-visual { min-height: 230px; }
  .benefit-grid { grid-template-columns: 1fr; }
  .benefit-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 0.7rem; }
  .benefit-icon { grid-row: span 2; margin-bottom: 0; }
  .benefit-card h3, .benefit-card p { align-self: center; }
  .result-hero { grid-template-columns: 1fr; }
  .result-score { min-height: 140px; }
  .locked-grid { grid-template-columns: repeat(2, 1fr); }
  .full-result-header { grid-template-columns: 1fr; }
  .full-score { padding: 0.2rem; }
  .radar-card { grid-template-columns: 1fr; }
  .radar-card-note { max-width: 500px; margin: 0 auto; text-align: center; }
  .full-skill-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-shell { width: calc(100% - 16px); padding-bottom: 28px; }
  .hero, .quiz-shell, .result-shell { border-radius: 20px; }
  .hero { padding: 1.25rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-actions > * { width: 100%; }
  .hero-conversational { margin-top: 22px; padding: 1.45rem 1rem 1.65rem; }
  .hero-conversational h1 { font-size: clamp(2.2rem, 11vw, 3.25rem); }
  .hero-chat-bubble { margin-bottom: 1rem; font-size: 0.79rem; }
  .hero-conversational .hero-lede { margin-bottom: 1.25rem; font-size: 0.94rem; }
  .hero-meta { gap: 0.55rem; padding: 0.72rem 0.65rem; }
  .hero-meta-item { gap: 0.42rem; }
  .hero-meta-icon { flex-basis: 30px; width: 30px; height: 30px; font-size: 0.9rem; }
  .hero-meta-icon-clock { font-size: 1.08rem; }
  .hero-meta-item strong { font-size: 0.86rem; }
  .hero-meta-item small { font-size: 0.6rem; }
  .hero-conversational .primary-button { width: 100%; min-height: 56px; padding-right: 1rem; padding-left: 1rem; }
  .hero-reassurance { align-items: flex-start; text-align: left; font-size: 0.74rem; }
  .brand-logo { width: 116px; }
  .brand-logo-wrap { min-height: 40px; border-radius: 12px; padding: 3px 8px; }
  .hero-asset-card { width: min(220px, 78vw); }
  .quiz-header { flex-direction: column; }
  .timer { align-self: flex-start; }
  .lead-form { grid-template-columns: 1fr; }
  .form-field.full, .form-actions, .lead-error { grid-column: auto; }
  .locked-grid { grid-template-columns: 1fr 1fr; }
  .quiz-actions { flex-direction: column-reverse; }
  .quiz-actions > * { width: 100%; }
  .full-summary-grid { grid-template-columns: 1fr; }
  .score-gauge { --gauge-size: min(86vw, 300px); }
  .full-question-choices, .full-answer-grid { grid-template-columns: 1fr; }
  .line-actions > * { width: 100%; }
}

/* User-selectable dark theme. Keep the brand colors bright enough for contrast. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f6ff;
  --muted: #abb5d8;
  --line: #374177;
  --blue-soft: #1e266b;
  --orange-soft: #432719;
  --teal-soft: #103c43;
  --green-soft: #103c43;
  --amber-soft: #432719;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
  background: #0b102e;
}

html[data-theme="dark"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 102, 244, 0.18), transparent 30rem),
    radial-gradient(circle at 94% 25%, rgba(0, 168, 173, 0.1), transparent 24rem),
    linear-gradient(180deg, #0b102e 0%, #0e1438 100%);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .brand { color: #f4f6ff; }
html[data-theme="dark"] .topbar-note { color: var(--muted); }
html[data-theme="dark"] .brand-logo-wrap { border-color: #3b457b; background: #fff; }
html[data-theme="dark"] .theme-toggle { border-color: #3b457b; color: #f4f6ff; background: #171d4a; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22); }
html[data-theme="dark"] .theme-toggle:hover { border-color: #6973df; background: #20285c; }

html[data-theme="dark"] .surface { border-color: #333d75; background: #141a41; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28); }
html[data-theme="dark"] .hero-conversational {
  border-color: #3e4a91;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 2%, rgba(255, 90, 10, 0.16), transparent 31%),
    radial-gradient(circle at 6% 100%, rgba(0, 210, 214, 0.12), transparent 30%),
    linear-gradient(145deg, #171d4b 0%, #10163a 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .hero-conversational::before { border-color: rgba(161, 157, 255, 0.18); box-shadow: 0 0 0 28px rgba(161, 157, 255, 0.045), 0 0 0 56px rgba(161, 157, 255, 0.025); }
html[data-theme="dark"] .hero-chat-bubble { border-color: rgba(255, 146, 93, 0.46); color: #ffd7c4; background: rgba(255, 90, 10, 0.16); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
html[data-theme="dark"] .hero-conversational h1 { color: #f8f9ff; }
html[data-theme="dark"] .hero-conversational h1 .hero-headline-accent { background: linear-gradient(100deg, #fff0e3 0%, #ff9a5c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html[data-theme="dark"] .hero-conversational .hero-lede { color: #bfc8e4; }
html[data-theme="dark"] .hero-meta { border-color: #3b457b; color: var(--ink); background: rgba(18, 24, 62, 0.94); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2); }
html[data-theme="dark"] .hero-meta-item strong { color: #f4f6ff; }
html[data-theme="dark"] .hero-meta-item small { color: #aeb8d8; }
html[data-theme="dark"] .hero-meta-icon { border-color: #5864c5; color: #dfe2ff; background: #252d72; }
html[data-theme="dark"] .hero-meta-icon-clock { border-color: #297b80; color: #9bfff4; background: #123f46; }
html[data-theme="dark"] .hero-meta-divider { background: #3d477b; }
html[data-theme="dark"] .hero-reassurance { color: #aeb8d8; }
html[data-theme="dark"] .hero-conversational .alert-error { border-color: #7e3e4b; color: #ffc4c4; background: #422331; }

html[data-theme="dark"] .theme-toggle-icon { color: #ffd0b4; background: #55301f; }
html[data-theme="dark"] .benefit-card { border-color: #333d75; background: #141a41; box-shadow: var(--shadow-soft); }
html[data-theme="dark"] .benefit-icon { color: #dfe2ff; background: #252d72; }
html[data-theme="dark"] .info-strip { border-color: #25666b; color: #a9fff7; background: #12363d; }
html[data-theme="dark"] .info-strip strong { color: #c7fffb; }
html[data-theme="dark"] .secondary-button { border-color: #3d477b; color: var(--ink); background: #171d46; }
html[data-theme="dark"] .secondary-button:hover { border-color: #6973df; background: #20285c; }
html[data-theme="dark"] .microcopy { color: var(--muted); }
html[data-theme="dark"] .alert-error { border-color: #7e3e4b; color: #ffc4c4; background: #422331; }

html[data-theme="dark"] .quiz-time-note { border-color: #297b80; color: #9bfff4; background: #123f46; }
html[data-theme="dark"] .progress-track,
html[data-theme="dark"] .progress-track::-webkit-progress-bar { background: #2b3566; }
html[data-theme="dark"] .question-card { border-color: #354075; background: #0f1535; }
html[data-theme="dark"] .option-button { border-color: #374477; color: var(--ink); background: #171d42; }
html[data-theme="dark"] .option-button:hover { border-color: #6873db; background: #202957; }
html[data-theme="dark"] .option-button.is-selected { border-color: #7079f0; background: #202a6b; box-shadow: 0 0 0 3px rgba(111, 122, 255, 0.2); }
html[data-theme="dark"] .option-label { color: #c1c9e3; background: #29335f; }
html[data-theme="dark"] .option-button.is-selected .option-label { color: #fff; background: var(--electric-blue); }
html[data-theme="dark"] .quiz-error { color: #ffaaa9; }

html[data-theme="dark"] .result-copy p { color: var(--muted); }
html[data-theme="dark"] .result-band { color: #a9fff7; background: #123f46; }
html[data-theme="dark"] .teaser-insight { border-color: #75442e; background: #432719; }
html[data-theme="dark"] .teaser-insight-icon { color: #ffd0b4; background: #63371e; }
html[data-theme="dark"] .teaser-insight h2 { color: #ffc09d; }
html[data-theme="dark"] .teaser-insight p { color: #e4b59d; }
html[data-theme="dark"] .result-lock { border-color: #3b457b; background: #1b214d; }
html[data-theme="dark"] .result-lock > p { color: var(--muted); }
html[data-theme="dark"] .locked-skill { border-color: #5965a2; color: #b8c1df; background: #252d62; }
html[data-theme="dark"] .locked-skill span { color: #dbe0ff; }
html[data-theme="dark"] .locked-skill-state { color: #bbc4e1 !important; }
html[data-theme="dark"] .form-field label { color: #d7def5; }
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select { border-color: #3d477b; color: var(--ink); background: #0f1535; }
html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field select:focus { border-color: #6873db; }
html[data-theme="dark"] .checkbox-field { color: #b7c1de; }
html[data-theme="dark"] .line-success { border-color: #297b80; background: #123f46; }
html[data-theme="dark"] .line-success h2 { color: #a9fff7; }
html[data-theme="dark"] .line-success p,
html[data-theme="dark"] .line-expiry { color: #9ddbd6; }

html[data-theme="dark"] .full-score { color: var(--ink); background: radial-gradient(circle at 14% 8%, rgba(255, 90, 10, 0.16), transparent 42%), radial-gradient(circle at 90% 84%, rgba(111, 102, 244, 0.24), transparent 46%), linear-gradient(145deg, #20275c, #151a43); box-shadow: inset 0 0 0 1px #3c467d; }
html[data-theme="dark"] .full-summary-grid > div { border-color: #3b457b; background: #1b214d; }
html[data-theme="dark"] .full-summary-grid strong { color: #f4f6ff; }
html[data-theme="dark"] .radar-card { border-color: #3b457b; background: linear-gradient(145deg, #1b214d, #141a41); }
html[data-theme="dark"] .radar-grid { stroke: #3d477b; }
html[data-theme="dark"] .radar-axis { stroke: #35406f; }
html[data-theme="dark"] .radar-axis-label { fill: #c1c9e3; }
html[data-theme="dark"] .radar-axis-value { fill: #aeb8ff; }
html[data-theme="dark"] .personal-guidance { border-color: #3b457b; border-left-color: var(--orange); background: linear-gradient(145deg, #2b211f, #171b3d); }
html[data-theme="dark"] .personal-guidance p { color: #c3cbe4; }
html[data-theme="dark"] .full-skill-card,
html[data-theme="dark"] .full-question-card { border-color: #3b457b; background: #141a41; }
html[data-theme="dark"] .full-skill-card.is-strong { border-color: #297b80; background: #12363d; }
html[data-theme="dark"] .full-skill-card.is-leaky { border-color: #75442e; background: #432719; }
html[data-theme="dark"] .full-skill-card.is-weak { border-color: #7e3e4b; background: #422331; }
html[data-theme="dark"] .full-question-card.is-wrong { border-left-color: #e66b1b; }
html[data-theme="dark"] .full-question-card.is-correct { border-left-color: #00a8ad; }
html[data-theme="dark"] .full-question-choices span { color: #aeb8d8; }
html[data-theme="dark"] .full-answer-grid > div { background: #1b214d; }
html[data-theme="dark"] .full-result-note { border-color: #297b80; color: #9ddbd6; background: #123f46; }
html[data-theme="dark"] .full-result-note strong { color: #a9fff7; }

html[data-theme="dark"] .footer-note { color: #8f9abe; }
html[data-theme="dark"] .loading-state .surface,
html[data-theme="dark"] .error-state .surface { background: #141a41; }
html[data-theme="dark"] .spinner { border-color: #303a6a; border-top-color: #7782ff; }
