:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #eef2f7;
  --text: #111827;
  --muted: #667085;
  --line: #e3e8ef;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --good: #15803d;
  --warn: #b45309;
  --shadow: 0 16px 50px rgba(15, 23, 42, .08);
}
[data-theme="dark"] {
  --bg: #0c1017;
  --panel: #111722;
  --panel-2: #171f2b;
  --text: #f2f4f7;
  --muted: #98a2b3;
  --line: #273142;
  --accent: #6ea8fe;
  --accent-soft: #172a4f;
  --good: #4ade80;
  --warn: #f59e0b;
  --shadow: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, "Noto Sans JP", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 64px; }
.topbar { height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { color: var(--text); text-decoration: none; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.topnav { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.topnav button, .icon-button { border: 0; color: var(--muted); background: transparent; border-radius: 9px; padding: 9px 12px; }
.topnav button:hover, .topnav button.active { color: var(--text); background: var(--panel-2); }
.icon-button { justify-self: end; border: 1px solid var(--line); background: var(--panel); width: 40px; height: 40px; padding: 0; }
.hero { padding: 76px 0 48px; max-width: 850px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h1 { font-size: clamp(42px, 7vw, 80px); line-height: .98; letter-spacing: -.055em; margin: 14px 0 24px; }
h2 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 10px; }
h3 { margin: 0 0 8px; font-size: 18px; }
p { line-height: 1.75; }
.lead { color: var(--muted); font-size: 18px; max-width: 720px; }
.actions { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 11px; padding: 12px 16px; font-weight: 600; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.accent { background: var(--accent); color: white; border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin-bottom: 0; }
.metric { font-size: 34px; font-weight: 700; letter-spacing: -.04em; margin: 6px 0; }
.section { margin-top: 42px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head p { color: var(--muted); margin: 0; }
.test-wrap { max-width: 780px; margin: 44px auto 0; }
.progress-line { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 16px 0 28px; }
.progress-line span { display: block; height: 100%; background: var(--accent); }
.question { font-size: 23px; font-weight: 650; line-height: 1.5; margin: 28px 0 18px; }
.answer-list { display: grid; gap: 10px; }
.answer { text-align: left; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 12px; padding: 14px 16px; }
.answer:hover { border-color: var(--accent); }
.answer.selected { border-color: var(--accent); background: var(--accent-soft); }
.result-level { font-size: 76px; font-weight: 800; letter-spacing: -.07em; margin: 4px 0; }
.bar-row { margin: 15px 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.lesson-list { display: grid; gap: 12px; }
.lesson { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lesson:last-child { border-bottom: 0; }
.lesson-num { width: 38px; height: 38px; border-radius: 11px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.lesson-title { font-weight: 650; }
.lesson-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.pill { border-radius: 999px; background: var(--panel-2); color: var(--muted); padding: 5px 9px; font-size: 12px; font-weight: 600; }
.practice { max-width: 780px; }
.sentence { font-size: 28px; line-height: 1.5; letter-spacing: -.02em; margin: 28px 0 14px; }
.hint { color: var(--muted); }
.text-input { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.feedback { margin-top: 16px; border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--muted); }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 36px; text-align: center; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .app-shell { padding: 0 16px 44px; }
  .topbar { grid-template-columns: 1fr auto; height: 68px; }
  .topnav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10; justify-content: space-around; box-shadow: var(--shadow); }
  .topnav button { padding: 10px 8px; font-size: 12px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding-top: 54px; }
  .lesson { grid-template-columns: 40px 1fr; }
  .lesson .pill { grid-column: 2; justify-self: start; }
}
