:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eaf0f5;
  --surface-soft: #f8fafc;
  --line: #dbe3ec;
  --ink: #0e1a2b;
  --muted: #596b81;
  --accent: #f59e4a;
  --accent-end: #f2c46d;
  --accent-ink: #07111f;
  --accent-text: #974813;
  --accent-soft: #fff0dc;
  --accent-line: #f0cfaa;
  --cyan: #35c7e8;
  --blue: #176b88;
  --danger: #ab3e35;
  --success: #15734f;
  --shadow: 0 12px 36px rgba(14, 26, 43, .055);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.app-shell {
  position: relative;
  min-height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(var(--nav-height, 96px) + 24px);
  overflow: hidden;
}
.app-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -160px;
  right: -180px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(53, 199, 232, .12), transparent 68%);
  pointer-events: none;
}
.app-shell > * { position: relative; z-index: 1; }
.loading-screen { min-height: 70dvh; display: grid; place-content: center; gap: 16px; text-align: center; color: var(--muted); }
.loading-screen .brand-mark { margin: auto; width: 74px; height: 74px; font-size: 36px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand-mark { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 39px; height: 39px; border-radius: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-end)); color: var(--accent-ink); font-size: 19px; font-weight: 860; letter-spacing: -.08em; box-shadow: 0 6px 18px rgba(245, 158, 74, .16); }
.brand-slash { opacity: .62; margin-left: 1px; }
.brand-copy { min-width: 0; line-height: 1.15; }
.brand-copy strong { display: block; font-size: 14px; letter-spacing: -.02em; }
.brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.avatar { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-strong); color: var(--ink); font-weight: 800; }

