:root {
  --ink: #193037;
  --ink-soft: #53666b;
  --paper: #f4efe5;
  --paper-strong: #fffaf0;
  --line: rgba(25, 48, 55, 0.14);
  --teal: #1b555d;
  --teal-dark: #123f49;
  --mint: #75b8ae;
  --gold: #e1ad58;
  --orange: #b86636;
  --sage: #687e6c;
  --blue: #617f90;
  --danger: #a2463d;
  --shadow: 0 24px 60px rgba(32, 45, 45, 0.11);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 13px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(225, 173, 88, 0.13), transparent 30rem),
    radial-gradient(circle at 92% 30%, rgba(117, 184, 174, 0.14), transparent 28rem),
    var(--paper);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 13px;
  height: 13px;
  border-radius: 50% 50% 50% 2px;
  background: var(--gold);
  box-shadow: 12px -7px 0 -2px var(--mint);
  transform: rotate(-18deg);
}

.header-note {
  color: var(--ink-soft);
  font-size: 13px;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 80px;
  position: relative;
  z-index: 1;
}

.narrow-page {
  width: min(680px, calc(100% - 32px));
  min-height: calc(100vh - 250px);
  display: grid;
  place-items: center;
}

.eyebrow {
  display: inline-block;
  color: var(--teal);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  min-height: 600px;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding: 34px 0 50px;
}

