:root {
  color-scheme: light;
  --ink: #172027;
  --muted: #5f6c74;
  --line: #dbe4e8;
  --paper: #fbfcfb;
  --soft: #eef5f1;
  --mint: #2f7d66;
  --mint-dark: #1f5f50;
  --coral: #d85f48;
  --gold: #c59b37;
  --blue: #386f9f;
  --shadow: 0 18px 40px rgba(18, 32, 38, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: 82vh;
  overflow: hidden;
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
}

.hero__image,
.hero__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
}

.hero__overlay {
  background:
    linear-gradient(90deg, rgba(13, 30, 34, 0.82) 0%, rgba(13, 30, 34, 0.57) 46%, rgba(13, 30, 34, 0.16) 100%),
    linear-gradient(0deg, rgba(8, 18, 20, 0.45), rgba(8, 18, 20, 0.1));
}

.topbar,
.hero__content {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: "Noto Sans JP", sans-serif;
}

.topbar__actions {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(23, 32, 39, 0.13);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}

.topbar .icon-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero__content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  align-self: center;
  padding: 20px 0 104px;
}

.eyebrow,
.kicker,
.lesson__book {
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow {
  color: #ffd999;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: 5.4rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 610px;
  margin-bottom: 26px;
  font-size: 1.12rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
}

body[data-view="vocabulary"] .hero,
body[data-view="common"] .hero,
body[data-view="kana"] .hero {
  min-height: 360px;
}

body[data-view="vocabulary"] .hero__content,
body[data-view="common"] .hero__content,
body[data-view="kana"] .hero__content {
  align-self: end;
  padding-bottom: 86px;
}

body[data-view="vocabulary"] h1,
body[data-view="common"] h1,
body[data-view="kana"] h1 {
  font-size: 3.4rem;
  max-width: 820px;
}

body[data-view="vocabulary"] .hero__copy,
body[data-view="common"] .hero__copy,
body[data-view="kana"] .hero__copy {
  max-width: 760px;
  margin-bottom: 18px;
}

body[data-view="vocabulary"] .hero__controls,
body[data-view="common"] .hero__controls,
body[data-view="kana"] .hero__controls {
  display: none;
}

.hero__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  min-width: 92px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-weight: 700;
}

.segmented.is-active {
  background: #fff;
  color: var(--ink);
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mode-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
}

.mode-tab.is-active {
  background: var(--coral);
  border-color: var(--coral);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: grid;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: -58px auto 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 22px;
  align-items: start;
}