.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 11px; font-weight: 800; line-height: 1.4; text-transform: uppercase; letter-spacing: .14em; }
.title { margin: 0; font-size: clamp(29px, 8vw, 42px); letter-spacing: -.055em; line-height: 1.06; font-weight: 820; }
.lead { margin: 14px 0 0; max-width: 530px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 28px 0 14px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.section-head span { font-size: 12px; color: var(--muted); }
.stack { display: grid; gap: 12px; }

.hero { position: relative; overflow: hidden; border: 1px solid #d6e5e9; border-radius: 27px; min-height: 250px; padding: 26px; background: linear-gradient(145deg, #ffffff 0%, #f0f8fb 64%, #fff4e7 100%); color: var(--ink); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 320px; height: 320px; top: -110px; right: -70px; border-radius: 50%; background: radial-gradient(circle, rgba(53, 199, 232, .1), transparent 72%); pointer-events: none; }
.hero .eyebrow { color: var(--blue); }
.hero h1 { position: relative; z-index: 1; max-width: 430px; margin: 0; font-size: clamp(29px, 8vw, 41px); line-height: 1.08; letter-spacing: -.055em; }
.hero p { position: relative; z-index: 1; max-width: 420px; }
.hero p:not(.eyebrow) { margin: 13px 0 23px; color: var(--muted); line-height: 1.45; font-size: 14px; }
.hero .btn { position: relative; z-index: 1; width: 100%; white-space: normal; }
.hero .btn > span { flex-shrink: 0; }

.card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.card-inner { padding: 19px; }
.mode-card { display: grid; grid-template-columns: 47px 1fr auto; align-items: center; gap: 13px; min-height: 94px; padding: 15px; text-align: left; color: inherit; width: 100%; }
.mode-card:hover, .answer-option:hover, .nav-item:hover { border-color: var(--blue); }
.mode-symbol { display: grid; place-content: center; width: 47px; height: 47px; border-radius: 14px; background: #dff3f8; color: var(--blue); font-size: 20px; font-weight: 800; }
.mode-symbol.blue { background: #e5edfd; color: #245a9e; }
.mode-symbol.gold { background: var(--accent-soft); color: var(--accent-text); }
.mode-card h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: -.02em; }
.mode-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.mode-card > span:nth-child(2) { min-width: 0; }
.mode-price { display: block; margin-top: 7px; color: var(--accent-text); font-size: 11px; line-height: 1.35; font-weight: 700; }
.mode-arrow { color: var(--muted); font-size: 23px; }
.mode-card.depth-card { grid-template-columns: minmax(0, 1fr) auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 760; white-space: nowrap; }
.pill.accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.pill.success { border-color: #b8dfc9; background: #e0f4e9; color: var(--success); }
.pill.blue { color: var(--blue); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.45; }
.strong { color: var(--ink); font-weight: 760; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 14px; min-height: 46px; padding: 12px 18px; font-size: 14px; line-height: 1.25; font-weight: 750; text-align: center; text-decoration: none; transition: transform .16s, background .16s, border-color .16s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(110deg, var(--accent), var(--accent-end)); color: var(--accent-ink); }
.btn.secondary { border-color: var(--line); background: var(--surface-strong); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.actions { display: grid; gap: 9px; margin-top: 20px; }
.actions.split { grid-template-columns: 1fr 1fr; }
.text-button { border: 0; background: none; padding: 7px 0; color: var(--blue); font-weight: 700; }

.metric-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--line); }
.metric { padding: 15px 12px; background: var(--surface); }
.metric strong { display: block; font-size: 21px; letter-spacing: -.04em; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.2; }

.page-heading { margin: 3px 0 22px; }
.page-heading h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -.05em; }
.page-heading p { margin: 10px 0 0; color: var(--muted); line-height: 1.45; font-size: 14px; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin: 7px 0 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .3s; }
.question-card { margin-top: 21px; padding: 22px; }
.question-card .pill { margin-bottom: 20px; }
.question-card h1 { margin: 0; font-size: clamp(20px, 5.8vw, 25px); line-height: 1.36; font-weight: 720; letter-spacing: -.025em; white-space: pre-wrap; overflow-wrap: anywhere; }
.question-hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.answer-list { display: grid; gap: 9px; margin-top: 17px; }
.answer-option { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; min-height: 62px; width: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 13px; color: var(--ink); text-align: left; font-size: 14px; line-height: 1.42; white-space: normal; overflow-wrap: anywhere; }
.answer-letter { display: grid; place-content: center; width: 33px; height: 33px; border-radius: 10px; background: var(--surface-strong); color: var(--muted); font-size: 12px; font-weight: 850; }
.answer-option:active .answer-letter { background: var(--accent); color: var(--accent-ink); }
.notice { margin-top: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.45; }

.reason-box { margin-top: 18px; width: 100%; min-height: 144px; padding: 16px; resize: vertical; outline: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); line-height: 1.5; }
.reason-box:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 199, 232, .12); }
.reason-box::placeholder { color: var(--muted); }
.feedback-heading { display: flex; gap: 12px; align-items: center; margin: 0 0 16px; }
.feedback-icon { display: grid; place-content: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px; background: #e0f4e9; color: var(--success); font-size: 21px; font-weight: 820; }
.feedback-icon.wrong { background: #fcebe8; color: var(--danger); }
.feedback-heading h1 { margin: 0; font-size: 26px; letter-spacing: -.045em; }
.feedback-block { border-top: 1px solid var(--line); padding: 15px 0; }
.feedback-block:first-child { border-top: 0; padding-top: 0; }
.feedback-label { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.feedback-block p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-link { display: inline-flex; margin-top: 4px; color: var(--blue); font-size: 12px; font-weight: 750; text-decoration: none; }

.score-card { display: flex; align-items: center; gap: 19px; padding: 21px; }
.score-ring { display: grid; place-content: center; width: 108px; height: 108px; flex: 0 0 108px; border-radius: 50%; background: conic-gradient(var(--blue) var(--score), var(--surface-strong) 0); }
.score-ring-inner { display: grid; place-content: center; width: 83px; height: 83px; border-radius: 50%; background: var(--surface); text-align: center; }
.score-ring-inner strong { font-size: 26px; letter-spacing: -.05em; line-height: 1; }
.score-ring-inner span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.score-copy h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: -.035em; }
.score-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.topic-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.topic-row:last-child { border-bottom: 0; }
.study-topic h3 { margin: 0; font-size: 15px; }
.study-topic ul { margin: 11px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.study-topic li + li { margin-top: 5px; }
.study-reading { display: grid; gap: 6px; margin-top: 13px; }
.study-reading .feedback-label { margin: 0; }
.study-reading .source-link { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.result-offer { margin-top: 20px; border-color: var(--accent-line); background: linear-gradient(145deg, var(--surface), #fff8ee); }
.result-offer h2 { margin: 13px 0 9px; font-size: 20px; line-height: 1.2; letter-spacing: -.03em; }
.result-offer p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.result-offer p.small { margin-bottom: 0; font-size: 12px; }
.review-item { padding: 16px; }
.review-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary strong { font-size: 13px; line-height: 1.3; }
.review-item summary span { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--muted); }
.review-item[open] summary { margin-bottom: 15px; }
.review-item .feedback-block { padding: 10px 0; }

.profile-hero { padding: 21px; }
.profile-hero h2 { margin: 6px 0 5px; font-size: 20px; letter-spacing: -.035em; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.profile-id { display: inline-block; margin-top: 16px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; }
.terms-box { max-height: 48dvh; overflow-y: auto; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); white-space: pre-wrap; font-size: 12px; line-height: 1.55; color: var(--muted); }
code { display: inline-block; max-width: 100%; vertical-align: baseline; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .88em; font-weight: 500; letter-spacing: 0; padding: .12em .3em; border-radius: 5px; background: var(--surface-strong); color: var(--blue); overflow-wrap: anywhere; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.question-card code { font-size: .82em; }
.answer-option > span:last-child { min-width: 0; }
.purchase-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 19px; }
.purchase-summary strong { font-size: 23px; color: var(--accent-text); }
.purchase-summary span { font-size: 14px; }
.purchase-summary small { display: block; margin-top: 5px; }
.purchase-summary strong { flex: 0 0 auto; }
.terms-document { display: grid; gap: 10px; margin-top: 18px; }
.terms-section { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 18px; }
.terms-section h2 { font-size: 15px; line-height: 1.3; margin: 0 0 9px; color: var(--ink); }
.terms-section p, .terms-paragraph { font-size: 14px; line-height: 1.6; margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.terms-paragraph { padding: 0 3px; font-size: 12px; }
.stars-help { margin-top: 16px; padding: 17px 18px; }
.stars-help summary { cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 700; }
.stars-help p { font-size: 13px; line-height: 1.55; color: var(--muted); }
.check-row { display: flex; align-items: start; gap: 11px; margin: 18px 0; font-size: 13px; line-height: 1.4; }
.check-row input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; accent-color: var(--blue); }

.bottom-nav { position: fixed; z-index: 9; bottom: 0; left: 50%; width: min(100%, 640px); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.nav-item { display: grid; justify-items: center; gap: 4px; border: 1px solid transparent; border-radius: 12px; background: transparent; padding: 8px 3px; color: var(--muted); font-size: 10px; font-weight: 730; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-icon { display: inline-flex; width: 20px; height: 20px; }
.nav-icon svg { width: 100%; height: 100%; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--nav-height, 96px) + 12px); width: min(calc(100% - 32px), 570px); transform: translateX(-50%); padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); color: var(--ink); box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; }
.toast p { margin: 0; }
.toast .btn { margin-top: 12px; }
.modal-scrim { position: fixed; z-index: 20; inset: 0; display: grid; align-items: end; background: rgba(1, 9, 20, .72); }
.modal { max-width: 640px; width: 100%; margin: 0 auto; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border: 1px solid var(--line); background: var(--surface); }
.modal h2 { margin: 0 0 10px; font-size: 21px; }
.modal p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.modal .actions { margin-top: 22px; }
.empty { padding: 32px 20px; text-align: center; }
.empty h2 { margin: 0 0 9px; font-size: 22px; }
.empty p { margin: 0; color: var(--muted); line-height: 1.5; }

@media (min-width: 560px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
  .hero { min-height: 272px; padding: 31px; }
  .stack.mode-grid { grid-template-columns: 1fr 1fr; }
  .mode-card { grid-template-columns: 45px 1fr; align-items: start; min-height: 145px; }
  .mode-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
