:root {
  color-scheme: light;
  --paper: #f7f7ef;
  --ink: #18382e;
  --muted: #51655b;
  --rule: #d6ded1;
  --green: #cce6a8;
  --orange: #a13e27;
  --white: #fffefa;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body, p, h1, h2, h3 { margin: 0; }
body { display: flex; min-height: 100vh; flex-direction: column; }
main { flex: 1; }
button { cursor: pointer; font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
[hidden] { display: none !important; }
[lang="ja"] { font-family: 'Yu Gothic', Meiryo, 'Hiragino Kaku Gothic ProN', sans-serif; }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; padding: 12px; background: var(--white); z-index: 5; }
.skip:not(:focus) { clip-path: inset(50%); }
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; text-decoration: none; letter-spacing: -.06em; font-size: 1.14rem; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--paper); background: var(--ink); font-size: 1.25rem; }
nav { display: flex; flex-wrap: wrap; gap: 24px; }
nav a, .footer-inner a { text-decoration: none; font-size: .9rem; font-weight: 750; }
nav a:hover, .footer-inner a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero { display: grid; grid-template-columns: 1.14fr 1fr; gap: clamp(24px, 6vw, 80px); align-items: center; padding: clamp(46px, 7vw, 100px) 0 clamp(42px, 6vw, 76px); border-bottom: 1px solid var(--rule); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--orange); margin-bottom: 16px; font-weight: 800; font-size: .88rem; letter-spacing: .055em; }
.eyebrow span { width: 18px; border-top: 2px solid currentColor; }
h1 { font-size: clamp(2.55rem, 5.35vw, 4.75rem); line-height: 1.12; letter-spacing: -.085em; font-weight: 900; }
h1 em { color: var(--orange); font-style: normal; }
.hero-text { color: var(--muted); font-size: 1.1rem; margin-block: 22px 25px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 10px 20px; border: 1px solid var(--ink); border-radius: 8px; font-weight: 800; text-decoration: none; color: var(--ink); background: var(--white); }
.button:hover { background: var(--green); color: var(--ink); }
.button-dark { color: var(--white); background: var(--ink); }
.button[aria-pressed="true"] { background: var(--green); }
.ticket { position: relative; border: 1px solid var(--ink); border-radius: 18px; box-shadow: 9px 9px 0 #dce5d5; background: var(--green); overflow: hidden; }
.ticket-top, .ticket-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px clamp(18px, 3vw, 30px); }
.ticket-top { background: var(--ink); color: var(--white); font-size: .9rem; font-weight: 750; }
.ticket-top [lang="ja"] { color: var(--green); font-size: 1.2rem; }
.ticket-body { padding: 24px clamp(18px, 3vw, 30px); }
.phrase { font-weight: 850; font-size: clamp(2.05rem, 4vw, 3.45rem); letter-spacing: -.05em; line-height: 1.25; }
.translation { font-size: 1.13rem; font-weight: 750; margin-top: 8px; }
.ticket-note { color: #315245; margin-top: 12px; }
.ticket-footer { border-top: 1px dashed #587552; }
.audio { background: transparent; color: var(--ink); border: 1px solid currentColor; border-radius: 100px; padding: 6px 13px; min-height: 40px; font-weight: 750; font-size: .9rem; }
.audio:hover { background: var(--ink); color: var(--white); }
.audio span { margin-right: 4px; }
.barcode { flex: 0 1 82px; height: 25px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px, var(--ink) 14px 15px, transparent 15px 18px); }
.audio-status { color: var(--orange); font-size: .9rem; }
.audio-status:not(:empty) { padding-top: 12px; }
.standalone-note { margin-top: 12px; }
.study-hub { padding: clamp(36px, 7vw, 76px) 0 56px; }
.screen-title { max-width: 100%; font-size: clamp(1.85rem, 4vw, 3rem); line-height: 1.22; letter-spacing: -.065em; }
.study-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 25px; }
.study-option { display: grid; grid-template-rows: auto auto 1fr; gap: 9px; padding: clamp(16px, 3vw, 27px); border: 1px solid var(--rule); border-radius: 13px; background: var(--white); text-decoration: none; }
.study-option:hover { border-color: var(--ink); background: #edf4e2; }
.study-option h2 { font-size: clamp(1.15rem, 2.5vw, 1.55rem); }
.study-option p { color: var(--muted); }
.kana-icon { background: var(--green); }
.dialogue-icon { background: #ffe6d8; }
.jlpt-icon { background: #dde9fa; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-weight: 750; text-underline-offset: 4px; }
.course-section { padding: 36px 0 45px; }
.course-panel { padding: clamp(14px, 3vw, 27px); border: 1px solid var(--rule); border-radius: 14px; background: var(--white); }
.course-panel .audio-status:not(:empty) { margin: 8px 0 14px; padding: 0; }
.course-note { color: var(--muted); }
.study-switches, .button-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.study-switches { gap: 10px 24px; margin-bottom: 14px; }
.study-switches .button, .level-switch .button { padding-inline: 13px; }
.kana-grid { display: grid; gap: 6px; margin-top: 16px; width: min(100%, 720px); }
.kana-row { display: grid; grid-template-columns: 25px repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 6px; }
.kana-grid-three .kana-row { grid-template-columns: 25px repeat(3, minmax(0, 1fr)); }
.kana-row-label { align-self: center; color: var(--muted); font-weight: 800; }
.kana-cell, .kana-gap { border: 1px solid var(--rule); border-radius: 8px; }
.kana-cell { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 55px; padding: 4px 2px; color: var(--ink); background: var(--white); }
.kana-cell:hover { border-color: var(--ink); background: #ecf4e2; }
.kana-cell span { font-size: clamp(1.16rem, 3.4vw, 1.65rem); font-weight: 750; line-height: 1.25; }
.kana-cell small { color: var(--muted); font-size: .875rem; }
.kana-gap { border-style: dashed; }
.kana-note { margin-top: 14px; font-size: .94rem; }
.sound-group { margin-top: 19px; }
.sound-group h2 { margin-bottom: 4px; font-size: 1.13rem; }
.sound-group h2 span { color: var(--muted); font-size: 1rem; }
.sound-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-top: 9px; }
.lessons { padding: 34px 0 48px; scroll-margin-top: 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.32rem); line-height: 1.25; letter-spacing: -.065em; }
.progress { display: grid; gap: 5px; align-items: center; font-weight: 750; font-size: .9rem; }
progress { display: block; width: 110px; height: 8px; appearance: none; border: 0; border-radius: 6px; background: var(--rule); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--rule); }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }
.lesson-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.lesson-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 19px; border: 1px solid var(--rule); border-radius: 13px; background: var(--white); }
.lesson-card:has(button[aria-expanded="true"]) { border-color: var(--ink); }
.lesson-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; font-size: 1.45rem; font-weight: 800; }
.food { background: #ffe6d8; } .train { background: #dde9fa; } .shopping { background: #ededcb; }
.lesson-card h2, .study-panel h2 { font-size: 1.25rem; letter-spacing: -.045em; }
.lesson-card p { color: var(--muted); }
.lesson-card .button { justify-self: start; margin-top: 7px; }
.study-panel { margin-top: 18px; padding: clamp(16px, 3vw, 30px); background: var(--white); border: 1px solid var(--rule); border-radius: 13px; scroll-margin-top: 16px; }
.study-panel h2 { font-size: 1.5rem; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dialogue-controls { margin-bottom: 12px; }
.study-panel .audio-status:not(:empty) { margin-bottom: 12px; padding-top: 0; }
.dialogue { display: grid; gap: 10px; padding: 0; margin: 0 0 18px; list-style: none; }
.dialogue-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; width: min(94%, 760px); border: 1px solid var(--rule); border-radius: 12px; padding: 13px 15px; background: var(--paper); }
.learner-line { margin-left: auto; border-color: #b2cb92; background: #ecf4e2; }
.speaker { font-size: .88rem; font-weight: 800; color: var(--muted); }
.study-ja { font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.reading { color: var(--muted); font-size: .9rem; }
.meaning { margin-top: 4px; }
.tip { border-left: 3px solid var(--ink); padding-left: 12px; margin-bottom: 18px; color: var(--muted); }
.tip strong { display: block; color: var(--ink); }
.completion-status:not(:empty) { margin-top: 8px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.jlpt-intro { margin: -7px 0 16px; }
.level-switch { margin-bottom: 17px; }
.level-switch .button { min-width: 46px; }
.jlpt-mode-switch { padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 17px; }
.quiz-kind-title { margin-bottom: 6px; font-size: .92rem; font-weight: 800; }
.quiz-kind-switch { margin-bottom: 14px; }
.quiz-kind-switch .button { column-gap: 5px; padding-inline: 12px; }
.quiz-kind-count { color: var(--muted); font-size: .875rem; font-weight: 650; }
.quiz-format-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-bottom: 18px; }
.quiz-format-switch label { font-weight: 800; }
.quiz-format-switch select { width: min(100%, 340px); min-height: 43px; padding: 7px 30px 7px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: .92rem; font-weight: 800; }
.quiz-question, .quiz-result h2 { font-size: clamp(1.18rem, 3vw, 1.65rem); line-height: 1.45; letter-spacing: -.025em; }
.quiz-question, .quiz-feedback, .quiz-result h2 { scroll-margin-top: 12px; }
.quiz-passage, .quiz-transcript p { max-width: 54rem; padding: 12px 15px; margin-bottom: 12px; border-radius: 9px; background: var(--paper); line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.quiz-passage mark { padding: 2px 4px; border-radius: 4px; background: var(--green); color: var(--ink); font-weight: 800; }
.quiz-instruction { margin-bottom: 6px; color: var(--muted); font-size: .94rem; }
.quiz-table-wrap { max-width: 54rem; margin-bottom: 14px; border: 1px solid var(--rule); border-radius: 8px; overflow-x: auto; }
.quiz-table-wrap table { width: 100%; min-width: 360px; border-collapse: collapse; text-align: left; }
.quiz-table-wrap th, .quiz-table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.quiz-table-wrap th { background: #ecf4e2; }
.quiz-table-wrap tr:last-child td { border-bottom: 0; }
.quiz-scene { width: min(100%, 340px); margin: 0 0 12px; padding: 12px 16px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); text-align: center; }
.scene-setting { display: block; font-size: 1.6rem; }
.scene-actors { display: flex; justify-content: space-around; align-items: center; font-size: 2.15rem; }
.scene-speaker { position: relative; padding: 4px 8px; border-radius: 9px; background: #deedc3; }
.scene-speaker b { position: absolute; top: -5px; left: -2px; color: var(--orange); font-size: .95rem; }
.quiz-listening { margin-top: 10px; }
.quiz-transcript { margin-top: 7px; }
.quiz-transcript summary { color: var(--muted); cursor: pointer; font-weight: 750; }
.quiz-transcript p { margin-top: 7px; }
.quiz-options { display: grid; gap: 8px; margin: 15px 0; }
.quiz-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); color: var(--ink); text-align: left; }
.quiz-option:hover:enabled { border-color: var(--ink); background: var(--paper); }
.quiz-option:disabled { cursor: default; opacity: 1; }
.option-number { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--paper); font-weight: 800; }
.option-result { margin-inline-start: auto; flex-shrink: 0; font-size: .875rem; }
.quiz-option.is-correct { border-color: #7b9c5b; background: #ecf4e2; }
.quiz-option.is-wrong { border-color: #cd8c7a; background: #fff1ea; }
.quiz-feedback { padding: 13px 15px; margin-bottom: 12px; border-left: 3px solid #7b9c5b; border-radius: 0 8px 8px 0; background: #ecf4e2; }
.quiz-feedback.is-wrong { border-color: #cd8c7a; background: #fff1ea; }
.feedback-title { margin-bottom: 4px; font-weight: 800; }
.feedback-title span { margin-inline-start: 8px; color: var(--muted); font-size: .92rem; }
.quiz-result .actions { margin-top: 15px; }
#jlpt-material > h2 { font-size: clamp(1.22rem, 2.5vw, 1.55rem); letter-spacing: -.04em; }
.jlpt-part { margin-top: 18px; }
.jlpt-part h3 { font-size: 1rem; margin: 0 0 7px; }
.word-list, .grammar-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.word-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grammar-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-card, .grammar-card, .jlpt-passage { padding: 13px; background: var(--paper); border: 1px solid var(--rule); border-radius: 9px; }
.word-card .audio, .grammar-card .audio, .jlpt-passage .audio { margin-top: 8px; }
.grammar-card .study-ja { margin-block: 7px 2px; font-size: 1.05rem; }
.passage { max-width: 52rem; line-height: 1.8; }
.passage-translation { margin-top: 12px; }
.passage-translation summary { cursor: pointer; font-weight: 800; }
.passage-translation p { margin-top: 8px; max-width: 52rem; }
footer { border-top: 1px solid var(--rule); color: var(--muted); }
footer span { font-weight: 800; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .hero { grid-template-columns: 1fr; }
  .ticket { max-width: 490px; margin-right: 9px; }
  .lesson-list, .study-options { grid-template-columns: 1fr; }
  nav { gap: 12px; }
}
@media (max-width: 500px) {
  .header-inner { flex-wrap: wrap; padding-block: 12px; gap: 8px 14px; }
  .hero-text br { display: none; }
  .kana-row { grid-template-columns: 17px repeat(5, minmax(0, 1fr)); gap: 4px; }
  .kana-grid-three .kana-row { grid-template-columns: 17px repeat(3, minmax(0, 1fr)); }
  .word-list, .grammar-list { grid-template-columns: 1fr; }
}