.chapter-panel,
.lesson {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chapter-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.panel-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.panel-head h2,
.lesson__mast h2 {
  margin-bottom: 0;
}

.kicker,
.lesson__book {
  color: var(--mint-dark);
}

select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.chapter-list {
  display: grid;
  max-height: calc(100vh - 162px);
  overflow: auto;
}

.chapter-button {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 15px 18px;
  text-align: left;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.chapter-button:hover,
.chapter-button.is-active {
  background: var(--soft);
}

.chapter-button.is-active {
  box-shadow: inset 4px 0 0 var(--mint);
}

.chapter-num {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e7f0ed;
  color: var(--mint-dark);
  font-weight: 800;
}

.chapter-meta {
  min-width: 0;
}

.chapter-meta strong,
.chapter-meta span {
  display: block;
}

.chapter-meta strong {
  overflow-wrap: anywhere;
}

.chapter-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cad7dc;
}

.chapter-button.is-complete .status-dot {
  background: var(--coral);
}

.lesson {
  padding: 26px;
}

.page-shell {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.page-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.quick-jumps {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--mint-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.page-dots {
  display: inline-flex;
  gap: 6px;
}

.page-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cad7dc;
}

.page-dot.is-active {
  background: var(--coral);
}

.lesson-page {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.lesson-page h3 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

.lesson-page h4 {
  margin: 0 0 8px;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.focus-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 16px;
}

.focus-box p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stacked-list {
  display: grid;
  gap: 12px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.lesson__mast {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.lesson__mast p:last-child {
  margin-bottom: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.65;
}

.done-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  background: #fff;
}

.done-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
}

.lesson-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lesson-block,
.teacher-guide,
.phrase-lab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.lesson-block h3,
.teacher-guide h3,
.phrase-lab h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.lesson-block p,
.lesson-block li,
.guide-step p,
.guide-step li {
  color: var(--muted);
  line-height: 1.6;
}

.teacher-guide {
  grid-column: 1 / -1;
  background: #f8fbf9;
}

.guide-step {
  min-height: 170px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.guide-step h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.guide-step ul {
  margin-top: 10px;
}

.step-count {
  color: var(--muted);
  font-weight: 800;
}

ul {
  margin: 0;
  padding-left: 20px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f1f6f4;
  color: var(--mint-dark);
  font-weight: 700;
}

.primary-button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  color: #fff;
  font-weight: 800;
}

.secondary-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.primary-button:hover {
  background: var(--mint-dark);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.phrase-lab {
  margin-top: 16px;
  background: linear-gradient(135deg, #fff 0%, #f7fbf8 100%);
}

.phrase-lab__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sentence {
  min-height: 66px;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tile {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.tile:nth-child(2n) {
  background: var(--blue);
}

.tile:nth-child(3n) {
  background: var(--coral);
}

.translation {
  margin: 10px 0 0;
  color: var(--muted);
}

.flashcard {
  min-height: 210px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 125, 102, 0.1), rgba(216, 95, 72, 0.08)),
    #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 22px;
  text-align: center;
  user-select: none;
  overflow: hidden;
}

.example-image {
  width: min(220px, 100%);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(56, 111, 159, 0.12), rgba(216, 95, 72, 0.1)),
    #f8fbf9;
  padding: 12px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.example-image span {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 2rem;
}

.example-image figcaption {
  display: grid;
  gap: 2px;
}

.example-image figcaption strong {
  font-family: "Noto Sans JP", Inter, sans-serif;
  font-size: 1rem;
}

.example-image figcaption small {
  color: var(--muted);
  line-height: 1.35;
}

.flashcard--large {
  min-height: 300px;
}

.flashcard--kana {
  min-height: 300px;
}

.flashcard--ended {
  border-color: var(--coral);
  background:
    linear-gradient(135deg, rgba(216, 95, 72, 0.12), rgba(197, 155, 55, 0.12)),
    #fff;
}

.flashcard__label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flashcard strong {
  font-family: "Noto Sans JP", Inter, sans-serif;
  font-size: 4.6rem;
  line-height: 1;
}

.flashcard--word strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: keep-all;
  font-size: 2.7rem;
  line-height: 1.12;
}

.flashcard--word span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.flashcard span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.vocab-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.vocab-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 1.2fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.vocab-row .example-image {
  width: 100%;
  padding: 8px;
}

.vocab-row .example-image span {
  width: 46px;
  height: 46px;
  font-size: 1.35rem;
}

.vocab-row .example-image figcaption {
  display: none;
}

.vocab-row:last-child {
  border-bottom: 0;
}

.vocab-row strong {
  font-family: "Noto Sans JP", Inter, sans-serif;
  font-size: 1.18rem;
}

.vocab-row span {
  color: var(--muted);
}

.study-section {
  width: min(1180px, calc(100% - 32px));
  margin: -58px auto 0;
  position: relative;
  gap: 18px;
}

.view-panel:not(.is-active) {
  display: none;
}

.section-head,
.practice-board {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-head {
  padding: 22px;
  display: grid;
  gap: 16px;
  align-items: start;
}

.section-head h2 {
  margin-bottom: 0;
}

.section-title {
  display: grid;
  gap: 10px;
}

.section-head select {
  max-width: 360px;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.practice-board {
  padding: 20px;
  box-shadow: none;
}

.practice-board.page-shell {
  display: grid;
  padding: 22px;
  box-shadow: var(--shadow);
}

.quiz-list {
  display: grid;
  gap: 12px;
}

.quiz-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.quiz-item p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.quiz-choices {
  display: grid;
  gap: 8px;
}

.quiz-choice {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  text-align: left;
  padding: 8px 10px;
}

.quiz-choice.is-correct {
  border-color: var(--mint);
  background: #e8f4ee;
}

.quiz-choice.is-wrong {
  border-color: var(--coral);
  background: #fff0ed;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  width: min(900px, 100%);
}

.script-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 138px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#kanaGroupSelect.checkbox-group {
  display: grid;
  max-height: 360px;
}

.selection-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.checkbox-group--wide {
  width: 100%;
  max-height: 360px;
  display: grid;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fbf9;
  font-size: 0.88rem;
  font-weight: 700;
}

.check-pill input {
  width: 16px;
  height: 16px;
  accent-color: var(--mint);
}

.vocab-group-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.vocab-group-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--mint);
}

.vocab-group-row span {
  display: grid;
  gap: 3px;
}

.vocab-group-row small {
  color: var(--muted);
  font-weight: 700;
}

.script-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.script-option input,
.kana-group-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--mint);
}

.kana-group-row {
  display: grid;
  grid-template-columns: 20px minmax(190px, max-content) 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kana-group-row__label {
  font-weight: 800;
  color: var(--mint-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kana-group-row__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 6px;
}

.kana-option-cell {
  min-height: 70px;
  border-radius: 8px;
  background: #f1f6f4;
  display: grid;
  place-items: center;
  padding: 5px;
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
}

.kana-option-cell small {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.kana-option-cell strong {
  font-size: 1.16rem;
  line-height: 1;
}

.kana-chart {
  display: grid;
  gap: 8px;
}

.kana-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.kana-row__label {
  font-weight: 800;
  color: var(--mint-dark);
}

.kana-row__items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 6px;
}

.kana-cell {
  min-height: 70px;
  border-radius: 8px;
  background: #f1f6f4;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
  padding: 6px;
}

.kana-cell strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1;
}

.kana-cell span {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 38px auto 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.focus-mode {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  grid-template-rows: auto 1fr;
  gap: 18px;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 22px 22px max(22px, env(safe-area-inset-bottom));
  background: rgba(251, 252, 251, 0.98);
  overflow: auto;
}

.focus-mode.is-active {
  display: grid;
}

.focus-mode__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.focus-mode__key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.focus-mode__key span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.focus-mode__bar h2 {
  margin-bottom: 0;
}

.focus-mode__card {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 16px;
  position: relative;
  min-height: 0;
}

.tap-zone {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 74px;
  border: 0;
  background: transparent;
}

.tap-zone--left {
  left: 0;
  width: 32%;
}

.tap-zone--center {
  left: 32%;
  width: 36%;
}

.tap-zone--right {
  right: 0;
  width: 32%;
}

.focus-mode__controls {
  position: relative;
  z-index: 3;
}

.focus-mode .flashcard {
  min-height: 0;
  height: min(62dvh, 620px);
  margin: 0;
  align-self: center;
}

.focus-mode .flashcard strong {
  font-size: clamp(3rem, 13vmin, 6.6rem);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.focus-mode .flashcard--word strong {
  font-size: clamp(1.8rem, 7vmin, 4rem);
}

.focus-mode__controls {
  justify-content: center;
}

@media (max-width: 860px) {
  .hero {
    min-height: 760px;
  }

  body[data-view="vocabulary"] .hero,
  body[data-view="common"] .hero,
  body[data-view="kana"] .hero {
    min-height: 430px;
  }

  .hero__overlay {
    background:
      linear-gradient(180deg, rgba(13, 30, 34, 0.86) 0%, rgba(13, 30, 34, 0.61) 56%, rgba(13, 30, 34, 0.32) 100%);
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero__content {
    align-self: end;
    padding-bottom: 96px;
  }

  h1 {
    font-size: 3.25rem;
  }

  body[data-view="vocabulary"] h1,
  body[data-view="common"] h1,
  body[data-view="kana"] h1 {
    font-size: 2.9rem;
  }

  .flashcard strong {
    font-size: 3.5rem;
  }

  .focus-mode {
    padding: 16px;
  }

  .focus-mode .flashcard strong {
    font-size: clamp(2.4rem, 14vmin, 4.8rem);
  }

  .focus-mode .flashcard--word strong {
    font-size: clamp(1.6rem, 8vmin, 3rem);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .chapter-panel {
    position: static;
    max-height: none;
  }

  .chapter-list {
    max-height: 390px;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
    align-items: stretch;
  }

  .section-head select {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    width: min(100% - 24px, 1180px);
  }

  .brand span:last-child {
    display: none;
  }

  .hero__content,
  .workspace,
  .study-section,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 2.62rem;
  }

  body[data-view="vocabulary"] h1,
  body[data-view="common"] h1,
  body[data-view="kana"] h1 {
    font-size: 2.35rem;
  }

  .flashcard strong {
    font-size: 2.8rem;
  }

  .focus-mode__bar {
    display: grid;
  }

  .focus-mode__key {
    display: none;
  }

  .focus-mode {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }

  .focus-mode .flashcard {
    height: min(50dvh, 430px);
    padding: 16px;
  }

  .focus-mode .flashcard strong {
    font-size: clamp(2.1rem, 15vmin, 3.8rem);
  }

  .focus-mode .flashcard--word strong {
    font-size: clamp(1.45rem, 8vmin, 2.4rem);
  }

  .hero__copy {
    font-size: 1rem;
  }

  .lesson {
    padding: 18px;
  }

  .lesson-page {
    min-height: 390px;
    padding: 20px;
  }

  .page-nav {
    display: grid;
  }

  .lesson__mast,
  .phrase-lab__header {
    display: grid;
  }

  .vocab-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .kana-group-row {
    grid-template-columns: 20px minmax(150px, max-content) 1fr;
  }

  .kana-group-row__label {
    font-size: 0.82rem;
  }

  .kana-row {
    grid-template-columns: 1fr;
  }

  .done-toggle {
    justify-self: start;
  }

  .chapter-button {
    grid-template-columns: 38px 1fr auto;
    padding-inline: 14px;
  }

  .chapter-num {
    width: 38px;
    height: 38px;
  }
}