.hero h1 {
  margin: 18px 0 22px;
  font-size: clamp(52px, 7.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 880;
}

.hero h1 span {
  color: var(--teal);
  position: relative;
  display: inline-block;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 0;
  bottom: 2px;
  height: 13px;
  z-index: -1;
  background: var(--gold);
  border-radius: 999px;
  opacity: 0.62;
}

.hero-lead {
  max-width: 550px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 21px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-meta span {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 650;
}

.hero-visual {
  position: relative;
  padding: 30px 0 10px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(8deg);
  border-radius: 47% 53% 63% 37% / 42% 38% 62% 58%;
  background: rgba(117, 184, 174, 0.18);
}

.hero-visual img {
  position: relative;
  width: 100%;
  border: 10px solid rgba(255, 250, 240, 0.76);
  border-radius: 38px;
  box-shadow: var(--shadow);
  transform: rotate(1.6deg);
}

.floating-note {
  position: absolute;
  z-index: 2;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--paper-strong);
  box-shadow: 0 12px 30px rgba(27, 53, 55, 0.14);
  font-size: 13px;
  font-weight: 750;
}

.note-one {
  left: -18px;
  top: 18%;
  color: var(--teal);
  transform: rotate(-5deg);
}

.note-two {
  right: -10px;
  top: 5%;
  color: var(--orange);
  transform: rotate(6deg);
}

.note-three {
  right: 5%;
  bottom: 5%;
  color: var(--sage);
  transform: rotate(-4deg);
}

.disclaimer-banner {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 16px;
  padding: 22px 26px;
  margin-bottom: 78px;
  border: 1px solid rgba(168, 105, 55, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 247, 229, 0.75);
  color: #665742;
}

.disclaimer-banner strong {
  color: #8b592f;
}

.disclaimer-banner p {
  margin: 0;
  font-size: 14px;
}

.section-block {
  margin: 80px 0;
}

.section-heading h2 {
  max-width: 720px;
  margin: 10px 0 30px;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-heading.compact h2 {
  margin-bottom: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  min-height: 255px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 14px 40px rgba(46, 58, 55, 0.05);
}

.feature-card:nth-child(2) {
  background: rgba(220, 238, 232, 0.72);
}

.feature-card:nth-child(3) {
  background: rgba(247, 223, 188, 0.63);
}

.feature-number {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.feature-card h3 {
  margin: 50px 0 10px;
  font-size: 25px;
}

.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.grade-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grade-pill {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
}

.grade-pill strong {
  font-size: 52px;
  line-height: 1;
  opacity: 0.92;
}

.grade-pill span {
  font-weight: 650;
}

.grade-a { background: linear-gradient(145deg, #1d6268, #123f49); }
.grade-b { background: linear-gradient(145deg, #d3824b, #a6552c); }
.grade-c { background: linear-gradient(145deg, #7e9984, #536b5b); }
.grade-d { background: linear-gradient(145deg, #86a4b5, #587789); }

.purchase-card {
  scroll-margin-top: 24px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 36px;
  background: var(--teal-dark);
  color: #fff;
  box-shadow: 0 30px 70px rgba(18, 63, 73, 0.24);
}

.purchase-card .eyebrow {
  color: #9dd6cc;
}

.purchase-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

.purchase-top h2 {
  margin: 8px 0 0;
  max-width: 650px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

.price {
  white-space: nowrap;
  font-size: clamp(54px, 6vw, 82px);
  line-height: 1;
  font-weight: 850;
  color: #f6d68e;
  letter-spacing: -0.055em;
}

.price span {
  font-size: 0.36em;
  margin-right: 4px;
  vertical-align: top;
}

.purchase-list {
  display: grid;
  gap: 8px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.78);
}

.purchase-list li::before {
  content: "✓";
  margin-right: 10px;
  color: #9dd6cc;
  font-weight: 800;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.76);
}

.consent-row input {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  accent-color: var(--gold);
  flex: 0 0 auto;
}

.consent-row a {
  color: #f6d68e;
  margin: 0 3px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 15px;
  border: 1px solid transparent;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary-button {
  background: var(--gold);
  color: #2e2b23;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #efc36f;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover {
  background: #fffaf0;
}

.purchase-card .primary-button {
  width: 100%;
  min-height: 58px;
  font-size: 17px;
}

.purchase-card .secondary-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.pay-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.redeem-text-link {
  display: block;
  margin-top: 16px;
  color: #f6d68e;
  text-align: center;
  font-size: 13px;
}

.channel-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 20px;
  align-items: center;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid rgba(246, 214, 142, 0.42);
  border-radius: 16px;
  background: rgba(246, 214, 142, 0.12);
}

.channel-callout strong {
  color: #f6d68e;
}

.channel-callout span {
  grid-column: 1;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.channel-callout a {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #fff;
  font-weight: 750;
  white-space: nowrap;
}

.inline-message {
  min-height: 22px;
  margin-top: 14px;
  font-size: 14px;
}

.inline-message.error {
  color: var(--danger);
}

.purchase-card .inline-message.error {
  color: #ffb5a8;
}

.faq {
  max-width: 820px;
  margin: 80px auto 0;
}

.faq h2 {
  font-size: 32px;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
}

.faq p {
  color: var(--ink-soft);
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 max(45px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

.footer-mark {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

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

.footer-small {
  margin-bottom: 0;
}

/* Quiz */
.quiz-page {
  width: min(780px, calc(100% - 28px));
  min-height: calc(100vh - 200px);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: 25px 0 20px;
}

.quiz-header h1 {
  margin: 5px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.progress-summary {
  color: var(--ink-soft);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(25, 48, 55, 0.1);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--mint), var(--gold));
  transition: width 280ms ease;
}

.quiz-stage {
  padding: 28px 0 22px;
}

.question-card,
.calc-card,
.review-card {
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(25, 48, 55, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
  animation: rise-in 260ms ease both;
}

.question-number {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.question-text {
  margin: 16px 0 26px;
  font-size: clamp(23px, 4.4vw, 34px);
  line-height: 1.45;
  letter-spacing: -0.02em;
  font-weight: 760;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-card {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-card:hover {
  border-color: rgba(27, 85, 93, 0.45);
  transform: translateY(-1px);
}

.option-card.selected {
  border-color: var(--teal);
  background: #e4f1ec;
  box-shadow: inset 0 0 0 1px var(--teal);
}

.option-key {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #edf1ed;
  color: var(--teal);
  font-weight: 850;
}

.option-card.selected .option-key {
  background: var(--teal);
  color: white;
}

.option-text {
  font-size: 16px;
  line-height: 1.5;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.quiz-actions .primary-button,
.quiz-actions .secondary-button {
  min-height: 56px;
}

.quiz-actions .primary-button {
  background: var(--teal);
  color: white;
}

.autosave-note {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
}

.calc-intro {
  margin: 5px 0 18px;
  color: var(--ink-soft);
}

.calc-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 20px 0;
}

.calc-facts span {
  padding: 11px 13px;
  border-radius: 12px;
  background: #eaf1ed;
  font-size: 14px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.calc-question-list {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.calc-question {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(27, 85, 93, 0.16);
  border-radius: 16px;
  background: rgba(235, 244, 239, 0.58);
}

.calc-question-label {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.calc-question small {
  color: var(--ink-soft);
  font-size: 12px;
}

.input-field {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

.input-field input,
.stack-form input,
.search-form input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  outline: none;
}

.input-field input:focus,
.stack-form input:focus,
.search-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27, 85, 93, 0.1);
}

.review-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.review-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
}

.review-item span {
  color: var(--ink-soft);
  font-size: 14px;
}

.review-item b {
  color: var(--teal);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result */
.result-page {
  width: min(860px, calc(100% - 28px));
}

.result-hero {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 38px;
  color: white;
  box-shadow: var(--shadow);
}

.result-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.grade-bg-a { background: linear-gradient(145deg, #1f6569, #123f49); }
.grade-bg-b { background: linear-gradient(145deg, #c9763e, #98502d); }
.grade-bg-c { background: linear-gradient(145deg, #708976, #4e6556); }
.grade-bg-d { background: linear-gradient(145deg, #6f8fa1, #476475); }

.result-hero .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.result-title-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-title-row h1 {
  margin: 7px 0 3px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.result-title-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.total-score {
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.total-score span,
.total-score small {
  font-size: 12px;
  opacity: 0.72;
}

.total-score strong {
  font-size: 43px;
  line-height: 1.05;
}

.result-portrait {
  position: absolute;
  left: 50%;
  bottom: -40px;
  width: min(680px, 95%);
  border-radius: 32px;
  transform: translateX(-50%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.16);
}

.score-panel,
.reading-card,
.calculation-card,
.save-card {
  margin-top: 20px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.9);
}

.score-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.score-heading h2 {
  margin: 5px 0 0;
  font-size: 30px;
}

.calc-grade {
  padding: 7px 12px;
  border-radius: 999px;
  background: #e9f1ed;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.radar-wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.radar-chart {
  width: 100%;
  max-height: 330px;
  overflow: visible;
}

.radar-chart text {
  fill: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.radar-grid {
  fill: rgba(27, 85, 93, 0.05);
  stroke: rgba(27, 85, 93, 0.25);
  stroke-width: 1.3;
}

.radar-grid.inner {
  fill: none;
}

.radar-axis {
  stroke: rgba(27, 85, 93, 0.16);
  stroke-width: 1;
}

.radar-result {
  fill: rgba(27, 85, 93, 0.36);
  stroke: var(--teal);
  stroke-width: 2.5;
  filter: drop-shadow(0 8px 12px rgba(27, 85, 93, 0.15));
}

.score-list {
  display: grid;
  gap: 10px;
}

.score-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.score-list div:last-child {
  border-bottom: 0;
}

.score-list span {
  color: var(--ink-soft);
}

.score-list strong {
  color: var(--teal);
}

.large-copy {
  margin: 14px 0;
  font-size: 18px;
  line-height: 1.85;
}

.warning-copy {
  margin: 20px 0 0;
  padding: 16px;
  border-radius: 14px;
  background: #fff3da;
  color: #77522f;
  font-size: 14px;
}

.recommendation-card {
  background: #e2efe9;
}

.track-tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.action-list {
  display: grid;
  gap: 9px;
  padding-left: 22px;
}

.muted {
  color: var(--ink-soft);
  font-size: 14px;
}

.answer-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.answer-row div {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  background: #edf2ed;
}

.answer-row span {
  color: var(--ink-soft);
  font-size: 12px;
}

.answer-row strong {
  color: var(--teal);
  font-size: 20px;
}

.solution-copy {
  color: var(--ink-soft);
  font-size: 14px;
}

.save-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  background: #fff4d9;
}

.save-card h2 {
  margin: 5px 0 7px;
  font-size: 28px;
}

.save-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.save-card .primary-button {
  white-space: nowrap;
  background: var(--teal);
  color: white;
}

.compact-disclaimer {
  margin: 20px 0 0;
  grid-template-columns: 100px 1fr;
}

/* Status and legal */
.status-card {
  width: 100%;
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.redeem-page {
  width: min(760px, calc(100% - 28px));
}

.redeem-card {
  margin-top: 18px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.redeem-card h1 {
  margin: 8px 0;
  font-size: clamp(36px, 7vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.redeem-lead {
  color: var(--ink-soft);
}

.redeem-card .stack-form {
  margin-top: 28px;
}

.redeem-card .primary-button {
  margin-top: 6px;
  background: var(--teal);
  color: white;
}

.redeem-existing {
  margin: 24px 0;
  padding: 20px;
  border-radius: 18px;
  background: #e4f1eb;
}

.redeem-existing p {
  color: var(--ink-soft);
}

.redeem-help {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.redeem-help h2 {
  font-size: 20px;
}

.redeem-help ul {
  display: grid;
  gap: 7px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 14px;
}

.status-card h1 {
  margin: 12px 0;
  font-size: clamp(30px, 5vw, 48px);
}

.status-card .secondary-button,
.status-card .primary-button {
  margin-top: 10px;
}

.status-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 22px;
  border: 4px solid rgba(27, 85, 93, 0.15);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.status-symbol {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4dbd4;
  color: var(--danger);
  font-size: 30px;
  font-weight: 800;
}

.order-number {
  margin-bottom: 0;
  color: var(--ink-soft);
  word-break: break-all;
  font-size: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.legal-page {
  width: min(760px, calc(100% - 32px));
  padding: 34px 0;
}

.legal-page h1 {
  margin: 25px 0 4px;
  font-size: 42px;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 24px;
}

.legal-meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.62);
  color: var(--ink-soft);
  font-size: 12px;
}

.legal-lead {
  padding: 18px 20px;
  border-left: 4px solid var(--gold);
  border-radius: 0 14px 14px 0;
  background: rgba(255, 247, 226, 0.72);
  color: var(--ink);
}

.legal-updated {
  color: var(--ink-soft);
  font-size: 13px;
}

.legal-page section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.legal-page h2 {
  font-size: 20px;
}

.legal-page p {
  color: var(--ink-soft);
}

.legal-page p,
.legal-page li {
  font-size: 15px;
}

.legal-list {
  display: grid;
  gap: 7px;
  padding-left: 24px;
  color: var(--ink-soft);
}

.legal-page a {
  font-weight: 650;
}

.back-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
}

/* Admin */
.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  width: min(440px, 100%);
  padding: 36px;
  border-radius: 28px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: 10px 0 4px;
  font-size: 36px;
}

.admin-login-card > p {
  color: var(--ink-soft);
}

.stack-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
}

.admin-page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 60px;
}

.admin-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-header-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

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

.small {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 13px;
  border-radius: 10px;
}

.admin-title {
  padding: 30px 0;
}

.admin-title h1 {
  margin: 8px 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.045em;
}

.admin-title p {
  color: var(--ink-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats-grid article {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.8);
}

.stats-grid span {
  color: var(--ink-soft);
  font-size: 13px;
}

.stats-grid strong {
  color: var(--teal);
  font-size: 31px;
}

.admin-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.9);
}

.admin-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.admin-panel h2 {
  margin: 0;
}

.code-create-form {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.7fr auto;
  gap: 10px;
  margin-top: 18px;
}

.code-create-form input {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefb;
}

.admin-panel-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  min-width: 260px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: var(--ink-soft);
  font-weight: 700;
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.status-paid { background: #dcefe6; color: #266047; }
.status-refunded { background: #f4ded8; color: #8d463c; }
.status-closed { background: #e8e5df; color: #635e56; }
.status-created,
.status-pending { background: #f8edcf; color: #815f25; }

.text-button {
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button.danger {
  color: var(--danger);
}

.empty-cell {
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
}

.two-column-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.distribution {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

.distribution span,
.source-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 105px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #edf2ed;
  font-size: 13px;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 15px;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
  }

  .header-note {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 20px;
  }

  .hero h1 {
    font-size: clamp(50px, 15vw, 72px);
  }

  .hero-visual {
    width: min(540px, 96%);
    margin: 0 auto;
  }

  .disclaimer-banner {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 55px;
  }

  .section-block {
    margin: 58px 0;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 185px;
  }

  .feature-card h3 {
    margin-top: 30px;
  }

  .grade-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .purchase-top {
    display: grid;
  }

  .price {
    margin-top: 10px;
  }

  .purchase-list {
    font-size: 14px;
  }

  .quiz-header {
    align-items: flex-start;
  }

  .quiz-stage {
    padding-top: 18px;
  }

  .question-card,
  .calc-card,
  .review-card {
    border-radius: 24px;
  }

  .option-card {
    padding: 15px 13px;
  }

  .input-grid,
  .calc-facts {
    grid-template-columns: 1fr;
  }

  .result-hero {
    min-height: 390px;
  }

  .result-title-row {
    display: grid;
  }

  .total-score {
    position: absolute;
    top: 28px;
    right: 24px;
    width: 88px;
    height: 88px;
  }

  .total-score strong {
    font-size: 32px;
  }

  .result-title-row > div:first-child {
    padding-right: 88px;
  }

  .result-portrait {
    bottom: -10px;
    width: 92%;
  }

  .radar-wrap {
    grid-template-columns: 1fr;
  }

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

  .save-card {
    grid-template-columns: 1fr;
  }

  .compact-disclaimer {
    grid-template-columns: 1fr;
  }

  .admin-header {
    align-items: flex-start;
    padding: 18px 0;
  }

  .admin-header-actions {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .code-create-form {
    grid-template-columns: 1fr;
  }

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

  .search-form input {
    min-width: 0;
  }

  .two-column-panel {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .channel-callout {
    grid-template-columns: 1fr;
  }

  .channel-callout a {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 390px) {
  .page-shell,
  .site-header,
  .site-footer {
    width: calc(100% - 24px);
  }

  .hero h1 {
    font-size: 49px;
  }

  .hero-meta span {
    font-size: 12px;
  }

  .floating-note {
    font-size: 11px;
    padding: 7px 10px;
  }

  .quiz-actions {
    grid-template-columns: 0.8fr 1.5fr;
  }

  .result-title-row h1 {
    font-size: 31px;
  }

  .result-title-row > div:first-child {
    padding-right: 74px;
  }

  .total-score {
    width: 76px;
    height: 76px;
  }

  .score-panel,
  .reading-card,
  .calculation-card,
  .save-card {
    padding: 20px;
    border-radius: 22px;
  }

  .large-copy {
    font-size: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
