.app-shell { background: #f4f8fe; border-color: #536d99; }
body { background-color: var(--sky-a); background-attachment: scroll; }
select:focus-visible, summary:focus-visible { outline: 3px solid #73cbe3; outline-offset: 2px; }
.encounter-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin: 12px 0 18px; }
.encounter-controls label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.encounter-controls select { padding: 8px; border: 1px solid var(--paper-line); border-radius: 6px; background: #fff; }
.app-header { background: #252848; color: #f7fbff; border-color: #42617e; }
.app-header .eyebrow { color: #9adddf; }
.brand-mark { color: #79d5e9; }
.brand h1 { font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif; }
.player-card { background: #17223c; border-color: #567387; color: #fff; }
.player-card span, .player-card small { color: #c0d5e8; }
.player-card strong { color: var(--gold); }
.tabbar { background: #e7eff8; overflow-x: auto; padding: 0 12px; }
.tab { min-width: 80px; flex: 1 0 auto; }
.paper-grain, .app-shell::before, .ambient-motes { display: none; }
button, select, input, summary { min-height: 44px; }
button, select, input, summary, p, h1, h2, h3, h4 { letter-spacing: 0; }
button, select, input { max-width: 100%; }
.grade-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border-bottom: 2px solid var(--paper-line); }
.grade-tabs button { border: 0; border-bottom: 3px solid transparent; color: var(--ink-soft); background: transparent; font-weight: 800; }
.grade-tabs button[aria-selected="true"] { color: var(--stamp-deep); border-color: var(--stamp); background: #e6f4fa; }
.region-scope { color: var(--ink-soft); font-size: 13px; }
.resume-button { margin-bottom: 20px; }
.line-panel { background: transparent; border-radius: 0; box-shadow: none; border: 0; padding: 12px 0 20px; }
.station-group { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.station-button { min-width: 0; text-align: left; background: #fff; }
.station-button.locked { background: #edf2f8; }
.station-bg { opacity: .45; }
.station-button.locked .station-bg { opacity: .25; }
.node-panel, .reward-preview, .settings-panel { background: transparent; border: 0; border-radius: 0; padding: 16px 0; }
.reward-preview { border-top: 1px solid var(--paper-line); }
.node-layout { display: block; }
.course-controls { display: flex; flex-wrap: wrap; gap: 16px; border: 0; padding: 12px 0; margin: 8px 0 16px; }
.course-controls legend { font-weight: 700; }
.course-controls label { display: grid; gap: 6px; font-size: 13px; }
.course-controls select { padding: 8px 12px; border: 1px solid var(--paper-line); border-radius: 6px; background: #fff; }
.rpg-quiz { max-width: 820px; margin: auto; }
.quiz-progress { padding-bottom: 12px; gap: 12px; }
.battle-stage { position: relative; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; background: #242940; color: #f2f7ff; border: 1px solid #77c3da; border-radius: 8px; margin-bottom: 18px; }
.battle-mode { position: absolute; top: 12px; left: 14px; color: #b6e4f2; font-size: 12px; }
[data-enemy-art] { width: 180px; height: 180px; flex: 0 0 auto; }
[data-enemy-art] svg { width: 100%; height: 100%; }
.enemy-hp { width: min(240px, 100%); display: grid; gap: 5px; text-align: center; font-size: 12px; margin-top: 8px; }
.enemy-hp progress { width: 100%; height: 12px; accent-color: #6bd7e4; }
.life-count { margin-top: 8px; color: #f1c971; font-weight: 700; }
.question-card { background: #fff; padding: 22px; border: 1px solid var(--paper-line); border-radius: 8px; }
.question-text { font-size: 20px; line-height: 1.9; font-weight: 700; margin-top: 10px; overflow-wrap: anywhere; }
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-button { min-height: 64px; border-radius: 6px; background: #f5f8fc; text-align: left; line-height: 1.75; padding: 14px; overflow-wrap: anywhere; }
.choice-button.correct { background: #e1f5ed; border-color: #268465; color: #174a3c; opacity: 1; }
.choice-button.wrong { background: #fbe9e7; border-color: #bd514d; color: #793430; opacity: 1; }
.feedback { line-height: 1.8; }
.feedback p { margin-bottom: 0; }
.stage-label { color: #765522; background: #fff7df; padding: 6px 10px; font-size: 12px; }
.question-data { margin: 12px 0; overflow-x: auto; }
.question-data figcaption { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.question-data table { width: 100%; border-collapse: collapse; font-size: 14px; }
.question-data th, .question-data td { border: 1px solid var(--paper-line); padding: 8px; text-align: left; }
.question-data th { background: #edf4fc; }
.somber .battle-stage { background: #eceef0; color: #434b53; border-color: #9ca5ad; }
.somber .battle-mode { color: #565f68; }
.somber [data-enemy-art] { width: 140px; height: 140px; }
.somber .primary-button { background: #505f6c; border-color: #505f6c; }
.equipment-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 22px; }
.equipment-slot { border: 1px solid var(--paper-line); background: #fff; border-radius: 6px; padding: 12px; display: grid; gap: 8px; align-content: start; font-size: 12px; overflow-wrap: anywhere; }
.equipment-slot svg { width: 52px; height: 52px; margin: auto; }
.gear-card.rare { border: 2px solid var(--gold); background: #fffcef; }
.gear-card.rare.somber { border-color: #87949d; background: #f1f3f5; }
.collection-card > svg { width: 92px; height: 92px; display: block; margin: auto; }
.collection-card button { width: 100%; margin-top: 10px; }
.skill-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--paper-line); font-size: 13px; }
.skill-summary span { display: grid; gap: 6px; }
.notebook-entry { padding: 18px 0; border-bottom: 1px solid var(--paper-line); line-height: 1.8; }
.notebook-entry p { color: var(--ink-soft); }
.notebook-entry summary { cursor: pointer; display: flex; align-items: center; }
.import-label { display: grid; gap: 10px; margin: 18px 0; font-weight: 700; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
rt { font-size: 10px; font-weight: 400; }
.result-guide { display: flex; align-items: center; gap: 16px; padding: 16px 0; text-align: left; border-bottom: 1px solid var(--paper-line); }
.result-guide svg { width: 80px; height: 80px; flex: 0 0 80px; }
.result-guide p { line-height: 1.8; margin-bottom: 0; }
.report-panel { background: #fff; padding: 0; border: 0; border-radius: 0; }
.result-panel { background: #fff; }
.middle-tier { border-left: 4px solid var(--gold); }
.middle-tier strong { color: #615011; }
.middle-controls { margin: 20px 0; padding-top: 16px; border-top: 1px solid var(--paper-line); }
.middle-controls h3 { margin: 0 0 10px; font-size: 16px; }
.middle-controls .tier-button { width: 100%; margin-top: 12px; }
.difficulty-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--paper-line); border-radius: 6px; overflow: hidden; }
.difficulty-tabs button { min-height: 44px; border: 0; border-right: 1px solid var(--paper-line); background: #f3f7fc; color: var(--ink); font: inherit; cursor: pointer; }
.difficulty-tabs button:last-child { border-right: 0; }
.difficulty-tabs button[aria-pressed="true"] { background: #dff4f8; color: #163f52; font-weight: 700; }
.source-materials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.source-materials .question-data { min-width: 0; margin: 0; }
.source-materials .question-data p { font-size: 14px; line-height: 1.8; margin: 0; padding: 12px; background: #f3f7fc; border-left: 3px solid #709ba9; }
.source-materials figcaption { color: #526471; font-weight: 700; }
.evidence-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.evidence-details ol { padding-left: 24px; margin-top: 4px; }
.evidence-details li { margin-bottom: 8px; }
.mistake-cue { color: #754017; font-size: 14px; }
.notebook-filter { display: grid; gap: 8px; font-size: 14px; margin: 18px 0; max-width: 380px; }
.notebook-filter select { min-height: 44px; width: 100%; font: inherit; color: var(--ink); padding: 8px; border: 1px solid var(--paper-line); border-radius: 6px; background: white; }
.quiz-progress { flex-wrap: wrap; gap: 8px; }
.quiz-progress strong { min-width: 0; overflow-wrap: anywhere; }
.middle-report { width: 100%; border-collapse: collapse; font-size: 13px; }
.middle-report th, .middle-report td { padding: 10px 6px; border-bottom: 1px solid var(--paper-line); text-align: left; }
.middle-report th:first-child { width: 45%; }
.middle-report td { white-space: nowrap; }
.middle-report small { display: block; margin-top: 4px; color: var(--ink-soft); font-weight: 400; }
.overall-report { background: #eef4fb; }
.report-weak { background: #f1f8fc; }
.ghost-button { background: #f3f7fc; }
.toast-root { pointer-events: none; }
.toast { background: #23354f; box-shadow: 0 8px 20px rgba(4, 10, 30, .2); }
.hanko-stamp-anim.play, .stamp-stage.kikitori .hanko-stamp-anim { opacity: 1; }
.achievement-overlay.show .achievement-modal { opacity: 1; transform: scale(1); }
@media (max-width: 760px) {
  body { padding: 0; }
  .app-shell { border-radius: 0; min-height: 100vh; border: 0; }
  .app-header { padding: 16px; }
  .brand h1 { font-size: 22px; line-height: 1.4; }
  .screen-frame { padding: 16px; }
  .question-card { padding: 16px; }
  .question-text { font-size: 18px; }
  .source-materials { grid-template-columns: minmax(0, 1fr); }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid.ox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .station-list.route .station-group { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .battle-stage { min-height: 260px; }
}
.middle-field { border-top: 2px solid var(--paper-line); margin-top: 24px; padding: 8px 0 20px; }
.middle-field h3 { font-size: 20px; }
.middle-course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.middle-course-card { min-width: 0; border: 1px solid var(--paper-line); border-radius: 8px; background: #fff; padding: 16px; display: flex; flex-direction: column; }
.middle-course-card > svg { position: static; inset: auto; height: 90px; width: 100%; background: #eff5f6; flex-shrink: 0; }
.middle-course-card h4 { font-size: 16px; line-height: 1.6; margin: 12px 0; min-height: 52px; }
.middle-course-card > button { width: 100%; margin-top: auto; }
.middle-course-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12px; padding: 12px 0; }
.middle-course-progress span { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.middle-course-progress strong { font-size: 16px; color: #255970; }
.middle-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.middle-levels button { min-width: 0; }
.middle-practice, .middle-written-list { margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--paper-line); }
.middle-written-list article, .written-entry { padding: 16px 0; border-bottom: 1px solid var(--paper-line); line-height: 1.8; }
.middle-written-list h4 { margin: 0 0 10px; font-size: 16px; }
.middle-written-list article > span { font-size: 13px; margin-right: 16px; }
.written-work .question-card { max-width: 980px; margin: 0 auto; }
.written-label { display: block; font-weight: 700; margin: 16px 0 8px; }
#written-response { width: 100%; min-height: 180px; resize: vertical; color: var(--ink); border: 1px solid #7e8b9d; border-radius: 6px; background: #fff; padding: 12px; font: inherit; line-height: 1.8; }
.written-response { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: #f0f6fa; border-left: 3px solid #709ba9; line-height: 1.8; }
.written-criterion { min-width: 0; padding: 12px; margin: 16px 0; border: 1px solid var(--paper-line); border-radius: 6px; }
.written-criterion legend { font-weight: 700; font-size: 15px; line-height: 1.8; }
.written-criterion label { min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.written-criterion input { width: 20px; height: 20px; flex: 0 0 20px; }
.model-answer summary, .written-entry summary { min-height: 44px; cursor: pointer; font-weight: 700; }
.model-answer p { line-height: 1.9; }
.written-saved { color: #216842; font-weight: 700; }
.written-report, .practice-report { width: 100%; border-collapse: collapse; font-size: 13px; }
.written-report th, .written-report td, .practice-report th, .practice-report td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--paper-line); }
.written-report th:first-child { width: 52%; }
.tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tabbar .tab { min-width: 0; }
@media (max-width: 900px) { .middle-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .tabbar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .middle-course-grid { grid-template-columns: minmax(0, 1fr); }
  .middle-levels { gap: 6px; }
  .middle-levels .tier-button { padding: 12px 8px; font-size: 13px; }
  .written-work .quiz-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .written-work .quiz-actions button { width: 100%; }
}
@media print { .grade-tabs, .resume-button { display: none !important; } .written-report tr, .practice-report tr, .middle-report tr { break-inside: avoid; } }
