:root {
  color-scheme: light;
  --paper: #faf7f2;
  --panel: #fffdf9;
  --ink: #30201d;
  --muted: #71615a;
  --line: #e7dcd3;
  --wine: #8a2442;
  --rose: #f7e3e8;
  --primary: var(--wine);
  --primary-hover: #6d1932;
  --on-primary: #fffaf7;
  --feature-surface: #f4eae2;
  --feature-edge: #e9dace;
  --cover-matte: #3a2023;
  --chapter-edge: #d9b9bb;
  --control-edge: #ded1c7;
  --field-edge: #d9ccc3;
  --panel-hover: #f3ebe4;
  --row-hover: #f7eee9;
  --word-ink: #79203b;
  --word-hover: #eed0d9;
  --word-hover-ink: #64152e;
  --quote-edge: #d3a5af;
  --quote-surface: #f8eee9;
  --meaning-edge: #eaded3;
  --meaning-surface: #fcf7f0;
  --remembered-surface: #e4ede0;
  --remembered-ink: #32492e;
  --fuzzy-surface: #f4ead9;
  --fuzzy-ink: #694d28;
  --saved-dot: #728165;
  --scrim: #29171f7a;
  --dialog-surface: var(--panel);
  --dialog-shadow: #39202139;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --header-height: 72px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #181418;
  --panel: #221c21;
  --ink: #f4e9e6;
  --muted: #c4aeb6;
  --line: #45373f;
  --wine: #efa1b8;
  --rose: #45303a;
  --primary: #a33e5d;
  --primary-hover: #ac4767;
  --feature-surface: #2b2128;
  --feature-edge: #4a3844;
  --cover-matte: #27181f;
  --chapter-edge: #79535f;
  --control-edge: #604b56;
  --field-edge: #69525f;
  --panel-hover: #352930;
  --row-hover: #34262e;
  --word-ink: #f8bdce;
  --word-hover: #593747;
  --word-hover-ink: #ffdae4;
  --quote-edge: #b77589;
  --quote-surface: #32252d;
  --meaning-edge: #503d46;
  --meaning-surface: #2e232a;
  --remembered-surface: #2c3a32;
  --remembered-ink: #c5e7ce;
  --fuzzy-surface: #433529;
  --fuzzy-ink: #f5d4ad;
  --saved-dot: #9db491;
  --scrim: #0b080c9e;
  --dialog-surface: #2a2027;
  --dialog-shadow: #0704059c;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
}

button, input {
  font: inherit;
}

button, a, input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 4px;
}

#app:focus, #review-word:focus, #revealed-meaning:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

h1, h2, p {
  margin: 0;
}

h1, h2 {
  line-height: 1.35;
}

.site-width {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

.content-width {
  width: min(100%, 780px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: calc(var(--header-height) - 1px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  font: 800 23px/1 var(--serif);
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
}

.brand-mark::before, .brand-mark::after {
  position: absolute;
  top: 8px;
  width: 8px;
  height: 13px;
  border: 1px solid var(--on-primary);
  content: "";
}

.brand-mark::before {
  left: 7px;
  border-radius: 2px 0 0 2px;
  transform: skewY(11deg);
}

.brand-mark::after {
  right: 7px;
  border-radius: 0 2px 2px 0;
  transform: skewY(-11deg);
}

.site-nav {
  display: flex;
  align-self: stretch;
  gap: 28px;
}

.site-nav a {
  display: flex;
  position: relative;
  align-items: center;
  gap: 6px;
  padding-inline: 9px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--wine);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  background: var(--wine);
  content: "";
}

.due-badge {
  min-width: 20px;
  padding: 0 5px;
  border-radius: 20px;
  background: var(--rose);
  color: var(--wine);
  font-size: 12px;
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 15px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--panel-hover);
  color: var(--wine);
}

.theme-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  color: var(--wine);
  font: 17px/1 system-ui, sans-serif;
}

.storage-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.storage-status::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: var(--saved-dot);
  content: "";
}

.storage-unavailable {
  color: var(--wine);
}

.storage-unavailable::before {
  background: var(--wine);
}

.home-view {
  padding: 54px 0 76px;
}

.feature {
  display: grid;
  grid-template-columns: 1.09fr 1fr;
  min-height: 465px;
  overflow: hidden;
  border: 1px solid var(--feature-edge);
  border-radius: 23px;
  background: var(--feature-surface);
}

.feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4.2vw, 58px);
}

.feature.feature-resume {
  display: block;
  min-height: 0;
}

.feature-resume .feature-copy {
  padding-block: clamp(24px, 4vw, 42px);
}

