@charset "UTF-8";

:root {
  --paper: #f7f5ee;
  --surface: #fffef9;
  --surface-muted: #eeece3;
  --ink: #252a25;
  --ink-soft: #4c554c;
  --muted: #676c60;
  --line: #dddccf;
  --line-strong: #b7baaa;
  --accent: #bd4c35;
  --accent-dark: #913622;
  --accent-wash: #f8e9df;
  --green: #47715a;
  --green-wash: #e9f0e6;
  --radius: 14px;
  --radius-small: 7px;
  --shadow: 0 4px 18px rgb(37 42 37 / 3%);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
/* Japanese inside English text, marked lang="ja" by app.js: neutral, so that no page rule for spans reaches it. */
.lang-ja, .lang-mix { all: unset !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; line-height: 1.18; letter-spacing: -.035em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1rem; }
p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.35rem; }
li + li { margin-top: .35rem; }
strong { font-weight: 650; }
small { font-size: .8rem; }
code { color: var(--ink-soft); font-size: .82em; padding: .15em .35em; border-radius: 4px; background: var(--surface-muted); overflow-wrap: anywhere; }
hr, .divider { height: 1px; margin: 2rem 0; border: 0; background: var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
details { margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius-small); padding: 1rem 1.2rem; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 1rem; }
blockquote { margin: 1.5rem 0; border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1.25rem; color: var(--ink-soft); }

