:root {
  color-scheme: light;
  --ink: #102a43;
  --ink-soft: #486581;
  --paper: #f6f9fc;
  --white: #ffffff;
  --line: #d9e2ec;
  --blue: #1d4ed8;
  --blue-dark: #153e75;
  --aqua: #16b8a6;
  --gold: #f5b942;
  --red: #c24151;
  --green: #0f8b68;
  --shadow: 0 22px 60px rgba(16, 42, 67, .11);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink); background:
  radial-gradient(circle at 5% 2%, rgba(22, 184, 166, .12), transparent 24rem),
  linear-gradient(180deg, #f9fbfd 0%, #f2f7fb 100%); }
button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.result-banner { position: fixed; z-index: 60; top: max(12px, env(safe-area-inset-top)); left: 50%; width: min(calc(100% - 24px), 480px); min-height: 72px; display: flex; align-items: center; gap: 13px; transform: translateX(-50%); padding: 12px 17px; border: 2px solid transparent; border-radius: 17px; box-shadow: 0 16px 42px rgba(9,30,53,.24); animation: result-drop .28s ease-out; }
.result-banner.success { color: #075c47; border-color: #65c9ae; background: #e5f7f1; }
.result-banner.error { color: #922f42; border-color: #e79aa7; background: #fff0f2; }
.result-banner.review { color: #704600; border-color: #e2b14a; background: #fff8e6; }
.result-banner > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.result-banner strong { font-size: 1.22rem; }
.result-banner small { margin-top: 4px; font-size: .82rem; font-weight: 750; }
.result-banner-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 1.4rem; font-weight: 950; }
.result-banner.success .result-banner-icon { background: var(--green); }
.result-banner.error .result-banner-icon { background: var(--red); }
.result-banner.review .result-banner-icon { background: #c88708; }

.app-shell { width: min(100%, 860px); min-height: 100vh; margin: 0 auto; padding: 0 24px 48px; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; line-height: .95; letter-spacing: .08em; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--ink); font-weight: 900; box-shadow: inset -7px -7px 0 rgba(22,184,166,.25); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 4px; color: var(--ink-soft); font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
.icon-button, .sheet-close { border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; background: var(--white); box-shadow: 0 5px 20px rgba(16,42,67,.08); font-size: 1.25rem; }
.icon-button:hover { background: #eaf2f8; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.tutorial-button { width: auto; padding: 0 13px; display: flex; align-items: center; gap: 7px; border-radius: 999px; color: white; background: var(--ink); font-size: .9rem; }
.tutorial-button small { font-size: .72rem; font-weight: 850; }
.tutorial-button:hover { color: white; background: #214e78; }
.refresh-button { width: auto; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #c8d7e4; border-radius: 999px; color: var(--blue-dark); }
.refresh-button span { font-size: 1.28rem; line-height: 1; }
.refresh-button small { font-size: .7rem; font-weight: 850; }
.refresh-button:hover, .refresh-button:focus-visible { color: var(--blue); border-color: var(--blue); background: #edf4ff; outline: 0; }

.screen { animation: enter .28s ease-out; }
.level-overview { display: grid; grid-template-columns: 108px 1fr; gap: 14px; align-items: stretch; margin: 10px 0 16px; }
.level-select-button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; padding: 12px 14px; border: 0; border-radius: 17px; color: white; background: linear-gradient(145deg, var(--ink), #234f77); box-shadow: 0 10px 24px rgba(16,42,67,.16); cursor: pointer; text-align: left; }
.level-select-button span { grid-column: 1; font-size: .64rem; font-weight: 850; letter-spacing: .13em; opacity: .7; }
.level-select-button strong { grid-row: 2; font-size: 1.45rem; line-height: 1; }
.level-select-button small { grid-column: 2; grid-row: 2; align-self: end; color: #dce9f3; text-align: right; font-size: .68rem; }
.exam-equivalents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.exam-chip { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.82); }
.exam-chip span, .exam-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-chip span { color: var(--ink-soft); font-size: .64rem; font-weight: 800; letter-spacing: .04em; }
.exam-chip strong { margin-top: 4px; font-size: .78rem; }
.level-change-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; margin: -2px 0 8px; padding: 8px 13px; border: 1px solid #b7c9da; border-radius: 12px; color: var(--blue-dark); background: rgba(255,255,255,.88); cursor: pointer; font-size: .82rem; font-weight: 800; }
.level-change-link:hover, .level-change-link:focus-visible { border-color: var(--blue); color: var(--blue); background: #edf4ff; outline: 0; }
.level-change-link span { font-size: 1rem; }
.quality-status { display: flex; align-items: center; gap: 8px 12px; margin: 2px 0 12px; padding: 10px 13px; border: 1px solid #e2c167; border-radius: 12px; color: #674b00; background: #fff8df; font-size: .74rem; line-height: 1.45; }
.quality-status strong { white-space: nowrap; }
.quality-status span { color: #765f26; }
.field-selector { display: grid; grid-template-columns: auto minmax(210px, 320px) 1fr; gap: 8px 12px; align-items: center; margin: 2px 0 14px; padding: 12px 14px; border: 1px solid #bad7d7; border-radius: 15px; background: #effafa; }
.field-selector[hidden] { display: none; }
.field-selector label { color: #075c63; font-size: .8rem; font-weight: 850; }
.field-selector select { min-height: 43px; padding: 8px 34px 8px 11px; border: 1px solid #8ebfc1; border-radius: 11px; color: var(--ink); background: white; cursor: pointer; font-weight: 800; }
.field-selector small { color: var(--ink-soft); font-size: .7rem; line-height: 1.45; }
.compact-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 18px; margin: 14px 0 26px; }
.compact-progress > div:first-child { display: flex; flex-direction: column; }
.eyebrow { color: var(--blue); font-size: .74rem; line-height: 1.4; font-weight: 850; letter-spacing: .14em; }
.compact-progress strong { margin-top: 3px; font-size: 1.5rem; }
.compact-progress strong small { font-size: .82rem; color: var(--ink-soft); }
.progress-track { align-self: center; height: 8px; overflow: hidden; border-radius: 999px; background: #dce7ef; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), #4dd8c8); transition: width .45s ease; }
.next-goal { align-self: center; color: var(--ink-soft); font-size: .78rem; white-space: nowrap; }

.homepage-guide { margin: 34px 0 0; }
.homepage-guide a { display: block; overflow: hidden; border: 1px solid #b8cedf; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 10px 28px rgba(16,42,67,.1); text-decoration: none; }
.homepage-banner-media { position: relative; display: block; overflow: hidden; background: #17212a; }
.homepage-guide img { display: block; width: 100%; height: auto; aspect-ratio: 4368 / 1557; object-fit: cover; }
.homepage-banner-copy { position: absolute; inset: 50% auto auto 5%; width: 63%; color: #fff; line-height: 1.2; text-align: left; text-shadow: 0 3px 12px rgba(0,0,0,.95), 0 1px 2px rgba(0,0,0,.95); transform: translateY(-50%); }
.homepage-banner-copy strong, .homepage-banner-copy small { display: block; }
.homepage-banner-copy strong { font-size: clamp(1.25rem, 3.7vw, 2.9rem); font-weight: 950; letter-spacing: .02em; }
.homepage-banner-copy small { margin-top: .42em; font-size: clamp(.84rem, 2.25vw, 1.72rem); font-weight: 850; letter-spacing: .025em; }
.homepage-guide-caption { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; }
.homepage-guide-caption strong { font-size: .95rem; }
.homepage-guide-caption > span { color: var(--blue); font-size: .78rem; font-weight: 850; white-space: nowrap; }
.homepage-guide a:hover, .homepage-guide a:focus-visible { border-color: var(--blue); outline: 3px solid rgba(29,78,216,.12); }
.homepage-guide a:hover .homepage-guide-caption, .homepage-guide a:focus-visible .homepage-guide-caption { background: #edf4ff; }

.question-card, .passage-card { background: rgba(255,255,255,.96); border: 1px solid rgba(217,226,236,.85); box-shadow: var(--shadow); }
.question-card { padding: clamp(26px, 5vw, 50px); border-radius: 28px; scroll-margin-top: max(6px, env(safe-area-inset-top)); }
.question-audio-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 20px 0 17px; padding: 12px; border: 1px solid #b9ddd7; border-radius: 16px; background: #effaf8; }
.question-audio-toolbar button { min-height: 46px; padding: 8px 10px; border: 1px solid #59aa9f; border-radius: 12px; color: #075f55; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 850; }
.question-audio-toolbar button:hover, .question-audio-toolbar button:focus-visible { border-color: var(--green); background: #dcf5ef; outline: 3px solid rgba(15,156,137,.14); }
#play-question-sentence[aria-pressed="true"], #play-question-audio[aria-pressed="true"] { color: white; border-color: #118f7d; background: #118f7d; }
#toggle-auto-question-audio { grid-column: 1 / -1; }
#toggle-auto-question-audio[aria-pressed="true"] { color: #fff; background: #118f7d; }
#toggle-auto-question-audio[aria-pressed="false"] { color: #6b4c00; border-color: #d8ae43; background: #fff8df; }
#question-audio-status { grid-column: 1 / -1; color: var(--ink-soft); font-size: .72rem; line-height: 1.45; }
.choice-row.is-reading { border-color: #1b9f91; background: #e0f7f2; box-shadow: 0 0 0 3px rgba(27,159,145,.13); }
.question-meta { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .75rem; font-weight: 850; letter-spacing: .14em; }
.question-meta-chips { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; letter-spacing: normal; }
.field-chip { padding: 6px 9px; border-radius: 999px; color: #075c63; background: #e7f7f7; font-size: .64rem; white-space: nowrap; }
.mode-chip { padding: 7px 11px; border-radius: 999px; color: #08766b; background: #dcf7f2; font-size: .66rem; }
.mode-chip.review { color: #8a5a00; background: #fff2cd; }
.instruction { margin: 34px 0 13px; color: var(--ink-soft); font-size: .84rem; }
.sentence { margin: 0 0 32px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 4.6vw, 2.35rem); line-height: 1.52; letter-spacing: -.01em; }
.sentence .blank { display: inline-block; min-width: 5.5em; border-bottom: 3px solid var(--aqua); text-align: center; color: var(--blue-dark); font-family: inherit; font-weight: 700; }
.translation { margin: -14px 0 24px; padding: 12px 15px; border-radius: 12px; color: var(--ink-soft); background: #f4f7fa; line-height: 1.65; font-size: .9rem; }
.choice-audio-button { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; margin: -13px 0 13px auto; padding: 8px 16px; border: 1px solid #59aa9f; border-radius: 999px; color: #075f55; background: #effaf8; cursor: pointer; font-weight: 850; }
.choice-audio-button:hover, .choice-audio-button:focus-visible { border-color: var(--green); background: #dcf5ef; outline: 3px solid rgba(15,156,137,.14); }
.word-link { padding: 1px 2px; border: 0; border-bottom: 1px dotted #6b88a4; color: inherit; background: transparent; cursor: pointer; font: inherit; }
.word-link:hover, .word-link:focus-visible { color: var(--blue); border-bottom-style: solid; outline: 0; }

.choices { display: grid; gap: 11px; }
.choice-row { display: grid; grid-template-columns: 1fr 48px; min-height: 59px; overflow: hidden; border: 1.5px solid var(--line); border-radius: 15px; background: var(--white); transition: border .16s, transform .16s, background .16s; }
.choice-row:hover { border-color: #9fb3c8; transform: translateY(-1px); }
.choice-row.selected { border-color: var(--blue); background: #edf4ff; }
.choice-row.correct { border-color: var(--green); background: #e9f8f3; }
.choice-row.wrong { border-color: var(--red); background: #fff0f2; }
.choice-main, .choice-info { border: 0; background: transparent; cursor: pointer; }
.choice-main { padding: 13px 17px; display: flex; align-items: center; gap: 14px; color: var(--ink); text-align: left; font-size: 1.02rem; font-weight: 730; }
.choice-letter { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--ink-soft); background: #edf2f7; font-size: .76rem; }
.selected .choice-letter { color: white; background: var(--blue); }
.correct .choice-letter { color: white; background: var(--green); }
.wrong .choice-letter { color: white; background: var(--red); }
.choice-info { border-left: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; font-weight: 800; }
.choice-info:hover { color: var(--blue); background: rgba(29,78,216,.05); }
.choice-main:disabled { cursor: default; color: var(--ink); opacity: 1; }
.dont-know-button { width: 100%; min-height: 51px; margin-top: 13px; border: 1.5px solid #b9c8d6; border-radius: 14px; color: var(--ink-soft); background: #f7fafc; font-weight: 800; cursor: pointer; }
.dont-know-button span { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; border-radius: 50%; color: white; background: #70869a; font-size: .85rem; }
.dont-know-button:hover { color: var(--ink); border-color: #859caf; background: #edf3f7; }
.dont-know-button.selected { color: #704600; border-color: #d69b1e; background: #fff8e6; }
.dont-know-button.selected span { background: #c88708; }
.dont-know-button:disabled { cursor: default; opacity: 1; }
.answered-sentence-audio { width: 100%; min-height: 58px; margin: 18px 0 0; padding: 9px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid #58ad9f; border-radius: 14px; color: #075f55; background: #e3f8f1; cursor: pointer; font-weight: 850; box-shadow: 0 8px 20px rgba(15,139,104,.12); }
.answered-sentence-audio > span:first-child { font-size: 1.35rem; }
.answered-sentence-audio > span:last-child { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.answered-sentence-audio strong { font-size: .95rem; }
.answered-sentence-audio small { margin-top: 3px; color: #32766d; font-size: .68rem; }
.answered-sentence-audio:hover, .answered-sentence-audio:focus-visible { border-color: var(--green); background: #d9f3eb; outline: 3px solid rgba(15, 156, 137, .14); }
.answered-sentence-audio:disabled { cursor: wait; opacity: .72; }
.answered-sentence-audio + .feedback { margin-top: 10px; }

.feedback { margin-top: 18px; padding: 15px 17px; border-radius: 14px; line-height: 1.6; font-size: .94rem; }
.feedback.success { color: #096a51; background: #e5f7f1; }
.feedback.error { color: #963747; background: #fff0f2; }
.feedback.unknown { color: #704600; background: #fff8e6; }
.feedback-title { display: flex; align-items: center; gap: 11px; margin-bottom: 7px; }
.feedback-title > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.feedback-title strong { font-size: 1.08rem; }
.feedback-title small { margin-top: 2px; font-size: .76rem; }
.correct-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); box-shadow: 0 7px 16px rgba(15,139,104,.22); font-size: 1.28rem; font-weight: 900; animation: correct-pop .32s ease-out; }
.wrong-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); box-shadow: 0 7px 16px rgba(194,65,81,.2); font-size: 1.28rem; font-weight: 900; animation: wrong-pop .32s ease-out; }
.unknown-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: #c88708; box-shadow: 0 7px 16px rgba(200,135,8,.2); font-size: 1.2rem; font-weight: 900; animation: wrong-pop .32s ease-out; }
.feedback.error .feedback-title strong { color: #a52f43; }
.feedback-answer { margin-bottom: 2px; font-weight: 750; }
.primary-button { width: 100%; min-height: 56px; margin-top: 18px; padding: 14px 20px; border: 0; border-radius: 15px; color: white; background: linear-gradient(135deg, var(--blue-dark), var(--blue)); box-shadow: 0 12px 26px rgba(29,78,216,.22); font-weight: 800; cursor: pointer; }
.primary-button:hover { filter: brightness(1.08); }
.primary-button span { margin-left: 8px; }
.tap-hint { margin: 21px 0 0; color: var(--ink-soft); text-align: center; font-size: .8rem; }

.backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(9,30,53,.54); backdrop-filter: blur(3px); }
.word-sheet { position: fixed; z-index: 71; left: 50%; bottom: 0; width: min(100%, 620px); max-height: 88vh; overflow-y: auto; transform: translateX(-50%); padding: 32px clamp(22px, 5vw, 42px) max(30px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--white); box-shadow: 0 -20px 60px rgba(9,30,53,.22); animation: sheet-up .28s ease-out; }
.sheet-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; background: #edf2f7; font-size: 1.35rem; }
.word-sheet > .sheet-close { position: sticky; top: 10px; right: auto; z-index: 3; display: grid; place-items: center; margin: -14px -24px -26px auto; box-shadow: 0 4px 14px rgba(9,30,53,.2); }
.word-sheet h2 { margin: 8px 0 2px; font-family: Georgia, "Times New Roman", serif; font-size: 2.4rem; }
.part-of-speech { display: inline-block; margin: 0 0 18px; padding: 5px 9px; border-radius: 8px; color: var(--ink-soft); background: #edf2f7; font-size: .78rem; }
.meaning { margin: 0 0 20px; font-size: 1.12rem; font-weight: 750; }
.detail-audio-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.detail-audio-actions button, .audio-player button, .audio-player select { min-height: 43px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; cursor: pointer; font-weight: 700; }
.detail-audio-actions button:disabled, .audio-player button:disabled { cursor: default; opacity: .48; }
.audio-status { flex-basis: 100%; margin: 3px 0 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.45; }
.voice-badge { padding: 7px 10px; border-radius: 999px; color: #08766b; background: #dcf7f2; font-size: .68rem; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.example-box { margin: 20px 0; padding: 17px; border-left: 4px solid var(--aqua); border-radius: 0 12px 12px 0; background: #f3f8fb; }
.example-box p { margin: 0; line-height: 1.65; }
.example-box p:first-child { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.example-box p + p { margin-top: 7px; color: var(--ink-soft); font-size: .86rem; }
.detail-example-note { display: block; margin: 0 0 8px; color: #08766b; font-family: Inter, "Noto Sans JP", sans-serif; font-size: .7rem; font-weight: 850; }
.detail-example-note + p { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.translation-training { margin: 22px 0; padding: 18px; border: 1px solid #cce7e2; border-radius: 17px; background: linear-gradient(180deg, #f5fffc, #eef9f7); }
.translation-training-kicker { color: #08766b; font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.translation-training h3 { margin: 5px 0 6px; color: var(--ink); font-size: 1.08rem; }
.translation-training-guide { margin: 0 0 14px; color: var(--ink-soft); font-size: .78rem; line-height: 1.6; }
.translation-drills { display: grid; gap: 11px; }
.translation-drill { padding: 13px; border: 1px solid #d7e4e9; border-radius: 13px; background: white; }
.translation-drill-heading { display: flex; align-items: flex-start; color: var(--ink); }
.translation-drill-number { display: inline-grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; margin-right: 9px; border-radius: 50%; color: white; background: #168f80; font-size: .74rem; font-weight: 900; }
.translation-drill-en { flex: 1; margin: 0; color: #0b4050; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1.55; }
.translation-drill-ja { margin: 8px 0 10px 34px; color: var(--ink-soft); font-size: .84rem; font-weight: 650; line-height: 1.55; }
.translation-drill-audio { min-height: 38px; margin-left: 34px; padding: 7px 12px; border: 1px solid #168f80; border-radius: 10px; color: #08766b; background: #f4fffc; cursor: pointer; font-size: .78rem; font-weight: 850; }
.translation-drill-audio:hover, .translation-drill-audio:focus-visible { color: white; background: #168f80; outline: 3px solid rgba(24,143,128,.15); outline-offset: 2px; }
.review-button { width: 100%; min-height: 53px; border: 1.5px solid #d69b1e; border-radius: 14px; color: #704600; background: #fff8e6; font-weight: 850; cursor: pointer; }
.review-button.registered { border-color: var(--green); color: #096a51; background: #e9f8f3; }
.review-message { min-height: 1.3em; margin: 10px 0 0; color: var(--ink-soft); text-align: center; font-size: .8rem; }
.word-detail-open #next-question { visibility: hidden !important; pointer-events: none; }

.progress-dialog, .confirm-dialog, .level-dialog, .tutorial-video-dialog { width: min(calc(100% - 28px), 620px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 26px 80px rgba(9,30,53,.28); }
.progress-dialog::backdrop, .confirm-dialog::backdrop, .level-dialog::backdrop, .tutorial-video-dialog::backdrop { background: rgba(9,30,53,.68); backdrop-filter: blur(3px); }
.trial-data-note { margin: 18px 24px 24px; padding: 16px; border-radius: 16px; background: #f3f7fa; color: #486176; }
.trial-data-note h3 { margin: 0 0 7px; color: var(--ink); font-size: .98rem; }
.trial-data-note p { margin: 0; font-size: .78rem; line-height: 1.65; }
.trial-data-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px !important; }
.trial-data-links a { color: #116c83; font-weight: 700; }
.dialog-head { position: relative; padding: 28px 28px 18px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 1.45rem; }
.level-banner { margin: 0 28px; padding: 19px; border-radius: 16px; color: white; background: linear-gradient(135deg, var(--ink), #214e78); }
.level-banner span, .level-banner small, .level-banner strong { display: block; }
.level-banner span { opacity: .72; font-size: .75rem; }
.level-banner strong { margin: 5px 0; font-size: 1.35rem; }
.level-banner small { opacity: .7; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 28px 24px; }
.stats-grid div { padding: 16px; border-radius: 13px; background: #f2f6f9; }
.stats-grid dt { color: var(--ink-soft); font-size: .76rem; }
.stats-grid dd { margin: 5px 0 0; font-size: 1.45rem; font-weight: 850; }
.word-results { margin: 0 28px 24px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.word-results h3 { margin: 0; font-size: 1rem; }
.word-results > p { margin: 5px 0 14px; color: var(--ink-soft); font-size: .74rem; line-height: 1.5; }
.word-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.word-results-grid > div { min-width: 0; padding: 13px 10px; border-radius: 12px; }
.word-results-grid dt { display: flex; align-items: center; gap: 5px; min-height: 2.4em; color: var(--ink-soft); font-size: .7rem; line-height: 1.25; }
.word-results-grid dt span { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 900; }
.word-results-grid dd { margin: 7px 0 0; font-size: 1.35rem; font-weight: 900; }
.word-results-grid dd small { margin-left: 3px; color: var(--ink-soft); font-size: .68rem; font-weight: 700; }
.word-results-grid .result-correct { background: #edf9f5; }
.word-results-grid .result-correct dt span { background: var(--green); }
.word-results-grid .result-incorrect { background: #fff3f5; }
.word-results-grid .result-incorrect dt span { background: #a52f43; }
.word-results-grid .result-recovered { background: #edf4ff; }
.word-results-grid .result-recovered dt span { background: var(--blue); }
.settings-section { padding: 20px 28px 28px; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0 0 12px; font-size: 1rem; }
.tutorial-video-dialog { max-height: min(92vh, 850px); overflow: auto; background: #f6fafc; }
.tutorial-dialog-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.tutorial-video-intro { margin: 0 28px 17px; color: var(--ink-soft); font-size: .86rem; line-height: 1.65; }
.tutorial-video-frame { display: grid; place-items: center; padding: 0 28px 28px; }
.tutorial-video-frame video { display: block; width: min(100%, 360px); max-height: 68vh; border-radius: 17px; background: #071c2e; box-shadow: 0 18px 42px rgba(9,30,53,.2); }
.danger-button { min-height: 44px; padding: 10px 15px; border: 1px solid #e6a8b2; border-radius: 11px; color: #a52f43; background: #fff4f5; font-weight: 750; cursor: pointer; }
.confirm-dialog { padding: 28px; }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 1.25rem; }
.confirm-dialog p { color: var(--ink-soft); line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.dialog-actions button { min-height: 44px; padding: 10px 15px; border-radius: 11px; border: 1px solid var(--line); background: white; cursor: pointer; }

.level-dialog { max-height: min(88vh, 780px); }
.level-dialog-intro { margin: 0 28px 18px; color: var(--ink-soft); line-height: 1.6; font-size: .88rem; }
.level-options { display: grid; gap: 9px; padding: 0 28px 12px; }
.level-option { width: 100%; display: grid; grid-template-columns: 55px 1fr auto; gap: 13px; align-items: center; padding: 13px; border: 1.5px solid var(--line); border-radius: 15px; color: var(--ink); background: white; cursor: pointer; text-align: left; }
.level-option:hover { border-color: #8ba8c1; background: #f8fbfd; }
.level-option.selected { border-color: var(--blue); background: #edf4ff; }
.level-option-code { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--ink); font-size: 1.04rem; font-weight: 900; }
.level-option-copy strong, .level-option-copy small { display: block; }
.level-option-copy strong { font-size: .93rem; }
.level-option-copy small { margin-top: 3px; color: var(--ink-soft); line-height: 1.4; }
.level-option-exams { grid-column: 2 / 4; grid-row: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 10px; color: var(--ink-soft); font-size: .68rem; text-align: left; }
.level-option-status { grid-column: 3; grid-row: 1; padding: 4px 8px; border-radius: 999px; color: #765000; background: #fff3cf; font-size: .64rem; font-weight: 800; }
.level-option.available .level-option-status { color: #08766b; background: #dcf7f2; }
.conversion-note { margin: 4px 28px 26px; color: var(--ink-soft); line-height: 1.55; font-size: .72rem; }

@media (max-width: 480px) {
  .word-results-grid { grid-template-columns: 1fr 1fr; }
  .word-results-grid .result-recovered { grid-column: 1 / -1; }
  .word-results-grid dt { min-height: auto; }
}

.unavailable-screen { min-height: calc(100vh - 100px); display: grid; place-items: center; align-content: center; text-align: center; }
.level-orb { width: 108px; height: 108px; display: grid; place-items: center; margin: 18px auto; border-radius: 30px; color: white; background: linear-gradient(145deg, var(--ink), var(--blue)); box-shadow: 0 18px 45px rgba(29,78,216,.25); font-size: 2.2rem; font-weight: 950; }
.unavailable-screen h1 { margin: 5px 0 8px; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.unavailable-screen > p { max-width: 500px; color: var(--ink-soft); line-height: 1.7; }
.unavailable-equivalents { width: min(100%, 560px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 8px; }
.unavailable-screen .primary-button { width: min(100%, 420px); }
.completion-screen .level-orb { background: linear-gradient(145deg, var(--green), var(--aqua)); }
.text-button { margin-top: 10px; padding: 10px; border: 0; color: var(--blue); background: transparent; cursor: pointer; font-weight: 750; }

.celebration { position: relative; min-height: calc(100vh - 100px); display: grid; place-items: center; align-content: center; overflow: hidden; text-align: center; }
.celebration-kicker { color: #936000; font-size: .78rem; font-weight: 900; letter-spacing: .2em; }
.medal { width: 86px; height: 86px; display: grid; place-items: center; margin: 14px auto; border: 7px solid #fff3c3; border-radius: 50%; color: #704600; background: radial-gradient(circle at 34% 30%, #fff3b2, var(--gold)); box-shadow: 0 16px 42px rgba(245,185,66,.32); font-size: 2.15rem; font-weight: 950; }
.celebration h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 7vw, 3.45rem); line-height: 1.05; }
.celebration p { max-width: 430px; color: var(--ink-soft); line-height: 1.7; }
.celebration .primary-button { width: min(100%, 370px); }
.mountain-progress { position: relative; z-index: 1; width: min(100%, 480px); margin: 18px auto 10px; padding: 12px 14px 14px; border: 1px solid #cbdde8; border-radius: 22px; background: linear-gradient(180deg, #f7fcff, #eef7f4); box-shadow: 0 15px 38px rgba(16,42,67,.12); }
.mountain-scene { position: relative; height: 190px; overflow: hidden; border-radius: 16px; background: linear-gradient(180deg, #bde9ff 0%, #e7f8ff 58%, #d8f0d3 59%, #b8deb3 100%); }
.mountain-sun { position: absolute; top: 17px; right: 28px; width: 38px; height: 38px; border-radius: 50%; background: #ffe07a; box-shadow: 0 0 0 8px rgba(255,224,122,.25); }
.mountain-cloud { position: absolute; width: 54px; height: 14px; border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 15px -7px 0 2px rgba(255,255,255,.9), 30px 0 0 rgba(255,255,255,.9); }
.mountain-cloud-one { top: 37px; left: 28px; }
.mountain-cloud-two { top: 68px; right: 82px; transform: scale(.75); }
.mountain-back { position: absolute; right: -10%; bottom: 0; width: 72%; height: 62%; background: #79a9a1; clip-path: polygon(0 100%, 50% 0, 100% 100%); opacity: .72; }
.mountain-main { position: absolute; left: -7%; bottom: 0; width: 92%; height: 84%; background: linear-gradient(135deg, #4e8b76, #1e6b59); clip-path: polygon(0 100%, 61% 0, 100% 100%); }
.mountain-snow { position: absolute; left: 43%; top: 30px; width: 27%; height: 42px; background: #f7fcff; clip-path: polygon(0 0, 100% 0, 76% 60%, 58% 43%, 42% 76%, 24% 52%); }
.mountain-flag { position: absolute; left: 50%; top: 17px; font-size: 1.7rem; transform: translateX(-25%); }
.mountain-climber { position: absolute; left: 12%; bottom: 12%; z-index: 4; width: 58px; height: 58px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #102a43; background: #ffdf67; box-shadow: 0 4px 0 rgba(7,63,85,.28), 0 8px 20px rgba(0,0,0,.32); font-size: 2.25rem; line-height: 1; transform: translate(-50%, 50%); transition: left .8s ease, bottom .8s ease; }
.mascot-face { display: block; filter: drop-shadow(0 2px 0 rgba(255,255,255,.8)); }
.mascot-hand-flag { position: absolute; top: -24px; right: -23px; z-index: 5; font-size: 1.9rem; transform-origin: 20% 88%; }
.mountain-cheer-bubble { position: absolute; top: 48px; left: 13px; z-index: 6; min-width: 116px; padding: 7px 10px; border: 2px solid #0a5e75; border-radius: 14px 14px 14px 3px; color: #073f55; background: rgba(255,255,255,.96); box-shadow: 0 6px 15px rgba(7,63,85,.18); font-size: .76rem; font-weight: 950; line-height: 1.35; opacity: 0; }
.mountain-scene.is-celebrating .mountain-climber { animation: mascot-run-in 1.25s cubic-bezier(.2,.8,.25,1) both; }
.mountain-scene.is-celebrating .mascot-hand-flag { animation: mascot-flag-wave .52s ease-in-out 1.05s 6 alternate; }
.mountain-scene.is-celebrating .mountain-cheer-bubble { animation: mascot-bubble-pop .45s ease 1.12s both; }
.mountain-start, .mountain-total-label { position: absolute; padding: 3px 7px; border-radius: 999px; color: white; background: rgba(7,63,85,.82); font-size: .65rem; font-weight: 900; }
.mountain-start { left: 8px; bottom: 8px; letter-spacing: .08em; }
.mountain-total-label { left: 52%; top: 6px; transform: translateX(-50%); }
.mountain-score { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; color: var(--ink); }
.mountain-score strong { font-size: 1.3rem; font-weight: 950; }
.mountain-score span { color: var(--green); font-weight: 900; }
.mountain-meter { height: 10px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #dce7ed; }
.mountain-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--green), var(--gold)); transition: width .8s ease; }
.mountain-progress #celebration-progress-detail { margin: 8px auto 0; font-size: .82rem; line-height: 1.55; }
.milestone-cheer-panel { margin-top: 11px; padding: 12px; border: 1px solid #b9dcd4; border-radius: 15px; background: #f0fbf7; text-align: left; }
.milestone-cheer-panel > strong { display: block; color: #075f52; font-size: .96rem; }
.milestone-cheer-panel > span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .72rem; }
.milestone-name-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; align-items: end; margin-top: 9px; }
.milestone-name-controls label { grid-column: 1 / -1; color: var(--ink-soft); font-size: .7rem; font-weight: 800; }
.milestone-name-controls input, .learner-name-setting input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #a8c4d1; border-radius: 10px; color: var(--ink); background: white; font: inherit; }
.milestone-name-controls button, .learner-name-setting button { min-height: 40px; padding: 7px 10px; border: 0; border-radius: 10px; color: white; background: var(--blue); cursor: pointer; font-weight: 850; }
#replay-milestone-cheer { color: #075f52; background: #d5f5eb; }
.learner-name-setting { margin-bottom: 18px; padding: 12px; border-radius: 13px; background: #f3f8fb; }
.learner-name-setting > label { display: block; margin-bottom: 7px; font-weight: 850; }
.learner-name-setting > div { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.learner-name-setting small { display: block; margin-top: 7px; color: var(--ink-soft); line-height: 1.45; }
.milestone-learning-summary { position: relative; z-index: 1; width: min(100%, 480px); margin: 10px auto; padding: 17px; border: 1px solid #d6e2ea; border-radius: 20px; background: white; box-shadow: 0 12px 32px rgba(16,42,67,.1); text-align: left; }
.milestone-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.milestone-summary-head h2 { margin: 3px 0 0; color: var(--ink); font-size: 1.08rem; }
.milestone-summary-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #6c4700; background: #fff2bd; font-size: .72rem; font-weight: 900; }
.attempt-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 13px; }
.attempt-card { min-width: 0; padding: 10px 5px; border: 1px solid #dbe6ed; border-radius: 13px; background: #f6f9fb; text-align: center; }
.attempt-card strong { display: block; color: var(--ink); font-size: 1.45rem; line-height: 1; }
.attempt-card span { display: block; margin-top: 6px; color: var(--ink-soft); font-size: .66rem; font-weight: 800; line-height: 1.25; }
.attempt-card.first { border-color: #8edfc9; background: #edfbf7; }
.attempt-card.first strong { color: #087d68; }
.attempt-card.second { border-color: #b8d4f5; background: #f0f6ff; }
.attempt-card.third { border-color: #f1d08a; background: #fff9e9; }
.attempt-card.later { border-color: #efb0b8; background: #fff3f4; }
.milestone-mistakes { margin-top: 13px; padding: 12px; border-radius: 14px; background: #fff8ed; }
.milestone-mistakes-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #784f00; }
.milestone-mistakes-head span { padding: 3px 8px; border-radius: 999px; background: #ffe4a3; font-weight: 900; }
.milestone-mistake-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.milestone-word-chip { min-height: 34px; padding: 6px 10px; border: 1px solid #d99b26; border-radius: 999px; color: #5c3d00; background: white; cursor: pointer; font-weight: 850; }
.milestone-word-chip:hover, .milestone-word-chip:focus-visible { color: white; background: #9a6800; }
.milestone-perfect { color: #087d68; font-weight: 850; }
.milestone-mistakes small { display: block; margin-top: 9px; color: var(--ink-soft); font-size: .7rem; }
.celebration .celebration-reading-note { margin: 7px auto 10px; font-size: .9rem; }
.confetti, .confetti::before, .confetti::after { position: absolute; width: 10px; height: 20px; border-radius: 3px; background: var(--aqua); box-shadow: 80px 40px var(--gold), -90px 90px var(--blue), 140px 140px #ee6c75, -150px 190px var(--gold), 180px 260px var(--aqua), -210px 300px var(--blue); animation: confetti 3s linear infinite; }
.confetti { top: -30px; left: 48%; }
.confetti::before, .confetti::after { content: ""; }
.confetti::before { left: -260px; top: -120px; transform: rotate(40deg); }
.confetti::after { left: 230px; top: -40px; transform: rotate(-35deg); }

.passage-screen { padding-bottom: 30px; }
.passage-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 18px 0; }
.passage-head h1 { margin: 5px 0 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.word-count { color: var(--ink-soft); font-size: .8rem; }
.audio-player { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.audio-player button span { margin-left: 3px; }
.audio-player label { margin-left: auto; color: var(--ink-soft); font-size: .8rem; }
.audio-player select { min-height: 39px; margin-left: 5px; }
.passage-word-guide { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 15px; padding: 14px 16px; border: 1px solid #b9d2ef; border-radius: 15px; color: var(--blue-dark); background: #edf5ff; }
.passage-guide-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-family: Georgia, serif; font-weight: 900; }
.passage-word-guide strong { display: block; line-height: 1.5; font-size: .9rem; }
.passage-word-guide p { margin: 4px 0 0; color: var(--ink-soft); line-height: 1.6; font-size: .78rem; }
.passage-guide-sample { margin-right: 4px; padding: 1px 4px; border: 1px solid #54cdbb; border-bottom: 3px solid #0f9c89; border-radius: 4px; color: #073f55; background: #bff8e9; font-weight: 800; }
.passage-card { padding: clamp(24px, 5vw, 42px); border-radius: 24px; }
.passage-bilingual-text { display: grid; gap: 20px; }
.passage-sentence-pair { padding-bottom: 18px; border-bottom: 1px solid #e3ebf1; }
.passage-sentence-pair:last-child { padding-bottom: 0; border-bottom: 0; }
.passage-sentence-en { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.15rem, 3.7vw, 1.42rem); line-height: 1.75; }
.passage-sentence-ja { margin: 11px 0 0; padding: 11px 13px; border-left: 4px solid var(--aqua); border-radius: 0 10px 10px 0; color: var(--ink-soft); background: #f4f7f9; font-family: inherit; font-size: .9rem; line-height: 1.75; }
.passage-card .word-link { color: inherit; background: transparent; border-bottom: 1px dotted #92a4b4; font-weight: inherit; }
.passage-card .passage-keyword { margin: 0 1px; padding: 0 3px; border: 1px solid #54cdbb; border-bottom: 3px solid #0f9c89; border-radius: 4px; color: #073f55; background: #bff8e9; font-weight: 800; box-shadow: 0 1px 0 rgba(15,156,137,.15); }
.passage-card .passage-support-word:hover, .passage-card .passage-support-word:focus-visible { color: var(--blue); border-bottom-style: solid; }
.translation-toggle { width: 100%; min-height: 48px; margin-top: 25px; border: 1px solid #b9d2ef; border-radius: 13px; color: var(--blue-dark); background: #edf5ff; cursor: pointer; font-weight: 850; }
.translation-toggle:hover { background: #e2efff; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-up { from { transform: translate(-50%, 28px); opacity: 0; } }
@keyframes confetti { to { transform: translateY(110vh) rotate(420deg); } }
@keyframes correct-pop { 0% { transform: scale(.65); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes wrong-pop { 0% { transform: scale(.65); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes result-drop { from { opacity: 0; transform: translate(-50%, -18px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes mascot-run-in {
  0% { opacity: 0; transform: translate(-250px, 75px) rotate(-14deg) scale(.72); }
  45% { opacity: 1; transform: translate(-105px, 22px) rotate(8deg) scale(.9); }
  72% { transform: translate(-66%, 42%) rotate(-7deg) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, 50%) rotate(0) scale(1); }
}
@keyframes mascot-flag-wave { from { transform: rotate(-15deg); } to { transform: rotate(24deg); } }
@keyframes mascot-bubble-pop { from { opacity: 0; transform: translateY(8px) scale(.82); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 600px) {
  .quality-status { align-items: flex-start; flex-direction: column; gap: 2px; }
  .app-shell { padding: 0 14px 28px; }
  .topbar { min-height: 70px; }
  .topbar-actions { gap: 7px; }
  .tutorial-button { padding: 0 11px; }
  .level-overview { grid-template-columns: 92px minmax(0, 1fr); gap: 9px; margin-top: 2px; }
  .level-select-button { padding: 10px 11px; }
  .level-change-link { width: 100%; justify-content: center; margin-top: 0; }
  .field-selector { grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; padding: 10px 12px; }
  .field-selector select { width: 100%; }
  .field-selector small { display: none; }
  .exam-equivalents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-chip { min-width: 0; padding: 8px 9px; }
  .compact-progress { grid-template-columns: auto 1fr; gap: 10px 14px; margin: 7px 3px 18px; }
  .homepage-guide { margin-top: 26px; }
  .homepage-guide { margin-right: 2px; margin-left: 2px; }
  .homepage-banner-copy { left: 4.2%; width: 66%; }
  .homepage-banner-copy strong { font-size: clamp(1rem, 5.4vw, 1.45rem); }
  .homepage-banner-copy small { font-size: clamp(.68rem, 3.45vw, .96rem); }
  .homepage-guide-caption { padding: 11px 13px; }
  .homepage-guide-caption strong { font-size: .84rem; }
  .homepage-guide-caption > span { font-size: .7rem; }
  .next-goal { display: none; }
  .question-card { padding: 24px 17px 22px; border-radius: 22px; }
  .question-audio-toolbar { grid-template-columns: repeat(2, minmax(0,1fr)); margin: 14px 0 13px; padding: 9px; }
  .question-audio-toolbar button { min-height: 48px; padding: 7px 5px; font-size: .75rem; }
  #question-audio-status { grid-column: 1 / -1; }
  .instruction { margin-top: 27px; }
  .sentence { margin-bottom: 25px; font-size: 1.65rem; }
  .choice-audio-button { width: 100%; margin: -8px 0 11px; border-radius: 12px; }
  .choice-row { min-height: 57px; }
  .choice-main { padding: 12px 13px; gap: 11px; }
  .passage-head { align-items: start; }
  .audio-player label { width: 100%; margin: 2px 0 0; }
  .audio-player button { flex: 1; min-width: 92px; }
  .stats-grid { margin-left: 20px; margin-right: 20px; }
  .level-banner { margin-left: 20px; margin-right: 20px; }
  .settings-section, .dialog-head { padding-left: 20px; padding-right: 20px; }
  .tutorial-video-intro { margin-left: 20px; margin-right: 20px; }
  .tutorial-video-frame { padding: 0 14px 18px; }
  .tutorial-video-frame video { width: auto; max-width: 100%; height: min(66vh, 610px); }
  .level-dialog-intro, .conversion-note { margin-left: 20px; margin-right: 20px; }
  .level-options { padding-left: 20px; padding-right: 20px; }
  .level-option { grid-template-columns: 49px minmax(0, 1fr) auto; }
  .level-option-code { width: 44px; height: 44px; }
  .level-option-copy { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .level-option-exams { grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
  .level-option-status { grid-column: 3; grid-row: 1; justify-self: end; white-space: nowrap; }
  .unavailable-equivalents { grid-template-columns: repeat(2, 1fr); }
  .milestone-name-controls { grid-template-columns: 1fr 1fr; }
  .milestone-name-controls input { grid-column: 1 / -1; }

  .mobile-question-focus .question-card { padding: 16px 14px 17px; }
  .mobile-question-focus .field-chip { max-width: 104px; overflow: hidden; text-overflow: ellipsis; }
  .mobile-question-focus .instruction { margin: 14px 0 8px; }
  .mobile-question-focus .sentence { margin-bottom: 14px; font-size: 1.45rem; line-height: 1.38; }
  .mobile-question-focus .choices { gap: 7px; }
  .mobile-question-focus .choice-row { min-height: 50px; }
  .mobile-question-focus .choice-main { padding-top: 8px; padding-bottom: 8px; }

  /* 回答後は次問ボタンを常に親指の届く位置に表示する。 */
  .answer-complete #question-card { padding-bottom: 96px; }
  .answer-complete #next-question {
    position: fixed;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 14px;
    z-index: 55;
    width: auto;
    max-width: 572px;
    margin: 0 auto;
    box-shadow: 0 12px 30px rgba(16, 42, 67, .28);
  }
}

@media (max-width: 380px) {
  .tutorial-button { width: 44px; padding: 0; justify-content: center; }
  .tutorial-button small { display: none; }
}

@media (max-width: 340px) {
  .refresh-button { width: 44px; padding: 0; }
  .refresh-button small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
