:root {
  --navy: #12233f;
  --navy-2: #1c3154;
  --ink: #17233a;
  --muted: #667085;
  --line: #dce3ed;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --lime: #c8ef45;
  --lime-dark: #6e9510;
  --orange: #ff8c42;
  --blue: #4f7cff;
  --red: #e45d69;
  --teal: #1faaa1;
  --shadow: 0 14px 40px rgba(18, 35, 63, 0.09);
  --radius: 22px;
  --text-scale: 1;
}

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--text-scale)); scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif; line-height: 1.65; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(79, 124, 255, .45); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 999; background: var(--surface); padding: 10px 16px; border-radius: 10px; color: var(--navy); }
.skip-link:focus { top: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .75rem; font-weight: 900; letter-spacing: .18em; }
.muted { color: var(--muted); }
.microcopy { color: var(--muted); font-size: .78rem; margin: 8px 0 0; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(380px, .85fr); background: var(--surface); }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 120px); color: #fff; background: var(--navy); }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); }
.login-art::before { width: 520px; height: 520px; right: -210px; top: -130px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.02); }
.login-art::after { width: 230px; height: 230px; left: -100px; bottom: -80px; background: var(--lime); opacity: .9; border: 0; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px 14px 14px 4px; background: var(--lime); color: var(--navy); font-weight: 1000; letter-spacing: -.07em; }
.brand-mark--large { width: 62px; height: 62px; margin-bottom: 34px; font-size: 1.35rem; }
.login-art .eyebrow { color: var(--lime); }
.login-art h1 { margin: 0 0 22px; font-size: clamp(2.8rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.06em; }
.login-art h1 span { color: var(--lime); }
.login-art > p:not(.eyebrow) { color: #bac6d8; font-size: 1.05rem; }
.login-stats { display: flex; gap: 12px; margin-top: 44px; flex-wrap: wrap; }
.login-stats span { min-width: 112px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; color: #9facbf; font-size: .68rem; letter-spacing: .08em; }
.login-stats strong { display: block; color: #fff; font-size: 1.35rem; letter-spacing: -.03em; }
.login-panel { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: clamp(34px, 7vw, 100px); }
.login-panel h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.login-panel p { margin-top: 6px; }
.form-stack { display: grid; gap: 16px; }
label { color: #344054; font-size: .82rem; font-weight: 750; }
input, select { width: 100%; min-height: 49px; margin-top: 6px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; color: var(--ink); }
input:focus, select:focus { border-color: var(--blue); background: #fff; }
.first-login { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.first-login summary { cursor: pointer; color: var(--navy); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 14px; }
.span-2 { grid-column: span 2; }
.form-error { color: #a3323d; background: #fff0f1; padding: 10px 12px; border-radius: 10px; font-size: .85rem; }

.btn { min-height: 46px; border: 0; border-radius: 13px; padding: 11px 18px; cursor: pointer; font-weight: 850; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--lime); color: var(--navy); box-shadow: 0 8px 20px rgba(133, 172, 22, .2); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--outline { background: #fff; border: 1px solid var(--line); color: var(--navy); }
.btn--soft { background: #eef2f8; color: var(--navy); }
.btn--danger { background: #fff0f1; color: #a3323d; }
.btn--text { background: transparent; color: var(--blue); padding: 6px 0; align-self: flex-start; }
.btn--wide { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand strong { display: block; font-size: .9rem; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .18em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.level-pill { display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 20px; background: #eef2f8; font-size: .7rem; font-weight: 900; }
.level-pill i { width: 70px; height: 6px; overflow: hidden; border-radius: 10px; background: #d6deea; }
.level-pill b { display: block; height: 100%; width: 0; background: var(--lime-dark); border-radius: inherit; }
.icon-btn, .avatar { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.avatar { border: 0; background: var(--navy); color: #fff; font-weight: 900; }
.offline-banner { padding: 8px 20px; background: #fff1c7; color: #745b08; text-align: center; font-size: .82rem; font-weight: 700; }
.app-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { position: sticky; top: 76px; height: calc(100vh - 76px); display: flex; flex-direction: column; justify-content: space-between; padding: 24px 15px; background: var(--navy); color: #fff; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav button { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #aebbd0; cursor: pointer; text-align: left; font-weight: 750; }
.sidebar nav button span { width: 22px; font-size: 1.15rem; }
.sidebar nav button:hover, .sidebar nav button.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar nav button.active { box-shadow: inset 3px 0 var(--lime); }
.sidebar-quest { padding: 15px; border-radius: 16px; background: rgba(255,255,255,.08); color: #bdc8d8; font-size: .73rem; }
.sidebar-quest strong { display: block; margin-bottom: 6px; color: var(--lime); font-size: .82rem; }
.sidebar-quest progress { width: 100%; height: 6px; accent-color: var(--lime); }
.bottom-nav { display: none; }
.main-view { width: 100%; max-width: 1440px; margin: 0 auto; padding: 34px clamp(22px, 4vw, 60px) 70px; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.55rem); letter-spacing: -.045em; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.18rem; }
.section-title button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 800; }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.25fr .75fr; min-height: 290px; padding: clamp(28px, 5vw, 54px); border-radius: 28px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 330px; height: 330px; right: -90px; bottom: -165px; border-radius: 50%; border: 60px solid rgba(200,239,69,.12); }
.hero h1 { max-width: 690px; margin: 0; font-size: clamp(2rem, 4.1vw, 4rem); line-height: 1.08; letter-spacing: -.055em; }
.hero h1 span { color: var(--lime); }
.hero p { max-width: 580px; color: #b7c3d5; }
.hero-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.hero-visual { position: relative; display: grid; place-items: center; z-index: 1; }
.progress-orbit { position: relative; width: 190px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--lime) var(--progress), rgba(255,255,255,.1) 0); }
.progress-orbit::before { content: ""; position: absolute; inset: 17px; border-radius: inherit; background: var(--navy); }
.progress-orbit div { position: relative; text-align: center; }
.progress-orbit strong { display: block; font-size: 2.7rem; line-height: 1; }
.progress-orbit small { color: #9fadbf; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card, .card { border: 1px solid rgba(220,227,237,.9); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(18,35,63,.045); }
.stat-card { min-height: 138px; padding: 22px; }
.stat-card .stat-icon { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 11px; background: #eff3f9; }
.stat-card strong { display: block; font-size: 1.7rem; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.action-card { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; border: 0; border-radius: var(--radius); cursor: pointer; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.action-card:nth-child(1) { background: #eaf0ff; }
.action-card:nth-child(2) { background: #eff8d3; }
.action-card:nth-child(3) { background: #fff0e5; }
.action-card .action-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.72); font-size: 1.45rem; }
.action-card h3 { margin: 18px 0 4px; font-size: 1.18rem; }
.action-card p { margin: 0; color: #5f6a7c; font-size: .85rem; }
.action-card b { margin-top: 18px; color: var(--navy); }

.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.unit-card { position: relative; min-height: 154px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; text-align: left; overflow: hidden; }
.unit-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.unit-card.locked { opacity: .5; cursor: not-allowed; }
.unit-card.complete { border-color: #b4d853; background: #fbffef; }
.unit-card.mastered { color: #fff; border-color: var(--navy); background: var(--navy); }
.unit-card .unit-kicker { color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .12em; }
.unit-card.mastered .unit-kicker { color: #aebbd0; }
.unit-card strong { display: block; margin: 7px 0 3px; font-size: 1.12rem; }
.unit-card small { color: var(--muted); }
.unit-card.mastered small { color: #bdc8d8; }
.mini-progress { height: 6px; margin-top: 18px; overflow: hidden; border-radius: 10px; background: #e5eaf1; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.unit-card.complete .mini-progress i, .unit-card.mastered .mini-progress i { background: var(--lime); }
.unit-badge { position: absolute; top: 15px; right: 15px; font-size: .8rem; }

.card { padding: 24px; }
.mode-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mode-card { min-height: 180px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; text-align: left; }
.mode-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.mode-card span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #eef3ff; font-size: 1.3rem; }
.mode-card h3 { margin: 16px 0 5px; }
.mode-card p { color: var(--muted); font-size: .84rem; }

.session-shell { max-width: 900px; margin: 0 auto; }
.session-top { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.session-top .back-btn { flex: 0 0 auto; }
.session-progress { flex: 1; }
.session-progress div { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.progress-track { height: 9px; overflow: hidden; border-radius: 12px; background: #dfe5ee; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--lime-dark); transition: width .25s ease; }
.back-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.study-card { min-height: 500px; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 6vw, 64px); border-radius: 28px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.word-number { color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .14em; }
.study-word { margin: 25px 0 16px; font-size: clamp(2.3rem, 8vw, 5.2rem); line-height: 1.05; letter-spacing: -.045em; word-break: break-word; }
.speak-btn { min-height: 43px; padding: 8px 14px; border: 1px solid #cdd6e4; border-radius: 13px; background: #f7f9fc; color: var(--navy); cursor: pointer; font-size: .82rem; font-weight: 800; }
.speak-btn.playing { border-color: var(--blue); background: #eaf0ff; color: #2e56c5; }
.meaning-panel { margin: 28px auto 0; padding: 22px; border-radius: 16px; background: #f4f7fb; text-align: left; animation: rise .24s ease; }
.meaning-panel strong { display: block; margin-bottom: 6px; color: var(--navy); font-size: 1.35rem; }
.evaluation { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.evaluation button { min-height: 62px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-weight: 850; }
.evaluation button:nth-child(1):hover { border-color: var(--teal); background: #ecfbf9; }
.evaluation button:nth-child(2):hover { border-color: var(--orange); background: #fff7ef; }
.evaluation button:nth-child(3):hover { border-color: var(--red); background: #fff0f1; }

.question-card { padding: clamp(24px, 5vw, 44px); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.question-label { color: var(--blue); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.question-prompt { margin: 20px 0; font-size: clamp(1.65rem, 4vw, 3rem); line-height: 1.3; text-align: center; word-break: break-word; }
.question-prompt.question-sentence { max-width: 820px; margin: 26px auto 22px; font-size: clamp(1.35rem, 2.7vw, 2.15rem); line-height: 1.65; text-align: left; letter-spacing: -.018em; }
.question-number { display: inline-block; min-width: 2.15em; color: var(--blue); font-size: .72em; font-weight: 950; vertical-align: .08em; }
.blank-slot { display: inline-block; padding: .02em .24em; border-radius: .3em; background: #eaf0ff; color: #2d58ca; font-weight: 950; letter-spacing: .04em; white-space: nowrap; }
.question-hint { margin: -10px 0 22px; color: var(--muted); text-align: center; font-size: .82rem; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-option { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 2px solid #e1e6ee; border-radius: 15px; background: #fff; cursor: pointer; text-align: left; font-weight: 800; }
.answer-option:hover { border-color: #9fb5ff; background: #f7f9ff; }
.answer-option.selected { border-color: var(--blue); background: #edf2ff; }
.answer-option.correct { border-color: var(--teal); background: #eafaf7; }
.answer-option.incorrect { border-color: var(--red); background: #fff0f1; }
.option-letter { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #eef2f7; }
.answer-option .speak-mini { width: 34px; height: 34px; margin-left: auto; flex: 0 0 auto; border: 0; border-radius: 10px; background: #eef2f7; cursor: pointer; }
.feedback { margin-top: 18px; padding: 18px; border-radius: 15px; background: #f4f7fb; }
.feedback.good { background: #eafaf7; }
.feedback.try { background: #fff6ed; }
.feedback h3 { margin: 0 0 5px; }
.completed-sentence { padding-bottom: 12px; border-bottom: 1px solid rgba(18,35,63,.1); color: var(--navy); font-size: 1.02rem; font-weight: 850; }
.question-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.timer { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 800; }
.question-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 1px; margin: 14px 0; }
.question-dot { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: .72rem; }
.question-dot.answered { color: #fff; border-color: var(--blue); background: var(--blue); }
.question-dot.flagged { box-shadow: inset 0 -4px var(--orange); }
.question-dot.current { outline: 3px solid rgba(79,124,255,.25); }

.result-hero { padding: clamp(30px, 6vw, 60px); border-radius: 28px; background: var(--navy); color: #fff; text-align: center; }
.result-hero .score { margin: 10px 0; color: var(--lime); font-size: clamp(4rem, 12vw, 7.5rem); font-weight: 1000; line-height: 1; letter-spacing: -.07em; }
.result-hero h1 { margin: 8px 0; }
.result-hero p { color: #bdc8d8; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.result-stats div { padding: 16px; border-radius: 14px; background: rgba(255,255,255,.08); }
.result-stats strong { display: block; font-size: 1.3rem; }
.mistake-list { display: grid; gap: 8px; }
.mistake-row { display: grid; grid-template-columns: 56px 1fr 1.3fr; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.mistake-row:last-child { border: 0; }
.mistake-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }

.history-list { display: grid; gap: 10px; }
.history-row { display: grid; grid-template-columns: 68px 1fr auto; gap: 16px; align-items: center; padding: 17px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.history-date { color: var(--muted); font-size: .72rem; text-align: center; }
.history-date strong { display: block; color: var(--ink); font-size: 1.2rem; }
.history-row h3 { margin: 0; font-size: .95rem; }
.history-row p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.score-pill { padding: 7px 11px; border-radius: 20px; background: #eef3ff; color: #2d58ca; font-weight: 900; }

.profile-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; }
.profile-card { color: #fff; background: var(--navy); }
.profile-name { font-size: 1.8rem; font-weight: 900; }
.profile-meta { color: #b8c3d3; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.badge-card { padding: 17px; border-radius: 15px; background: #f4f7fb; text-align: center; }
.badge-card.locked { filter: grayscale(1); opacity: .45; }
.badge-card span { display: block; font-size: 1.8rem; }
.badge-card strong { display: block; font-size: .8rem; }
.settings-list { display: grid; gap: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-row h3 { margin: 0; font-size: .95rem; }
.setting-row p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.segmented { display: flex; padding: 3px; border-radius: 10px; background: #eef2f7; }
.segmented button { min-width: 40px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.segmented button.active { background: #fff; box-shadow: 0 2px 7px rgba(18,35,63,.12); }

.empty-state { padding: 60px 20px; border: 1px dashed #cbd4e1; border-radius: var(--radius); background: #fff; text-align: center; }
.empty-state span { font-size: 2rem; }
.empty-state h2 { margin: 10px 0 3px; }
.empty-state p { color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(10,23,42,.66); backdrop-filter: blur(5px); }
.modal { width: min(680px, 100%); max-height: 90vh; overflow-y: auto; padding: 28px; border-radius: 24px; background: #fff; box-shadow: 0 25px 80px rgba(0,0,0,.25); animation: rise .2s ease; }
.modal h2 { margin: 0 0 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: min(480px, calc(100% - 28px)); transform: translate(-50%, 80px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: var(--navy); color: #fff; box-shadow: var(--shadow); transition: .22s ease; font-size: .85rem; font-weight: 750; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 360px; padding: 50px 8vw; }
  .login-art h1 { font-size: clamp(2.7rem, 10vw, 5rem); }
  .login-stats { margin-top: 24px; }
  .login-panel { padding: 46px 8vw 70px; }
  .app-layout { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar nav button { justify-content: center; padding: 0; font-size: 0; }
  .sidebar nav button span { width: auto; font-size: 1.25rem; }
  .sidebar-quest { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: 1fr 1fr; }
  .action-grid .action-card:last-child { grid-column: span 2; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .login-art { min-height: 310px; padding: 38px 24px; }
  .brand-mark--large { margin-bottom: 22px; }
  .login-art > p:not(.eyebrow) { font-size: .9rem; }
  .login-stats span:nth-child(3) { display: none; }
  .login-panel { padding: 36px 22px 52px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .topbar { height: 64px; padding: 0 14px; }
  .level-pill i { display: none; }
  .icon-btn { display: none; }
  .app-layout { display: block; min-height: calc(100vh - 64px); }
  .sidebar { display: none; }
  .bottom-nav { position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 12px 40px rgba(18,35,63,.18); backdrop-filter: blur(12px); }
  .bottom-nav button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: .62rem; font-weight: 800; }
  .bottom-nav button span { font-size: 1.12rem; line-height: 1.2; }
  .bottom-nav button.active { color: var(--navy); background: #edf2f8; }
  .main-view { padding: 24px 16px 100px; }
  .page-head { align-items: start; flex-direction: column; }
  .hero { min-height: 350px; padding: 30px 24px; }
  .hero h1 { font-size: 2.35rem; }
  .hero-actions .btn { flex: 1; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 125px; padding: 16px; }
  .action-grid { grid-template-columns: 1fr; }
  .action-grid .action-card:last-child { grid-column: auto; }
  .action-card { min-height: 170px; }
  .unit-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .unit-card { min-height: 142px; padding: 15px; }
  .mode-picker { grid-template-columns: 1fr; }
  .study-card { min-height: calc(100vh - 205px); padding: 30px 20px; }
  .study-word { font-size: clamp(2.1rem, 13vw, 3.9rem); }
  .evaluation { grid-template-columns: 1fr; }
  .evaluation button { min-height: 52px; }
  .answer-grid { grid-template-columns: 1fr; }
  .answer-option { min-height: 62px; }
  .question-footer { align-items: stretch; flex-direction: column; }
  .question-footer .btn { width: 100%; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .mistake-row { grid-template-columns: 42px 1fr; }
  .mistake-row span:last-child { grid-column: 2; }
  .history-row { grid-template-columns: 54px 1fr; }
  .score-pill { grid-column: 2; justify-self: start; }
  .profile-grid { grid-template-columns: 1fr; }
  .setting-row { align-items: flex-start; flex-direction: column; }
  .modal { padding: 22px; }
}
