/* ---------- tokens ---------- */
:root {
  --bg: #f5f6fb;
  --bg-2: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e8f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --brand-soft: #eef0ff;
  --brand-line: #c7cbff;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --bad: #e11d48;
  --bad-soft: #fff0f3;
  --amber: #f59e0b;
  --paper: #ffffff;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05), 0 1px 3px rgb(15 23 42 / 0.06);
  --shadow: 0 2px 4px rgb(15 23 42 / 0.04), 0 8px 24px rgb(15 23 42 / 0.07);
  --shadow-lg: 0 12px 40px rgb(15 23 42 / 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: 'Pretendard Variable', Pretendard, 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'WenQuanYi Zen Hei', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-2: #0f1529;
    --surface: #141b31;
    --surface-2: #1a2240;
    --ink: #e8ecf8;
    --ink-2: #c3cbe0;
    --muted: #8b95b2;
    --line: #26304f;
    --brand: #818cf8;
    --brand-2: #a78bfa;
    --brand-ink: #0b1020;
    --brand-soft: #1e2550;
    --brand-line: #3c4693;
    --ok: #34d399;
    --ok-soft: #0f2e2a;
    --bad: #fb7185;
    --bad-soft: #351722;
    --paper: #f8fafc;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.55);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body {
  min-height: 100vh; font-family: var(--font); color: var(--ink); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; }
button { font: inherit; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.ic { flex: none; }
.view { animation: fade-in 0.35s var(--ease); }
.hide-sm { display: inline; }

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide-fwd { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(0.97); } 100% { transform: scale(1); } }
@keyframes wave { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes ring-fill { to { stroke-dashoffset: var(--off); } }
@keyframes grow { from { width: 0; } to { width: var(--w); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(79 70 229 / 0.45); } 100% { box-shadow: 0 0 0 16px rgb(79 70 229 / 0); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 46px; padding: 0.55rem 1.1rem; border-radius: 14px; border: 1px solid transparent;
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 0.97rem; text-decoration: none; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 16px -6px rgb(79 70 229 / 0.6);
}
.btn.primary:hover { box-shadow: 0 10px 22px -8px rgb(79 70 229 / 0.7); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.glass { background: rgb(255 255 255 / 0.16); color: #fff; border-color: rgb(255 255 255 / 0.3); backdrop-filter: blur(8px); }
.btn.sm { min-height: 38px; padding: 0.35rem 0.85rem; font-size: 0.88rem; border-radius: 12px; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg-2); }
.link-btn { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.8rem; padding: 0.3rem 0; border: 0; background: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.link-btn:hover { color: var(--bad); }
:is(.btn, .icon-btn, .opt, .pal, .pill, .play, .link-btn):focus-visible { outline: 3px solid var(--brand-line); outline-offset: 2px; }

/* ---------- home / landing ---------- */
.topnav {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, #3b2fc9 70%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid rgb(255 255 255 / 0.12);
}
.topnav-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 16px; color: #fff; }
.topnav .brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; text-decoration: none; letter-spacing: -0.01em; }
.topnav .brand img { border-radius: 10px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.2); }
.topnav-links { flex: 1; display: flex; justify-content: flex-end; gap: 0.15rem; }
.topnav-links button { border: 0; background: none; color: rgb(255 255 255 / 0.85); font-weight: 600; padding: 0.45rem 0.65rem; border-radius: 10px; cursor: pointer; }
.topnav-links button:hover { background: rgb(255 255 255 / 0.12); color: #fff; }
.topnav .btn.primary { background: #fff; color: #4338ca; box-shadow: none; }

.hero {
  position: relative; overflow: hidden; color: #fff; padding: 2.5rem 16px 6rem;
  background:
    radial-gradient(900px 420px at 105% -10%, rgb(236 72 153 / 0.5), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgb(14 165 233 / 0.45), transparent 60%),
    linear-gradient(135deg, #3b2fc9, #6d28d9);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.25;
  background-image: radial-gradient(rgb(255 255 255 / 0.35) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.hero-inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1.1fr 0.9fr; }
.hero-copy { display: grid; gap: 1rem; justify-items: start; }
.social {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.85rem 0.35rem 0.6rem; border-radius: 99px;
  background: rgb(255 255 255 / 0.14); border: 1px solid rgb(255 255 255 / 0.25); font-size: 0.85rem; font-weight: 600; text-decoration: none; backdrop-filter: blur(6px);
}
.social .ic { width: 17px; height: 17px; }
.hero h1 { margin: 0; font-size: clamp(2rem, 5.5vw, 3.3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; max-width: 15ch; }
.lead { margin: 0; font-size: 1.08rem; opacity: 0.9; max-width: 48ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }
.btn.lg { min-height: 54px; padding: 0.7rem 1.35rem; font-size: 1.02rem; border-radius: 16px; }
.btn.white { background: #fff; color: #3b2fc9; box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.45); }
.btn.white:hover { box-shadow: 0 14px 34px -10px rgb(0 0 0 / 0.55); }
.free-line { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.9rem; opacity: 0.9; }
.free-line .ic { width: 17px; height: 17px; color: #fde68a; }

/* hero phone mock */
.mock {
  position: relative; justify-self: center; width: min(340px, 100%); padding: 1rem; border-radius: 28px; color: var(--ink);
  background: var(--surface); box-shadow: 0 30px 80px -20px rgb(15 23 42 / 0.6), 0 0 0 8px rgb(255 255 255 / 0.12);
  transform: rotate(2deg); animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-10px); } }
.mock-bar { display: flex; justify-content: space-between; align-items: center; }
.mock-timer { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.6rem; border-radius: 10px; background: var(--bg-2); font-weight: 800; font-size: 0.85rem; }
.mock-timer .ic { width: 15px; height: 15px; color: var(--muted); }
.mock-q { display: flex; gap: 0.6rem; align-items: center; margin: 0.9rem 0 0.7rem; font-weight: 700; font-size: 0.92rem; }
.mock-q .qno { min-width: 32px; height: 32px; font-size: 0.9rem; border-radius: 10px; }
.mock-player { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem; border-radius: 14px; background: var(--brand-soft); }
.mock-player .play { width: 40px; height: 40px; }
.mock-player .play .ic { width: 16px; height: 16px; }
.mock-player .wave { height: 22px; }
.mock-player .wave i { opacity: 0.9; animation: wave 1s ease-in-out infinite; }
.mock-player .wave i:nth-child(3n) { animation-delay: -0.3s; }
.mock-player .wave i:nth-child(3n + 1) { animation-delay: -0.6s; }
.mock-opts { display: grid; gap: 0.45rem; margin-top: 0.75rem; }
.mock-opts span { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 12px; border: 1.5px solid var(--line); font-size: 0.9rem; }
.mock-opts b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--brand-line); color: var(--brand); font-size: 0.78rem; }
.mock-opts .on { border-color: var(--ok); background: var(--ok-soft); }
.mock-opts .on b { background: var(--ok); border-color: var(--ok); color: #fff; }
.mock-float {
  position: absolute; left: -18px; bottom: -16px; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.85rem; border-radius: 14px;
  background: var(--surface); color: var(--ok); font-weight: 800; box-shadow: var(--shadow-lg); transform: rotate(-4deg);
}

.home { max-width: 1080px; margin: -3.5rem auto 0; padding: 0 16px 2rem; position: relative; z-index: 2; }
.statband {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; padding: 1.1rem; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.statband div { display: grid; justify-items: center; text-align: center; gap: 0.1rem; padding: 0.3rem; }
.statband b { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statband span { color: var(--muted); font-size: 0.8rem; font-weight: 600; line-height: 1.35; }
.block { margin-top: 4rem; scroll-margin-top: 70px; }
.h2 { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 800; letter-spacing: -0.03em; text-align: center; }
.sub { margin: 0.5rem auto 1.6rem; color: var(--muted); text-align: center; max-width: 52ch; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.feature {
  padding: 1.3rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature > .ic { width: 44px; height: 44px; padding: 10px; border-radius: 14px; color: #fff; background: var(--grad); box-shadow: 0 8px 18px -8px rgb(79 70 229 / 0.7); }
.feature h3 { margin: 0.9rem 0 0.3rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.steps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; counter-reset: s; }
.steps li { display: flex; gap: 0.9rem; padding: 1.2rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.step-no { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 1.1rem; }
.steps h3 { margin: 0.1rem 0 0.25rem; font-size: 1.02rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; margin-bottom: 0.9rem; }
.mode { display: flex; gap: 0.8rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.mode > .ic { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.mode p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.cards { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card.set {
  display: grid; gap: 0.9rem; padding: 1.1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: fade-in 0.4s var(--ease) both; animation-delay: calc(var(--i) * 60ms);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.card.set:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card.set.locked .set-badge { background: var(--bg-2); color: var(--muted); }
.set-top { display: flex; align-items: center; gap: 0.8rem; }
.set-badge { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; font-weight: 800; color: #fff; background: var(--grad); }
.set-title { flex: 1; min-width: 0; }
.set-title h3 { margin: 0; font-size: 1.05rem; }
.set-title p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.set-score { text-align: right; line-height: 1.1; }
.set-score b { font-size: 1.35rem; color: var(--brand); }
.set-score small { display: block; color: var(--muted); font-size: 0.75rem; }
.tag { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.75rem; font-weight: 800; flex: none; }
.tag .ic { width: 13px; height: 13px; }
.tag.free { background: var(--ok-soft); color: var(--ok); }
.tag.pro { background: #fef3c7; color: #92400e; }
.set-progress { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.set-progress i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: inherit; }
.hint { margin: -0.5rem 0 0; color: var(--muted); font-size: 0.82rem; }
.set-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.set-actions .btn { flex: 1 1 auto; }

/* pricing */
.seg.big { width: max-content; margin: 0 auto 1.4rem; padding: 4px; border-radius: 14px; }
.seg.big button { border: 0; background: none; padding: 0.55rem 1.1rem; border-radius: 11px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg.big button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; align-items: stretch; }
.plans.two { grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; }
.plans[hidden] { display: none; }
.plan {
  position: relative; display: flex; flex-direction: column; padding: 1.4rem 1.2rem 1.2rem; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); animation: fade-in 0.35s var(--ease);
}
.plan.hot {
  border: 2px solid transparent; box-shadow: 0 20px 50px -20px rgb(79 70 229 / 0.55);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
}
.plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  padding: 0.25rem 0.8rem; border-radius: 99px; background: var(--grad); color: #fff; font-size: 0.78rem; font-weight: 800; box-shadow: 0 6px 14px -6px rgb(79 70 229 / 0.7);
}
.plan-badge .ic { width: 13px; height: 13px; color: #fde68a; }
.plan h3 { margin: 0; font-size: 1rem; color: var(--ink-2); }
.price { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.6rem; }
.price b { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.price s { color: var(--muted); font-size: 0.95rem; }
.per { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.per em { font-style: normal; color: var(--ok); font-weight: 800; }
.perday { margin: 0.6rem 0 0; padding: 0.35rem 0.6rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 0.82rem; font-weight: 700; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.2rem; display: grid; align-content: start; gap: 0.55rem; flex: 1; }
.plan li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.92rem; color: var(--ink-2); }
.plan li .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }
.plan .btn { width: 100%; }
.plan.free { background: var(--surface-2); }
.compare, .how-pay { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 1.2rem auto 0; max-width: 60ch; text-align: center; color: var(--ink-2); font-weight: 600; }
.how-pay { margin-top: 0.5rem; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.compare .ic { color: var(--amber); }

/* faq + final */
.faq { display: grid; gap: 0.6rem; max-width: 760px; margin: 1.4rem auto 0; }
.faq details { padding: 0 1.1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform 0.25s var(--ease); color: var(--muted); }
.faq details[open] summary .ic { transform: rotate(90deg); }
.faq details p { margin: 0 0 1rem; color: var(--muted); }
.final {
  margin-top: 4rem; padding: 2.6rem 1.4rem; border-radius: 28px; text-align: center; color: #fff;
  background: radial-gradient(600px 300px at 100% 0, rgb(236 72 153 / 0.45), transparent 60%), linear-gradient(135deg, #3b2fc9, #6d28d9);
  box-shadow: 0 24px 60px -24px rgb(79 70 229 / 0.7);
}
.final h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; }
.final p { margin: 0.5rem 0 1.3rem; opacity: 0.9; }
.foot { margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: 0.82rem; }
.foot a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.foot .foot-links a { font-weight: 600; font-size: 0.82rem; color: var(--muted); text-decoration: underline; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .mock { margin-top: 0.5rem; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hero { padding-top: 1.8rem; }
  .statband { grid-template-columns: repeat(2, 1fr); }
  .features, .steps, .plans, .plans.two { grid-template-columns: 1fr; }
  .mock-float { left: -6px; }
  .plan.hot { order: -1; margin-top: 0.6rem; }
  .topnav-links button { padding: 0.45rem 0.45rem; font-size: 0.9rem; }
}

/* ---------- exam chrome ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; }
.bar-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; flex: none; padding: 0.22rem 0.65rem; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand); font-size: 0.8rem; font-weight: 700;
}
.chip .ic { width: 15px; height: 15px; }
.chip.soft { background: var(--bg-2); color: var(--ink-2); }
.timer {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem; border-radius: 12px;
  background: var(--bg-2); font-weight: 800; font-variant-numeric: tabular-nums; transition: background 0.3s, color 0.3s;
}
.timer .ic { width: 17px; height: 17px; color: var(--muted); }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.timer.low .ic { color: var(--bad); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.4s var(--ease); }
.qpane { max-width: 820px; margin: 0 auto; padding: 1rem 12px 8rem; }
.nav {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 0.5rem; width: min(560px, calc(100% - 24px)); padding: 0.45rem;
  border-radius: 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.nav .btn { flex: 1; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 46px; padding: 0 1rem; border-radius: 14px;
  border: 0; background: var(--bg-2); color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap;
}

/* palette bottom sheet */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(15 23 42 / 0); transition: background 0.2s;
}
.sheet-wrap.open { background: rgb(15 23 42 / 0.4); }
.sheet-wrap[hidden] { display: none; }
.sheet {
  width: min(640px, 100%); max-height: 78vh; overflow: auto; padding: 0.6rem 16px calc(1.2rem + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform 0.28s var(--ease);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet::before { content: ''; display: block; width: 44px; height: 5px; margin: 0 auto 0.5rem; border-radius: 99px; background: var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.pal-label { display: flex; align-items: center; gap: 0.4rem; margin: 0.9rem 0 0.5rem; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.pal-label .ic { width: 16px; height: 16px; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; }
.pal {
  min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-weight: 700; cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s;
}
.pal:active { transform: scale(0.94); }
.pal.done { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.pal.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.pal.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.pal.cur { outline: 2.5px solid var(--brand); outline-offset: 1px; }

/* ---------- question card ---------- */
.qcard {
  padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.qcard.enter-fwd { animation: slide-fwd 0.32s var(--ease); }
.qcard.enter-back { animation: slide-back 0.32s var(--ease); }
.group { display: flex; gap: 0.6rem; align-items: baseline; margin: 0; color: var(--ink-2); font-weight: 600; font-size: 0.95rem; }
.range {
  flex: none; padding: 0.1rem 0.55rem; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 0.8rem; font-weight: 800;
}
.qhead { display: flex; gap: 0.7rem; align-items: flex-start; margin: 1.1rem 0 0.8rem; font-size: 1.15rem; font-weight: 700; }
.qno {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 0.4rem; border-radius: 12px; flex: none;
  background: var(--grad); color: #fff; font-size: 1rem; font-weight: 800;
}
.qhead span:not(.qno) { padding-top: 0.35rem; }
.passage {
  padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line);
  font-size: 1.08rem; line-height: 1.85;
}
.passage.word { text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.04em; padding: 1.3rem; }
.blank { display: inline-block; width: 5.5em; height: 1.1em; margin: 0 0.25em; vertical-align: -0.2em; border-bottom: 2.5px solid var(--brand); background: var(--brand-soft); border-radius: 4px 4px 0 0; }
.pic { display: flex; justify-content: center; margin: 1rem 0; }
.pic img { max-width: 100%; max-height: 300px; height: auto; border-radius: var(--radius-sm); background: var(--paper); }
.pic-svg svg { width: 100%; max-width: 440px; height: auto; max-height: 340px; border-radius: var(--radius-sm); background: var(--paper); }
.pic-pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  width: 100%; max-width: 280px; aspect-ratio: 4 / 3; padding: 0.5rem; border-radius: var(--radius-sm);
  background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 10px, var(--bg-2) 10px, var(--bg-2) 20px);
  border: 1.5px dashed var(--line); color: var(--muted); font-size: 0.78rem; text-align: center;
}
.pic-pending .ko { font-size: 1.1rem; font-weight: 800; color: var(--ink-2); }

/* audio player */
.player {
  display: flex; align-items: center; gap: 0.9rem; margin: 1rem 0; padding: 0.7rem 0.9rem 0.7rem 0.7rem;
  border-radius: 16px; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--surface)));
  border: 1px solid var(--brand-line);
}
.play {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: var(--grad); box-shadow: 0 6px 16px -6px rgb(79 70 229 / 0.7);
  transition: transform 0.15s var(--ease);
}
.play:active { transform: scale(0.94); }
.play:disabled { opacity: 0.55; cursor: default; }
.player.playing .play { animation: pulse 1.4s infinite; }
.wave { display: flex; align-items: center; gap: 3px; height: 28px; flex: 1; max-width: 160px; }
.wave i { flex: 1; height: 100%; border-radius: 3px; background: var(--brand); opacity: 0.35; transform: scaleY(0.3); }
.player.playing .wave i { opacity: 0.9; animation: wave 1s ease-in-out infinite; }
.player.playing .wave i:nth-child(3n) { animation-delay: -0.3s; }
.player.playing .wave i:nth-child(3n + 1) { animation-delay: -0.6s; }
.player.playing .wave i:nth-child(4n) { animation-duration: 0.8s; }
.player-status { flex: 1; color: var(--ink-2); font-size: 0.85rem; font-weight: 600; }

/* options */
.opts { display: grid; gap: 0.6rem; margin-top: 1rem; }
.opts-img { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  position: relative; display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 56px; padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 1.05rem; text-align: left; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease), box-shadow 0.2s;
  animation: fade-in 0.35s var(--ease) both; animation-delay: calc(var(--i) * 40ms);
}
.opt:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.opt:active { transform: scale(0.985); }
.opt-no {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--brand-line); color: var(--brand); font-size: 0.95rem; font-weight: 800; transition: all 0.2s;
}
.opt-text { flex: 1; }
.opt u { text-decoration-color: var(--brand); text-decoration-thickness: 2.5px; text-underline-offset: 5px; }
.opt.chosen { border-color: var(--brand); background: var(--brand-soft); animation: pop 0.25s var(--ease); }
.opt.chosen .opt-no { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.speaking { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 40%, transparent); border-color: var(--amber); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .opt-no { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .opt-no { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt-mark { color: var(--ok); margin-left: auto; }
.opts-img .opt { flex-direction: column; align-items: stretch; gap: 0.4rem; padding: 0.5rem; }
.opts-img .opt-no { position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--surface); width: 30px; height: 30px; }
.opts-img .opt-mark { position: absolute; top: 10px; right: 10px; }
.opts-img .pic { margin: 0; }
.opts-img .pic-svg svg { max-height: none; }
.opts-img .pic-pending { max-width: none; }

/* feedback + panels */
.feedback {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 1.1rem; padding: 0.8rem 1rem; border-radius: 14px; font-weight: 700;
  animation: fade-in 0.3s var(--ease);
}
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.panel { margin-top: 0.75rem; padding: 0.9rem 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); animation: fade-in 0.35s var(--ease); }
.panel h4 { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.92rem; }
.panel h4 .ic { color: var(--amber); }
.explain p { margin: 0.4rem 0 0; color: var(--ink-2); }
.vocab dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.4rem; margin: 0.6rem 0 0; }
.vocab dl div { padding: 0.45rem 0.65rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.vocab dt { font-weight: 800; }
.vocab dd { margin: 0; color: var(--muted); font-size: 0.85rem; }
.script summary { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; font-weight: 700; font-size: 0.92rem; list-style: none; }
.script summary::-webkit-details-marker { display: none; }
.script summary .ic { width: 18px; height: 18px; color: var(--brand); }
.script ul { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.script li { display: flex; gap: 0.6rem; align-items: baseline; }
.spk { display: inline-grid; place-items: center; min-width: 28px; height: 24px; border-radius: 8px; font-size: 0.78rem; font-weight: 800; flex: none; }
.spk.M { background: #e0f2fe; color: #0369a1; }
.spk.F { background: #fce7f3; color: #be185d; }
.spk.o { background: var(--brand-soft); color: var(--brand); }

/* ---------- dialogs + toast ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgb(15 23 42 / 0.45); backdrop-filter: blur(4px); animation: fade-in 0.2s;
}
.modal-wrap.leaving { opacity: 0; transition: opacity 0.18s; }
.modal {
  width: min(420px, 100%); padding: 1.4rem; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg);
  animation: fade-in 0.25s var(--ease);
}
.modal h3 { margin: 0; font-size: 1.15rem; }
.modal p { margin: 0.5rem 0 0; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.3rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 0.75rem 1.1rem; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.92rem; box-shadow: var(--shadow-lg); animation: fade-in 0.25s var(--ease);
}
.toast.leaving { opacity: 0; transition: opacity 0.3s; }

/* ---------- result ---------- */
.result-view { min-height: 100vh; background: radial-gradient(700px 420px at 50% -10%, var(--brand-soft), transparent 70%); }
.result { max-width: 560px; margin: 0 auto; padding: 2.5rem 16px 3rem; text-align: center; }
.eyebrow { margin: 0; color: var(--brand); font-weight: 700; font-size: 0.9rem; }
.result h1 { margin: 0.3rem 0 1.2rem; font-size: 1.8rem; }
.score-ring { position: relative; display: grid; place-items: center; width: 180px; height: 180px; margin: 0 auto; }
.ring { position: absolute; inset: 0; }
.ring-bg { fill: none; stroke: var(--bg-2); }
.ring-fg { fill: none; stroke: var(--brand); stroke-linecap: round; animation: ring-fill 1.2s var(--ease) 0.2s forwards; }
.score b { display: block; font-size: 3.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.score small { color: var(--muted); font-weight: 600; }
.msg { margin: 1.1rem 0 0; font-weight: 700; color: var(--ink-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1.5rem 0 1rem; text-align: left; }
.stat { display: grid; gap: 0.5rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat > .ic { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.stat span { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat b { font-size: 1.5rem; }
.stat b small { color: var(--muted); font-size: 0.9rem; }
.meter { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); animation: grow 1s var(--ease) 0.3s forwards; }
.note { color: var(--muted); font-size: 0.85rem; }
.result-actions { display: grid; gap: 0.6rem; margin-top: 1.5rem; }

/* ---------- review ---------- */
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--bg-2); }
.seg a { padding: 0.4rem 0.8rem; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 0.88rem; color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.review { max-width: 820px; margin: 0 auto; padding: 1rem 12px 3rem; display: grid; gap: 1rem; }
.rcard { position: relative; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.status {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-bottom: 0.8rem; padding: 0.2rem 0.65rem; border-radius: 99px; font-size: 0.8rem; font-weight: 800;
}
.status .ic { width: 15px; height: 15px; }
.rcard.ok .status { background: var(--ok-soft); color: var(--ok); }
.rcard.bad .status { background: var(--bad-soft); color: var(--bad); }
.rcard .btn.sm { margin-top: 0.6rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; }

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .bar-title { display: none; }
  .qcard, .rcard { padding: 1rem 0.85rem; border-radius: 16px; }
  .qhead { font-size: 1.05rem; }
  .opt { font-size: 1rem; padding: 0.6rem 0.75rem; }
  .opts-img { gap: 0.5rem; }
  .split { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ring-fg { stroke-dashoffset: var(--off); }
  .meter i { width: var(--w); }
}

/* currency switch + payment methods */
.pricing-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem; margin-bottom: 1.4rem; }
.pricing-controls .seg.big { margin: 0; }
.seg.cur { padding: 4px; border-radius: 14px; }
.seg.cur button { border: 0; background: none; padding: 0.5rem 0.8rem; border-radius: 11px; font-weight: 700; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.seg.cur button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pay-methods { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; margin-top: 1.2rem; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.pay { padding: 0.3rem 0.7rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- auth, payment, account ---------- */
.modal.wide { position: relative; width: min(460px, 100%); }
.modal-x { position: absolute; top: 10px; right: 10px; }
.field {
  width: 100%; margin-top: 0.8rem; padding: 0.75rem 0.9rem; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; resize: vertical;
}
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field.code { letter-spacing: 0.4em; text-align: center; font-size: 1.3rem; font-weight: 800; }
.auth-form { display: grid; gap: 0.6rem; }
.auth-form .btn { width: 100%; }
.btn.google { width: 100%; margin-top: 1rem; border: 1.5px solid var(--line); background: var(--surface); }
.or { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0 0.2rem; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #4338ca;
  font-weight: 800; text-decoration: none; box-shadow: 0 4px 12px rgb(0 0 0 / 0.2);
}
.methods { display: grid; gap: 0.55rem; margin-top: 1rem; }
.method {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.1rem 0.6rem; padding: 0.85rem 1rem; text-align: left;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.method:hover { border-color: var(--brand); background: var(--brand-soft); }
.method b { grid-column: 1; }
.method span { grid-column: 1; color: var(--muted); font-size: 0.82rem; }
.method .ic { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); }
.method:disabled { opacity: 0.6; cursor: wait; }
.pay-details { white-space: pre-wrap; margin: 0.8rem 0 0; padding: 0.8rem; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); font: inherit; font-size: 0.92rem; }
.pay-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%; }
.pay-icon .ic { width: 42px; height: 42px; }
.pay-icon.ok { background: var(--ok-soft); color: var(--ok); }
.pay-icon.bad { background: var(--bad-soft); color: var(--bad); }
.pay-icon.wait { background: var(--brand-soft); color: var(--brand); }
.acc-email { margin: 0.2rem 0 0; font-size: 1.3rem; word-break: break-all; }
.list { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.5rem; }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.list li span { color: var(--muted); font-size: 0.88rem; }
.list li .tag { margin-left: auto; }
.tag.off { background: var(--bg-2); color: var(--muted); }