.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.site-header { position: relative; border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .shell, .site-header.shell { min-height: 92px; display: flex; align-items: center; gap: 2.5rem; }
.brand { display: inline-flex; flex-shrink: 0; gap: 11px; align-items: center; font-size: 1.35rem; font-weight: 750; letter-spacing: -.06em; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { position: relative; display: inline-block; width: 33px; height: 33px; flex-shrink: 0; border-radius: 8px; background: var(--accent); color: transparent; overflow: hidden; }
.brand-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: .61rem; font-weight: 450; line-height: 1.5; letter-spacing: .025em; }
.brand-mark::before { content: ""; position: absolute; bottom: 8px; left: 7px; width: 7px; height: 10px; background: var(--paper); box-shadow: 12px 0 0 var(--paper); }
@media (forced-colors: active) { .brand-mark { forced-color-adjust: none; } }
.brand-mark::after { content: ""; position: absolute; top: 7px; left: 8px; width: 17px; height: 4px; background: var(--paper); border-radius: 1px; }
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1.8rem; }
.main-nav a { color: var(--ink-soft); font-size: .87rem; font-weight: 550; text-decoration: none; padding: .4rem 0; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent-dark); }
.main-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
.header-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-left: auto; }
.header-tools a { font-size: .78rem; font-weight: 550; }
.prototype-banner { border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-muted); font-size: .73rem; padding: 9px 0; }
.prototype-banner .shell { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.prototype-banner a { flex-shrink: 0; }
.page-layout { padding-top: 54px; padding-bottom: 72px; }
#main { padding-top: 28px; padding-bottom: 64px; }
.eyebrow { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; color: var(--accent-dark); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; padding: 15px 0 54px; }
.activity-hero { display: block; padding: 0 0 12px; }
.activity-hero .display-title { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: .6rem; }
.activity-hero .lede { font-size: 1rem; margin-bottom: .7rem; }
.activity-hero .eyebrow { margin-bottom: .6rem; }
.activity-hero .hero-side { display: none; }
.activity-intro { max-width: 850px; padding: 0 0 10px; }
.activity-intro h1 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: .65rem; }
.activity-intro > p:last-child { margin-bottom: .5rem; }
.introduction-panel .answer-button .translation { display: block; }
.introduction-panel .section-header { margin-top: 0; }
.hero-copy { max-width: 720px; }
.hero .header-tools, .practice-panel .header-tools { margin-left: 0; }
.display-title { max-width: 830px; margin-bottom: 1.35rem; font-size: clamp(2.6rem, 5.5vw, 4.65rem); font-weight: 620; line-height: 1.03; letter-spacing: -.055em; }
.display-title em { font-style: normal; color: var(--accent); }
.lede { max-width: 650px; color: var(--ink-soft); font-size: clamp(1.02rem, 1.8vw, 1.17rem); line-height: 1.75; margin-bottom: 1.75rem; }
.hero-side { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.hero-side h2 { font-size: 1.45rem; }
.hero-side > :last-child { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 46px; padding: .72rem 1.2rem; border: 1px solid var(--accent); border-radius: var(--radius-small); background: var(--accent); color: white; font-size: .87rem; font-weight: 600; line-height: 1.25; text-decoration: none; transition: background-color .15s, border-color .15s, transform .15s; }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }
.button:active { transform: translateY(1px); }
.button.secondary { color: var(--ink); border-color: var(--line-strong); background: transparent; }
.button.secondary:hover { color: var(--ink); border-color: var(--ink-soft); background: var(--surface-muted); }
.button.quiet { background: transparent; color: var(--ink-soft); border-color: transparent; }
.button.quiet:hover { color: var(--accent-dark); background: var(--accent-wash); }
.hero-copy .button + .button { margin-left: .5rem; }
.section-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem 2rem; margin: 2.2rem 0 1.4rem; }
.section-header h2 { margin-bottom: 0; }
.section-header p { max-width: 550px; color: var(--muted); font-size: .88rem; margin: .45rem 0 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; min-width: 0; padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s; }
a.card { color: var(--ink); text-decoration: none; }
a.card:hover { color: var(--ink); border-color: var(--accent); }
.card-label { margin-bottom: 2.1rem; color: var(--muted); font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; }
.card-title { margin-bottom: .8rem; font-size: 1.42rem; line-height: 1.25; }
.card-copy { color: var(--ink-soft); font-size: .9rem; line-height: 1.65; margin-bottom: 1.3rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: auto; padding-top: .9rem; color: var(--muted); font-size: .72rem; }
.text-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--accent-dark); font-size: .86rem; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.route { display: inline-block; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .73rem; line-height: 1.5; overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; width: fit-content; padding: 3px 8px; border-radius: 4px; background: var(--surface-muted); color: var(--ink-soft); font-size: .66rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tag.release { color: var(--green); background: var(--green-wash); }
.tag.future { color: #876533; background: #f5eddc; }
.tag.utility { color: var(--muted); background: var(--surface-muted); }
.page-tabs, .lesson-tabs { display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; border: 1px solid var(--line); border-radius: 9px; width: fit-content; margin: .2rem 0 2rem; background: var(--surface-muted); }
.tab-button, .lesson-tab { border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); padding: .6rem 1rem; font-size: .8rem; font-weight: 550; line-height: 1.35; }
.tab-button:hover, .lesson-tab:hover { color: var(--ink); }
.tab-button.active, .lesson-tab.active, .tab-button[aria-selected="true"], .lesson-tab[aria-selected="true"] { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: 0 1px 3px rgb(37 42 37 / 4%); }
.content-panel { min-width: 0; }
.content-panel h1 { font-size: clamp(2rem, 3.8vw, 3.3rem); max-width: 950px; margin-bottom: .75rem; }
.brief-block dl { margin: .4rem 0; }
.brief-block dt { margin-top: .9rem; }
.brief-block dd { margin: .2rem 0 .65rem; }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.brief-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px; min-width: 0; }
.brief-block.wide { grid-column: 1 / -1; }
.brief-block h2, .brief-block h3 { font-size: 1.03rem; margin-bottom: 1rem; }
.brief-block p, .brief-list { color: var(--ink-soft); font-size: .88rem; }
.brief-block > :last-child { margin-bottom: 0; }
.brief-list { margin: 0; padding-left: 1.2rem; }
.brief-list li + li { margin-top: .6rem; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.metric { border-left: 1px solid var(--line); padding-left: 1.25rem; }
.metric:first-child { border-left: 0; padding-left: 0; }
.metric strong { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -.045em; line-height: 1.25; }
.metric span, .metric small { display: block; color: var(--muted); font-size: .73rem; margin-top: .35rem; }
.callout, .notice { padding: 1.1rem 1.25rem; margin: 1.4rem 0; border-radius: var(--radius-small); border-left: 3px solid var(--accent); background: var(--accent-wash); color: var(--ink-soft); font-size: .87rem; }
.callout p:last-child, .notice p:last-child { margin-bottom: 0; }
.notice { background: var(--surface-muted); border-left-color: var(--line-strong); }
.storage-alert { position: relative; z-index: 60; max-width: 36rem; margin: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: var(--radius-small); background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px rgb(37 42 37 / 18%); font-size: .9rem; line-height: 1.5; }
.storage-alert p { flex: 1 1 16rem; margin: 0; }
.storage-alert button { min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--muted); border-radius: var(--radius-small); background: var(--surface); color: var(--ink); }
.hiragana-breadcrumb { display:flex;flex-wrap:wrap;gap:.5rem;margin:2rem 0 0;font-size:.85rem;line-height:1.5; }
html.poster .hiragana-breadcrumb { display:none; }
@media print { .storage-alert, .hiragana-breadcrumb { display: none; } }
.scope-note { margin: 1.5rem 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.study-strip { margin: 1rem 0; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-small); }
.study-grid { display: flex; flex-wrap: wrap; gap: .65rem; }
.study-grid .kana-cell { min-width: 65px; min-height: 70px; }
.comparison { display: flex; flex-wrap: wrap; gap: 1rem; padding: .8rem 0; }
.comparison > div { border: 1px solid var(--line); border-radius: var(--radius-small); padding: .7rem 1rem; }
.reading-support { color: var(--accent-dark); font-size: .9rem; margin: .25rem 0 .7rem; }
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: .76rem; }
.site-footer .shell, .site-footer.shell { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer a + a { margin-left: 1.1rem; }

.review-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: 1rem 0 1.5rem; }
.search-input { flex: 1; min-width: 220px; min-height: 42px; padding: .55rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-small); color: var(--ink); background: var(--surface); }
.search-input::placeholder { color: var(--muted); }
.filter-button { min-height: 40px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: transparent; color: var(--ink-soft); font-size: .76rem; font-weight: 550; }
.filter-button:hover { border-color: var(--ink-soft); }
.filter-button.active, .filter-button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.sitemap-list { display: flex; flex-direction: column; gap: 2rem; }
.sitemap-group { min-width: 0; }
.sitemap-group > h2 { margin: 0 0 .7rem; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sitemap-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(160px, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1.1rem 1.25rem; margin-bottom: -1px; background: var(--surface); border: 1px solid var(--line); }
.sitemap-row:first-of-type { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.sitemap-row:last-of-type { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.sitemap-title { margin: 0 0 .3rem; font-size: .94rem; font-weight: 600; }
.sitemap-title a { text-decoration: none; }
.sitemap-title h3 { margin: .6rem 0 .25rem; font-size: 1rem; line-height: 1.4; }
.sitemap-title .route { margin-bottom: .4rem; }
.sitemap-title .card-copy { max-width: 580px; margin: 0; font-size: .78rem; font-weight: 400; }
.sitemap-meta { display: flex; flex-wrap: wrap; gap: .4rem .65rem; align-items: center; color: var(--muted); font-size: .73rem; }
.sitemap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.sitemap-actions .button { min-height: 34px; padding: .4rem .7rem; font-size: .72rem; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted); }
.content-switch { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 1rem 0; color: var(--muted); font-size: .8rem; }

.kana-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0 2rem; }
.hero-kana { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.7rem 0 1.2rem; }
.kana-cell { display: flex; flex-direction: column; gap: .2rem; justify-content: center; align-items: center; min-height: 87px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: .6rem .4rem; font-size: 1.8rem; line-height: 1.25; }
.kana-cell span, .kana-cell small { font-size: .69rem; color: var(--muted); }
.kana-cell .jp { color: var(--ink); font-size: 2rem; line-height: 1.4; }
.kana-cell:hover { border-color: var(--accent); background: var(--accent-wash); }
.kana-cell.selected, .kana-cell[aria-pressed="true"] { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-wash); }
.kana-cell.selected span, .kana-cell[aria-pressed="true"] span { color: var(--accent-dark); }
.practice-panel { max-width: 840px; margin: 1rem 0; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.practice-panel > .section-header { margin: 0 0 .8rem; }
.practice-panel > .section-header h2 { font-size: clamp(1.45rem, 2.8vw, 1.8rem); }
.practice-panel .review-toolbar { padding: .5rem 0; }
[data-kana-study] h3 { margin-bottom: .4rem; }
[data-kana-study] .scope-note { margin: .5rem 0 .75rem; }
[data-kana-study] .kana-grid { margin: .6rem 0 .85rem; }
[data-kana-study] .header-tools + .scope-note { margin-top: .8rem; }
.practice-prompt { padding: .7rem 0 1rem; text-align: center; font-size: clamp(3.5rem, 8vw, 4.5rem); font-weight: 500; line-height: 1.2; }
.practice-prompt.jp { font-size: clamp(3.5rem, 8vw, 4.5rem); line-height: 1.2; margin: 0; }
.practice-prompt.jp.phrase-prompt { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.5; overflow-wrap: anywhere; }
.practice-prompt p { font-size: .9rem; color: var(--ink-soft); }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
[data-intro-answers="respond"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-intro-answers="respond"] .answer-button { text-align: left; }
[data-intro-answers="respond"] .jp { display: block; font-size: 1.1rem; line-height: 1.65; }
.partner-reference { margin: .7rem 0 1rem; padding: .6rem .8rem; font-size: .82rem; }
.partner-reference p:last-child { margin-bottom: 0; }
.answer-button { padding: .85rem 1rem; min-height: 58px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--paper); color: var(--ink); font-size: 1.05rem; font-weight: 550; }
.answer-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-wash); }
.answer-button.correct { color: var(--green); background: var(--green-wash); border-color: var(--green); opacity: 1; }
.answer-button.incorrect { color: var(--accent-dark); background: var(--accent-wash); border-color: var(--accent); opacity: 1; }
.feedback { min-height: 30px; margin: 1rem 0; padding: .65rem 0; color: var(--ink-soft); font-size: .88rem; }
.feedback.success { color: var(--green); }
.feedback.error { color: var(--accent-dark); }
.progress-track { height: 4px; width: 100%; background: var(--surface-muted); overflow: hidden; border-radius: 4px; margin: 1rem 0; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .2s; }
.mini-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; font-size: .74rem; color: var(--muted); }
.continue-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 2rem; padding: 1.25rem 1.5rem; border: 1px solid #ccd7c7; border-radius: var(--radius); background: var(--green-wash); }
.continue-card h2, .continue-card h3 { margin-bottom: .3rem; font-size: 1.1rem; }
.continue-card p { color: var(--green); font-size: .82rem; margin-bottom: 0; }
.dialogue { max-width: 840px; margin: 1.5rem 0; border-top: 1px solid var(--line); }
.dialogue-line { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.speaker { color: var(--muted); font-size: .73rem; font-weight: 600; padding-top: .35rem; }
.jp { font-family: var(--font); font-size: 1.4rem; line-height: 1.85; letter-spacing: .01em; }
.translation { color: var(--muted); font-size: .82rem; line-height: 1.6; margin-top: .3rem; }
.dialogue-line p:last-child { margin-bottom: 0; }
.dialogue-line .jp, .dialogue-line .translation { grid-column: 2; }
.dialogue-line .jp { margin-bottom: 0; }
.step-list { counter-reset: learning-step; display: flex; flex-direction: column; gap: 1.3rem; list-style: none; padding: 0; margin: 1.5rem 0; }
.step { counter-increment: learning-step; position: relative; padding-left: 44px; color: var(--ink-soft); font-size: .88rem; }
.step::before { content: counter(learning-step, decimal-leading-zero); position: absolute; left: 0; top: .1rem; color: var(--accent); font-size: .73rem; font-weight: 650; letter-spacing: .05em; }
.step h3 { margin: 0 0 .35rem; font-size: .98rem; }
.step p { margin-bottom: 0; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { z-index: 10; top: 12px; left: 12px; width: auto; height: auto; padding: .75rem 1rem; margin: 0; clip: auto; overflow: visible; border-radius: var(--radius-small); background: var(--surface); color: var(--ink); }

@media (min-width: 1450px) {
  .page-layout { padding-top: 65px; }
  .hero { padding-bottom: 72px; }
}
@media (max-width: 980px) {
  .shell { width: min(1200px, calc(100% - 48px)); }
  .site-header .shell, .site-header.shell { gap: 1.5rem; min-height: 82px; }
  .main-nav { gap: 1.2rem; }
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(230px, .8fr); gap: 2rem; }
  .hero-side { padding: 22px; }
  .card { padding: 23px; }
  .sitemap-row { grid-template-columns: minmax(0, 1.4fr) minmax(130px, 1fr) auto; gap: .85rem; }
  .header-tools .button { padding-inline: .7rem; }
}
@media (max-width: 760px) {
  /* Phone header: one compact row. The navigation scrolls sideways if it does not fit. */
  .site-header .shell, .site-header.shell { flex-wrap: nowrap; gap: 14px; min-height: 0; padding-top: 9px; padding-bottom: 9px; }
  .brand { font-size: 1.1rem; }
  .brand-subtitle { display: none; }
  .site-header .header-tools { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .header-tools { margin-left: auto; }
  .main-nav { order: 0; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; gap: 1rem; padding-top: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a:last-child { padding-right: 24px; }
  .main-nav a { font-size: .8rem; }
  .page-layout { padding-top: 36px; padding-bottom: 48px; }
  .hero { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 0; padding-bottom: 28px; }
  .hero-copy { max-width: 640px; }
  .display-title { max-width: 600px; font-size: clamp(2.7rem, 7.8vw, 3.8rem); }
  .hero-side { padding: 24px; }
  .kana-hero .hero-side { display: none; }
  .kana-hero { padding-bottom: 4px; }
  .card-grid, .card-grid.three { grid-template-columns: 1fr; }
  .card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-label { margin-bottom: 1.2rem; }
  .card-title { font-size: 1.25rem; }
  .brief-grid { grid-template-columns: 1fr; }
  .sitemap-row { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .sitemap-row > .sitemap-meta { grid-column: 1; grid-row: 2; }
  .sitemap-actions { grid-column: 2; grid-row: 1 / 3; }
  .prototype-banner .shell { font-size: .7rem; }
  .metric strong { font-size: 1.4rem; }
  .jp { font-size: 1.25rem; }
}
@media (max-width: 480px) {
  .shell { width: calc(100% - 32px); }
  .header-tools a { font-size: .71rem; }
  .header-tools .button { min-height: 34px; padding: .4rem .6rem; }
  .main-nav { gap: .9rem; }
  .main-nav a { font-size: .75rem; }
  .prototype-banner .shell { flex-wrap: wrap; gap: .25rem; }
  .display-title { font-size: 2.75rem; }
  .eyebrow { font-size: .66rem; margin-bottom: 1rem; }
  .lede { font-size: 1rem; }
  .hero-copy .button + .button { margin-left: 0; margin-top: .5rem; }
  .card-grid.two { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .page-tabs, .lesson-tabs { width: 100%; }
  .tab-button, .lesson-tab { flex: 1; padding: .6rem .55rem; font-size: .74rem; }
  .brief-block { padding: 21px; }
  .metric-row { gap: .6rem; }
  .metric { padding-left: .7rem; }
  .metric strong { font-size: 1.25rem; }
  .metric span, .metric small { font-size: .66rem; }
  .search-input { flex-basis: 100%; min-width: 0; }
  .filter-button { flex: 1; padding-inline: .5rem; font-size: .7rem; }
  .sitemap-row { padding: 1rem; }
  .sitemap-title { font-size: .85rem; }
  .sitemap-actions .button { font-size: .68rem; padding: .4rem .55rem; }
  .kana-grid { gap: .4rem; }
  .kana-cell { min-height: 72px; font-size: 1.5rem; }
  .kana-cell .jp { font-size: 1.7rem; }
  .kana-cell span, .kana-cell small { font-size: .62rem; }
  .practice-panel { padding: 18px; }
  .practice-prompt { padding-block: .65rem .8rem; }
  [data-intro-answers="respond"] { grid-template-columns: 1fr; }
  .answer-button { min-height: 54px; }
  .dialogue-line { grid-template-columns: 45px minmax(0, 1fr); gap: .65rem; }
  .speaker { font-size: .65rem; }
  .jp { font-size: 1.1rem; }
  .site-footer .shell, .site-footer.shell { flex-direction: column; align-items: flex-start; gap: .7rem; }
  table { font-size: .76rem; }
  th, td { padding: .55rem .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
}
@media print {
  body { background: white; font-size: 11pt; }
  .shell { width: 100%; }
  .site-header, .prototype-banner, .header-tools, .review-toolbar, .page-tabs, .site-footer { display: none; }
  .page-layout { padding: 0; }
  .hero { display: block; padding: 0; }
  .hero-side { margin: 20px 0; }
  .card, .brief-block, .sitemap-row { box-shadow: none; break-inside: avoid; }
  .display-title { font-size: 32pt; }
}
