:root {
  --green-950: #0b2e25;
  --green-900: #123f32;
  --green-700: #23624f;
  --green-100: #dfeee8;
  --gold: #d6ad3c;
  --gold-soft: #f4e8bd;
  --ink: #18231f;
  --muted: #62706b;
  --paper: #ffffff;
  --canvas: #f5f6f2;
  --line: #dfe5e1;
  --danger: #a53a36;
  --success: #227250;
  --shadow: 0 18px 50px rgba(11, 46, 37, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(214,173,60,.18), transparent 30rem),
    linear-gradient(180deg, #fbfcf9 0%, var(--canvas) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button, label, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(214, 173, 60, .65);
  outline-offset: 3px;
}
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 4rem);
  color: white;
  background: var(--green-900);
  border-bottom: 3px solid var(--gold);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; letter-spacing: .08em; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1.5px solid var(--gold); border-radius: 12px; color: var(--gold);
  font: 700 1.45rem/1 Georgia, serif;
}
.brand strong { display: block; font: 700 1.08rem/1.1 Georgia, serif; }
.brand small { display: block; margin-top: .25rem; color: #dbe7e1; font-size: .62rem; letter-spacing: .17em; }
.top-status { display: flex; align-items: center; gap: 1rem; font-size: .82rem; color: #dbe7e1; }
.timer { min-width: 64px; color: white; border: 1px solid rgba(255,255,255,.24); border-radius: 99px; padding: .28rem .65rem; text-align: center; font-variant-numeric: tabular-nums; }
.progress-shell { height: 5px; background: #d9e4df; position: sticky; top: 0; z-index: 10; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #f0cd6a); transition: width .35s ease; }

main { width: min(1040px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 0 4rem; }
.hero { display: grid; grid-template-columns: 1.18fr .82fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; min-height: min(690px, calc(100vh - 145px)); }
.eyebrow { margin: 0 0 .85rem; color: var(--green-700); font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .16em; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--green-950); }
h1 { margin: 0; font-size: clamp(2.45rem, 6vw, 5rem); line-height: .98; letter-spacing: -.045em; }
h1 span { color: var(--green-700); }
.lede { max-width: 40rem; margin: 1.4rem 0 1.75rem; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.22rem); }
.trust-row { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.35rem 0 0; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .72rem; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.7); color: #42534c; font-size: .83rem; }
.pill::before { content: "✓"; color: var(--success); font-weight: 800; }
.hero-card { position: relative; overflow: hidden; border-radius: 30px; padding: 2rem; color: white; background: var(--green-900); box-shadow: var(--shadow); }
.hero-card::after { content: "L"; position: absolute; right: -1.4rem; bottom: -5.7rem; color: rgba(255,255,255,.055); font: 700 18rem/1 Georgia,serif; }
.hero-card h2 { margin: 0 0 1.2rem; color: white; font-size: 1.6rem; }
.skill-list { position: relative; z-index: 1; display: grid; gap: .85rem; }
.skill-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: .8rem; padding: .9rem; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.06); }
.skill-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--green-950); background: var(--gold); font-weight: 900; }
.skill-row b { display: block; font-size: .92rem; }
.skill-row small { color: #bed1c9; }
.skill-row > small { color: white; }

.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; border-radius: 12px; padding: .8rem 1.15rem; font-weight: 750; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--green-700); box-shadow: 0 8px 24px rgba(35,98,79,.2); }
.btn-primary:hover { background: var(--green-900); }
.btn-gold { color: var(--green-950); background: var(--gold); box-shadow: 0 8px 24px rgba(214,173,60,.18); }
.btn-secondary { color: var(--green-900); background: white; border: 1px solid var(--line); }
.btn-ghost { color: var(--green-700); background: transparent; }
.btn[disabled] { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }

.test-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; align-items: start; }
.stepper { position: sticky; top: 2rem; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 18px; padding: .7rem; backdrop-filter: blur(12px); }
.stepper-item { display: flex; gap: .65rem; align-items: center; padding: .75rem; color: #7a8681; border-radius: 12px; font-size: .83rem; }
.stepper-item span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #cfd8d3; border-radius: 50%; font-weight: 800; }
.stepper-item.active { color: var(--green-900); background: var(--green-100); font-weight: 750; }
.stepper-item.active span { color: white; background: var(--green-700); border-color: var(--green-700); }
.stepper-item.done { color: var(--green-700); }
.stepper-item.done span { color: var(--green-900); background: var(--gold-soft); border-color: var(--gold); }
.assessment { min-width: 0; }
.section-head { margin-bottom: 1.4rem; }
.section-head h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.section-head p { max-width: 46rem; margin: .8rem 0 0; color: var(--muted); }
.time-note { display: inline-flex; gap: .45rem; align-items: center; margin-top: .8rem; color: var(--green-700); font-weight: 700; font-size: .84rem; }

.card { margin-bottom: 1rem; padding: clamp(1.15rem, 3vw, 1.65rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 9px 28px rgba(11,46,37,.045); }
.card h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.card-intro { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; }
.level-tag { display: inline-flex; margin-bottom: .7rem; padding: .24rem .55rem; border-radius: 7px; color: var(--green-900); background: var(--gold-soft); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #34463f; font-size: .86rem; font-weight: 750; }
.field input, .field textarea, textarea.response {
  width: 100%; border: 1px solid #ccd7d1; border-radius: 12px; padding: .8rem .9rem; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, textarea.response:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(35,98,79,.11); outline: 0; }
.privacy-note { display: flex; gap: .65rem; align-items: flex-start; margin-top: 1rem; padding: .8rem; border-radius: 12px; color: #53635d; background: #f0f5f2; font-size: .82rem; }

.audio-panel { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.25rem; padding: 1rem; border-radius: 15px; color: white; background: var(--green-900); }
.audio-main { flex: 1; min-width: 0; }
.audio-main strong { display: block; }
.audio-main small { display: block; color: #c7d9d1; }
.listen-count { white-space: nowrap; color: var(--gold-soft); font-size: .78rem; }
.audio-btn { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; color: var(--green-950); background: var(--gold); cursor: pointer; font-size: 1.1rem; }
.audio-btn.playing { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(214,173,60,.15); } }

.question { margin: 1.15rem 0; padding-top: 1.15rem; border-top: 1px solid #edf0ee; }
.question:first-of-type { border-top: 0; }
.question legend { width: 100%; margin-bottom: .7rem; padding: 0; font-weight: 760; }
.options { display: grid; gap: .55rem; }
.option { position: relative; display: flex; align-items: flex-start; gap: .75rem; padding: .78rem .9rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: background .15s, border .15s; }
.option:hover { background: #f7faf8; border-color: #b9c9c2; }
.option:has(input:checked) { color: var(--green-950); background: var(--green-100); border-color: var(--green-700); }
.option input { margin-top: .25rem; accent-color: var(--green-700); }
.reading-text { margin: 1rem 0 1.3rem; padding: clamp(1rem, 3vw, 1.4rem); border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; color: #2e3e38; background: #f8faf7; }
.reading-text p { margin: .2rem 0 .7rem; }
.reading-text p:last-child { margin-bottom: .2rem; }
.word-tools { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; color: var(--muted); font-size: .78rem; }
.word-count.ok { color: var(--success); font-weight: 800; }
.prompt-box { margin: .8rem 0; padding: 1rem; border-radius: 14px; background: var(--green-100); }
.prompt-box strong { color: var(--green-900); }
textarea.response { min-height: 180px; resize: vertical; line-height: 1.65; }

.record-panel { margin-top: 1rem; padding: 1rem; border: 1px dashed #b8c8c1; border-radius: 15px; background: #fbfcfa; }
.record-controls { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.record-status { color: var(--muted); font-size: .84rem; }
.record-status.live { color: var(--danger); font-weight: 800; }
.transcript { margin-top: .9rem; }
.transcript textarea { min-height: 105px; }
.micro-note { margin: .65rem 0 0; color: var(--muted); font-size: .78rem; }
.nav-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

.result-hero { overflow: hidden; position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; margin-bottom: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 26px; color: white; background: var(--green-900); }
.result-hero::after { content: "CECRL"; position: absolute; right: -1rem; bottom: -1.6rem; color: rgba(255,255,255,.035); font: 800 7rem/1 sans-serif; }
.result-hero h1 { color: white; font-size: clamp(2rem, 5vw, 3.4rem); }
.result-hero p { max-width: 38rem; color: #d4e3dc; }
.level-orb { width: 148px; height: 148px; display: grid; place-items: center; position: relative; z-index: 1; border: 9px solid rgba(255,255,255,.14); border-radius: 50%; color: var(--green-950); background: var(--gold); font: 800 2.65rem/1 Georgia,serif; box-shadow: 0 15px 40px rgba(0,0,0,.18); }
.score-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: .75rem; margin: 1rem 0; }
.score-card { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.score-card small { color: var(--muted); }
.score-card b { display: block; margin: .25rem 0; color: var(--green-900); font: 800 1.6rem/1 Georgia,serif; }
.mini-bar { height: 6px; overflow: hidden; margin-top: .7rem; border-radius: 9px; background: #e5ebe8; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.recommendation { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.clean-list { padding-left: 1.15rem; }
.clean-list li { margin: .45rem 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.1rem; }
.disclaimer { margin-top: 1rem; padding: .85rem; border-radius: 12px; color: #5b6762; background: #f0f3f1; font-size: .8rem; }

.toast { position: fixed; left: 50%; bottom: 1.25rem; z-index: 30; transform: translate(-50%, 150%); max-width: min(92vw, 500px); padding: .72rem 1rem; border-radius: 11px; color: white; background: var(--green-950); box-shadow: var(--shadow); transition: transform .25s ease; }
.toast.show { transform: translate(-50%, 0); }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1rem,4vw,4rem); color: #718078; border-top: 1px solid var(--line); font-size: .75rem; }

@media (max-width: 1000px) {
  .score-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { padding: 1.25rem; }
  .test-shell { grid-template-columns: 1fr; }
  .stepper { position: static; display: flex; overflow-x: auto; padding: .45rem; }
  .stepper-item { flex: 0 0 auto; }
  .stepper-item b { display: none; }
  .form-grid, .recommendation { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .score-grid { grid-template-columns: repeat(2,1fr); }
  .result-hero { grid-template-columns: 1fr; }
  .level-orb { width: 112px; height: 112px; font-size: 2rem; }
}

@media (max-width: 520px) {
  .topbar { min-height: 68px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand small { display: none; }
  .top-status { gap: .45rem; }
  #stepLabel { display: none; }
  main { width: min(100% - 1rem, 1040px); padding-top: 1.5rem; }
  .hero { gap: 1.5rem; }
  .hero-card { border-radius: 22px; }
  .skill-row { grid-template-columns: 38px 1fr; }
  .skill-row > small { display: none; }
  .card { border-radius: 17px; padding: 1rem; }
  .audio-panel { align-items: flex-start; flex-wrap: wrap; }
  .audio-main { min-width: calc(100% - 68px); }
  .listen-count { margin-left: 64px; }
  .nav-actions { position: sticky; bottom: 0; z-index: 8; margin-left: -1rem; margin-right: -1rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
  .nav-actions .btn { flex: 1; }
  footer { flex-direction: column; }
}

@media print {
  body { background: white; }
  .topbar, .progress-shell, footer, .stepper, .result-actions, .toast { display: none !important; }
  main { width: 100%; margin: 0; padding: 0; }
  .test-shell { display: block; }
  .result-hero { color: black; background: white; border: 2px solid var(--green-900); }
  .result-hero h1, .result-hero p { color: black; }
  .card, .score-card { box-shadow: none; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