.feature.feature-resume h1 {
  font-size: clamp(28px, 4.3vw, 42px);
  text-wrap: balance;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.chapter-id {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--chapter-edge);
  border-radius: 5px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.feature h1 {
  margin: 19px 0 19px;
  font: 800 clamp(31px, 4vw, 55px)/1.27 var(--serif);
  letter-spacing: -0.055em;
}

.feature h1 span {
  display: block;
}

.synopsis {
  max-width: 355px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.95;
  text-wrap: pretty;
}

.feature-actions, .card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feature-actions {
  gap: 17px;
  margin-top: 26px;
}

.feature-note {
  color: var(--muted);
  font-size: 12px;
}

.feature-art {
  position: relative;
  min-width: 0;
  min-height: 100%;
  background: var(--cover-matte);
}

.feature-art img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 49%;
}

.button, .text-link, .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 650;
}

.button {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: center;
  transition: background-color 130ms ease, border-color 130ms ease;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.button.primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button.secondary {
  border-color: var(--control-edge);
  background: var(--panel);
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--panel-hover);
}

.text-link, .back-link {
  color: var(--wine);
}

.text-link:hover, .back-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 108px;
  margin-top: 20px;
  padding: 21px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.overview-card h2 {
  margin-bottom: 5px;
  font: 750 20px/1.4 var(--serif);
}

.overview-card p {
  color: var(--muted);
  font-size: 13px;
}

.overview-card .text-link {
  flex-shrink: 0;
  font-size: 13px;
}

.chapter-catalog {
  margin-top: 34px;
}

.catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-heading h2 {
  font: 800 clamp(24px, 4vw, 30px)/1.35 var(--serif);
}

.catalog-heading span {
  color: var(--muted);
  font-size: 13px;
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.catalog-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: 100%;
  min-height: 78px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.catalog-card:hover {
  background: var(--row-hover);
}

.catalog-id {
  align-self: start;
  margin-top: 2px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 700;
}

.catalog-text strong, .catalog-text small {
  display: block;
}

.catalog-text strong {
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.catalog-text small {
  color: var(--muted);
  font-size: 12px;
}

.catalog-arrow {
  color: var(--wine);
}

.chapter-message {
  margin-block: 28px;
  color: var(--muted);
}

.review-card-heading + #review-meaning {
  margin-top: 18px;
}

.chapter-heading {
  padding: 20px 4px 25px;
}

.chapter-heading .back-link {
  justify-content: flex-start;
  margin-bottom: 14px;
  font-size: 13px;
}

.chapter-heading h1, .review-heading h1 {
  margin: 11px 0 9px;
  font: 800 clamp(27px, 4.25vw, 42px)/1.35 var(--serif);
  letter-spacing: -0.035em;
}

.chapter-heading p, .review-heading p {
  color: var(--muted);
  font-size: 13px;
}

.chapter-bar {
  position: sticky;
  z-index: 3;
  top: calc(var(--header-height) - 1px);
  padding: 1px 0;
  background: var(--paper);
}

.chapter-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 55px;
  border-bottom: 1px solid var(--line);
}

.chapter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chapter-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.chapter-tabs a[aria-current="page"], .chapter-tabs a:hover {
  background: var(--rose);
  color: var(--wine);
}

.chapter-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 10px;
  margin-left: auto;
}

.chapter-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-right: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.chapter-switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--wine);
}

.reader-surface {
  margin-top: 15px;
  margin-bottom: 55px;
  padding: 31px clamp(22px, 5vw, 51px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.story-text {
  font: 500 18px/2.45 var(--serif);
  letter-spacing: 0.018em;
  overflow-wrap: anywhere;
}

.story-text p {
  margin: 0 0 1.12em;
  scroll-margin-top: calc(var(--header-height) + 83px);
}

.word-chip {
  display: inline;
  max-width: 100%;
  padding: 0.1em 0.28em;
  border: 0;
  border-radius: 5px;
  background: var(--rose);
  color: var(--word-ink);
  font: 700 0.93em/1.5 var(--sans);
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.word-chip:hover, .word-chip.located-word, .word-chip.is-playing {
  background: var(--word-hover);
  color: var(--word-hover-ink);
}

.inline-gloss {
  font-size: 0.84em;
  font-weight: 500;
  white-space: nowrap;
}

.gloss-slot {
  display: inline-grid;
  grid-template-columns: max-content;
}

.gloss-slot > span {
  grid-area: 1 / 1;
  white-space: pre;
}

.gloss-blank, .hide-glosses .gloss-text {
  visibility: hidden;
}

.hide-glosses .gloss-blank {
  visibility: visible;
}

.reader-end {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.word-list-view, .review-view {
  padding-top: 18px;
  padding-bottom: 52px;
}

.search-bar, .review-heading, .review-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
}

input[type="search"] {
  min-height: 44px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--field-edge);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

#word-count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.review-card, .empty-card {
  padding: 26px clamp(19px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.review-card-heading h2, .word-dialog h2 {
  color: var(--ink);
  font: 700 clamp(28px, 6vw, 38px)/1.15 var(--sans);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.pronunciation {
  min-width: 0;
}

.pronunciation-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}

.pronunciation-word [lang="en"] {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pronunciation-icon {
  display: inline-grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--rose);
  color: var(--wine);
}

.pronunciation-icon::after {
  margin-left: 2px;
  border-block: 4px solid transparent;
  border-inline-start: 7px solid currentColor;
  content: "";
}

.pronunciation-word:hover .pronunciation-icon,
.pronunciation-word.is-playing .pronunciation-icon {
  background: var(--word-hover);
  color: var(--word-hover-ink);
}

.pronunciation-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-top: 7px;
}

.pronunciation-accent {
  min-height: 34px;
  padding: 3px 6px;
  border: 1px solid var(--control-edge);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font: 600 13px/1.45 var(--sans);
  cursor: pointer;
}

.pronunciation-status {
  color: var(--muted);
  font-size: 13px;
}

.pronunciation-status:not(:empty) {
  margin-top: 5px;
}

.phonetics {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.part-of-speech {
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 600;
}

.source-sentence {
  margin: 21px 0 19px;
  padding: 13px 15px;
  border-left: 3px solid var(--quote-edge);
  border-radius: 0 7px 7px 0;
  background: var(--quote-surface);
  font: 550 17px/2 var(--serif);
  overflow-wrap: anywhere;
}

.cue {
  padding: 0 3px;
  background: transparent;
  color: var(--wine);
  font: 730 1em/1.5 var(--sans);
}

.rating-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.rating-actions .button {
  flex: 1;
}

.meaning-reveal {
  padding: 11px 14px;
  border: 1px solid var(--meaning-edge);
  border-radius: 8px;
  background: var(--meaning-surface);
  overflow-wrap: anywhere;
}

.meaning-reveal p {
  color: var(--muted);
  font-size: 13px;
}

.meaning-reveal strong {
  display: block;
  margin: 0 0 3px;
  font-size: 24px;
}

.rating-remembered {
  background: var(--remembered-surface);
  color: var(--remembered-ink);
}

.rating-fuzzy {
  background: var(--fuzzy-surface);
  color: var(--fuzzy-ink);
}

.rating-forgotten {
  background: var(--rose);
  color: var(--word-ink);
}

.rating-actions .button:hover {
  border-color: currentColor;
}

.empty-card h2, .saved-words h2 {
  font: 750 23px/1.36 var(--serif);
}

.empty-card p {
  margin-top: 8px;
  color: var(--muted);
}

.empty-card .card-actions {
  margin-top: 15px;
}

.search-bar {
  margin-bottom: 13px;
}

.search-input {
  flex: 1;
  width: 100%;
}

.word-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  list-style: none;
}

.word-list:not(:empty) {
  border: 1px solid var(--line);
}

.word-list li + li {
  border-top: 1px solid var(--line);
}

.word-row {
  display: grid;
  grid-template-columns: minmax(8em, 0.85fr) 1.55fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 67px;
  padding: 11px 17px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.word-row:hover, .word-row:focus-visible, .word-row.is-playing {
  background: var(--row-hover);
}

.word-row:focus-visible {
  outline-offset: -3px;
}

.row-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  overflow-wrap: anywhere;
}

.row-entry strong {
  color: var(--wine);
  font-size: 16px;
  font-weight: 720;
}

.row-ipa, .row-definition, .row-status {
  color: var(--muted);
  font-size: 13px;
}

.row-arrow, .row-status {
  color: var(--wine);
}

.row-arrow {
  width: 16px;
  text-align: center;
}

.row-arrow::before {
  content: "→";
}

.word-row[aria-haspopup="false"] .row-arrow::before {
  content: "▶";
  font-size: 0.72em;
}

.row-status {
  white-space: nowrap;
}

.no-results {
  padding: 20px 6px;
  color: var(--muted);
}

.review-view {
  padding-top: 45px;
}

.review-heading {
  margin-bottom: 20px;
}

.review-heading h1 {
  margin-top: 0;
}

.review-amount {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 9px;
  background: var(--rose);
  color: var(--wine);
  font-size: 13px;
}

.review-amount strong {
  font-size: 19px;
}

.saved-words {
  margin-top: 24px;
}

.saved-words-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.saved-words h2 span {
  margin-left: 5px;
  color: var(--muted);
  font: 500 13px var(--sans);
}

.word-overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.word-overlay::before {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  content: "";
}

.word-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.word-overlay.is-open .word-dialog {
  pointer-events: auto;
}

.word-dialog {
  position: relative;
  width: min(470px, calc(100% - 32px));
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--dialog-surface);
  color: var(--ink);
  box-shadow: 0 24px 80px var(--dialog-shadow);
}

.word-dialog:focus {
  outline: none;
}

.close-button {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}

.close-button:hover {
  background: var(--panel-hover);
}

.word-dialog h2 {
  padding-right: 28px;
}

.word-meanings {
  margin: 19px 0 20px;
}

.word-meanings dt {
  color: var(--muted);
  font-size: 13px;
}

.word-meanings dd {
  margin: 2px 0 13px;
}

.word-meanings .context-meaning {
  color: var(--wine);
  font-size: 24px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .site-width {
    width: calc(100% - 36px);
  }

  .home-view {
    padding-top: 28px;
  }

  .feature {
    min-height: 410px;
  }

  .feature-copy {
    padding: 27px;
  }

  .overview-card {
    padding: 15px 17px;
  }

  .catalog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-width {
    width: calc(100% - 28px);
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
  }

  .brand {
    gap: 8px;
    font-size: 20px;
  }

  .brand-mark {
    flex-basis: 30px;
  }

  .site-nav {
    gap: 10px;
  }

  .site-nav a {
    padding-inline: 8px;
  }

  .storage-status:not(.storage-unavailable) {
    display: none;
  }

  .storage-unavailable {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    right: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--paper);
  }

  .home-view {
    padding: 18px 0 38px;
  }

  .feature {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 16px;
  }

  .feature-art {
    order: -1;
    min-height: 0;
    aspect-ratio: 1.78;
  }

  .feature-art img {
    object-position: center 43%;
  }

  .feature-copy {
    padding: 21px 20px 24px;
  }

  .feature h1 {
    margin: 12px 0 10px;
    font-size: clamp(25px, 8.25vw, 39px);
  }

  .synopsis {
    font-size: 14px;
    line-height: 1.8;
  }

  .feature-actions {
    margin-top: 15px;
  }

  .overview-card {
    min-height: 84px;
    margin-top: 12px;
  }

  .chapter-catalog {
    margin-top: 26px;
  }

  .catalog-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .catalog-card {
    min-height: 62px;
    padding: 9px 12px;
  }

  .chapter-heading {
    padding: 9px 2px 17px;
  }

  .chapter-heading .back-link {
    margin-bottom: 7px;
  }

  .chapter-tabs a {
    min-height: 40px;
    padding-inline: 9px;
    font-size: 13px;
  }

  .chapter-bar-inner {
    min-height: 50px;
  }

  .chapter-switch {
    font-size: 12px;
  }

  .reader-surface {
    margin-top: 10px;
    padding: 18px 14px 22px;
  }

  .story-text {
    font-size: 17px;
    line-height: 2.35;
  }

  .story-text p {
    scroll-margin-top: calc(var(--header-height) + 77px);
  }

  .review-card-heading .text-link {
    font-size: 13px;
    white-space: nowrap;
  }

  .pronunciation-accent {
    font-size: 16px;
  }

  .review-card, .empty-card {
    padding: 18px 15px;
  }

  .source-sentence {
    margin-top: 15px;
    padding: 9px 10px;
    font-size: 16px;
  }

  input[type="search"] {
    font-size: 16px;
  }

  .word-row {
    grid-template-columns: 1fr auto;
    gap: 2px 7px;
    padding: 10px 12px;
  }

  .row-definition {
    grid-row: 2;
  }

  .row-status, .row-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .review-view {
    padding-top: 23px;
  }

  .word-overlay {
    align-items: end;
  }

  .word-dialog {
    width: 100%;
    padding: 23px 20px calc(21px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 360px) {
  .header-inner {
    width: calc(100% - 18px);
  }

  .brand {
    gap: 6px;
    font-size: clamp(16px, 4.9vw, 18px);
  }

  .site-nav {
    gap: 4px;
    font-size: 14px;
  }

  .site-nav a {
    padding-inline: 4px;
  }

  .site-nav a[aria-current="page"]::after {
    inset-inline: 4px;
  }

  .theme-toggle {
    min-width: 34px;
    padding-inline: 6px;
  }

  .theme-label {
    display: none;
  }

  .chapter-bar-inner {
    flex-wrap: wrap;
    column-gap: 6px;
  }

  .chapter-tabs a {
    padding-inline: 5px;
  }

  .chapter-options {
    gap: 0 6px;
  }

  .chapter-switch {
    gap: 4px;
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}
