:root {
  color-scheme: light;
  --bg: #f5f6ef;
  --panel: #fffef8;
  --ink: #22372d;
  --muted: #56665b;
  --stroke: #dce2d7;
  --leaf: #245a45;
  --leaf-text: #fffdf5;
  --mint: #e2eee4;
  --gold: #f4e9ce;
  --blue: #dfedf2;
  --sand: #f1f1e6;
  --amber: #7a511e;
  --radius: 8px;
  font: 15px/1.55 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c251f;
  --panel: #232e28;
  --ink: #edf3e5;
  --muted: #b3c5b7;
  --stroke: #3c4b42;
  --leaf: #8ec7a8;
  --leaf-text: #142f22;
  --mint: #33483d;
  --gold: #463e2d;
  --blue: #314850;
  --sand: #2b362d;
  --amber: #e9c688;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1c251f;
    --panel: #232e28;
    --ink: #edf3e5;
    --muted: #b3c5b7;
    --stroke: #3c4b42;
    --leaf: #8ec7a8;
    --leaf-text: #142f22;
    --mint: #33483d;
    --gold: #463e2d;
    --blue: #314850;
    --sand: #2b362d;
    --amber: #e9c688;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; object-fit: cover; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, p, small, strong { overflow-wrap: anywhere; }
h1 { font-size: 36px; line-height: 1.25; font-weight: 760; }
h2 { font-size: 22px; line-height: 1.32; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }
.icon { flex: 0 0 auto; width: 20px; height: 20px; vertical-align: middle; }
.skip { position: fixed; z-index: 10; top: -6em; left: 20px; padding: 12px; background: var(--panel); }
.skip:focus { top: 10px; }
.layout { min-height: 100vh; }
.sidebar { position: fixed; z-index: 4; inset: 0 auto 0 0; width: 234px; display: flex; flex-direction: column; padding: 26px 17px 18px; background: var(--panel); border-right: 1px solid var(--stroke); }
.brand { display: flex; align-items: center; gap: 11px; margin: 4px 10px 36px; }
.brand img { width: 48px; height: 48px; border-radius: var(--radius); object-position: center 35%; }
.brand strong, .brand small, .active-book strong, .active-book small { display: block; }
.brand strong { font-size: 20px; font-weight: 780; }
.brand small { font-size: 10px; color: var(--muted); font-weight: 650; }
#navigation { display: grid; gap: 5px; }
#navigation a { min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 6px; color: var(--muted); font-weight: 600; }
#navigation a:hover, #navigation a[aria-current] { background: var(--mint); color: var(--leaf); }
#navigation a[aria-current] { font-weight: 750; }
.sidebar-bottom { margin-top: auto; min-width: 0; }
.active-book { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--stroke); border-radius: 8px; }
.active-book img { width: 33px; height: 43px; border-radius: 4px; }
.active-book span { flex: 1; min-width: 0; }
.active-book small { color: var(--muted); }
.active-book .icon { width: 16px; }
.workspace { margin-left: 234px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 69px; padding: 10px max(28px, calc((100% - 1112px) / 2)); border-bottom: 1px solid var(--stroke); background: var(--panel); }
.topbar > div { display: flex; gap: 12px; align-items: center; min-width: 0; }
.topbar > div:first-child { color: var(--muted); }
.topbar strong { color: var(--ink); }
.top-icon { color: var(--leaf); }
.breadcrumb { color: var(--stroke); }
.profile { display: flex; align-items: center; gap: 8px; margin-left: 5px; }
.profile > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--amber); font-weight: 750; }
.profile strong { max-width: 115px; }
main { width: min(100%, 1176px); margin-inline: auto; padding: 30px 32px 84px; }
.date-line { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.date-line .icon { width: 16px; height: 16px; }
.page-title, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; margin-bottom: 20px; }
.page-title p, .section-head p { margin-top: 3px; color: var(--muted); }
.section-head { margin: 29px 0 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.btn, .text-btn, .back-link, .icon-btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-weight: 680; line-height: 1.25; }
.btn { min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 6px; text-align: center; }
.btn .icon, .text-btn .icon, .back-link .icon { width: 17px; height: 17px; }
.primary { background: var(--leaf); color: var(--leaf-text); }
.primary:hover, .hero-btn:hover { filter: brightness(1.12); }
.secondary { background: var(--panel); border-color: var(--stroke); }
.secondary:hover, .icon-btn:hover { background: var(--mint); }
.text-btn, .back-link { padding: 7px 1px; background: transparent; border: 0; color: var(--leaf); }
.text-btn:hover, .back-link:hover { text-decoration: underline; }
.back-link { margin-bottom: 12px; }
.icon-btn { width: 40px; height: 40px; flex: 0 0 40px; padding: 0; background: transparent; border: 0; border-radius: 6px; color: var(--muted); }
.icon-btn[aria-pressed=true] { background: var(--mint); color: var(--leaf); }
.icon-btn[aria-pressed=true] .icon { fill: currentColor; }
.map-hero { position: relative; min-height: 313px; display: grid; align-items: center; isolation: isolate; overflow: hidden; border-radius: var(--radius); color: #fffdf4; background: #214436; }
.hero-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-position: center 52%; }
.map-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(15, 40, 30, .94), rgba(17, 44, 35, .76) 27%, rgba(20, 46, 36, .10) 67%, transparent); }
.hero-content { padding: 32px 38px; max-width: 49%; }
.hero-label { display: inline-flex; gap: 7px; align-items: center; color: #e7ead3; font-weight: 650; }
.hero-label .icon { width: 17px; height: 17px; }
.hero-content h2 { font-size: 46px; margin: 5px 0 6px; }
.hero-content p { color: #f1f1e5; }
.hero-btn { margin-top: 20px; color: #293b2e; background: #f7edcb; }
.hero-btn .icon { order: 1; }
.stats { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border-block: 1px solid var(--stroke); }
.stats > * { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 17px; color: var(--muted); font-size: 13px; }
.stats > * + * { border-left: 1px solid var(--stroke); }
.stats a:hover { background: var(--sand); }
.stats strong { display: block; color: var(--ink); font-size: 25px; line-height: 1.18; }
.stats strong small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 8px; color: var(--leaf); }
.stat-icon.mint { background: var(--mint); }
.stat-icon.gold { background: var(--gold); color: var(--amber); }
.stat-icon.blue { background: var(--blue); }
.stat-arrow { margin-left: auto; }
.search { min-height: 42px; display: flex; align-items: center; gap: 8px; width: min(100%, 275px); padding: 0 10px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 6px; color: var(--muted); }
.search .icon { width: 17px; }
.search input { background: transparent; border: 0; min-width: 0; width: 100%; color: var(--ink); }
.search:focus-within { outline: 2px solid var(--leaf); }
.search input:focus { outline: none; }
.trail { border-block: 1px solid var(--stroke); background: var(--panel); }
.trail-row { display: flex; align-items: center; min-height: 65px; padding: 10px 16px; gap: 14px; }
.trail-row + .trail-row { border-top: 1px solid var(--stroke); }
.trail-row:hover, .trail-row.current { background: var(--mint); }
.trail-index { background: var(--sand); color: var(--leaf); font-variant-numeric: tabular-nums; border-radius: 6px; width: 39px; height: 36px; flex: 0 0 39px; display: grid; place-items: center; font-weight: 720; }
.current .trail-index, .trail-index.done { background: var(--leaf); color: var(--leaf-text); }
.trail-text { flex: 1; min-width: 0; }
.trail-text strong, .trail-text small { display: block; }
.trail-text small, .trail-current { color: var(--muted); font-size: 12px; }
.shelf, .widget-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book, .widget-grid article { overflow: hidden; background: var(--panel); border: 1px solid var(--stroke); border-radius: 8px; }
.book { display: grid; grid-template-columns: minmax(65px, 38%) minmax(0, 1fr); }
.book-art img { height: 100%; width: 100%; aspect-ratio: 3 / 4; }
.book-info, .widget-grid article > div { padding: 14px; min-width: 0; }
.book-info h2 { font-size: 18px; }
.book-info p, .book-info small { color: var(--muted); }
.book-info .text-btn, .book-active { display: inline-block; margin-top: 5px; font-size: 13px; color: var(--leaf); }
.lesson-card { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); align-items: center; gap: 23px; padding-bottom: 17px; border-bottom: 1px solid var(--stroke); }
.lesson-card img { width: 100%; border-radius: 8px; background: var(--mint); aspect-ratio: 3 / 2; }
.eyebrow { display: block; color: var(--leaf); font-size: 13px; font-weight: 730; margin-bottom: 4px; }
.word-list { border-block: 1px solid var(--stroke); }
.word-row { display: flex; align-items: center; background: var(--panel); gap: 3px; min-height: 65px; padding: 7px 12px; }
.word-row + .word-row { border-top: 1px solid var(--stroke); }
.word-open { text-align: left; border: 0; background: none; flex: 1; min-width: 0; }
.word-open strong { display: block; font: 700 19px/1.2 Georgia, serif; }
.word-open span { display: block; color: var(--muted); white-space: pre-line; }
.tag { display: inline-block; border-radius: 4px; padding: 4px 7px; background: var(--mint); color: var(--leaf); font-size: 12px; }
.tag.warm { background: var(--gold); color: var(--amber); }
.lesson-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); }
progress { display: block; width: 100%; accent-color: var(--leaf); }
.lesson-progress { height: 8px; margin-bottom: 20px; }
.lesson-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: start; }
.lesson-guide { padding-top: 3px; }
.lesson-guide img { object-fit: contain; border-radius: 6px; width: 70px; height: 70px; }
.lesson-card { align-items: stretch; }
.lesson-card-text { align-self: center; }
.term-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.term-head h1, .term-head h3 { font: 700 39px/1.12 Georgia, serif; min-width: 0; margin-right: 5px; }
.meaning { margin: 6px 0 14px; font-size: 19px; white-space: pre-line; }
.meaning small, .phonetic, blockquote small { color: var(--muted); }
blockquote { position: relative; margin: 12px 0; padding: 10px 48px 10px 12px; border-left: 3px solid var(--leaf); background: var(--sand); }
blockquote .icon-btn { position: absolute; top: 7px; right: 5px; }
.quiz-frame { max-width: 720px; }
.quiz h1 { font-size: 29px; margin: 0 0 16px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.option { min-height: 56px; text-align: left; border: 1px solid var(--stroke); border-radius: 6px; background: var(--panel); padding: 7px 10px; overflow-wrap: anywhere; }
.option:not(:disabled):hover, .option.right, .feedback.right { background: var(--mint); color: var(--leaf); }
.option.wrong, .feedback.wrong { background: var(--gold); color: var(--amber); }
.option span { margin-right: 10px; font-size: 12px; font-weight: 730; }
.feedback { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 6px; }
.feedback span, .feedback strong { margin-left: 6px; }
.tabs, .widget-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--stroke); margin-bottom: 15px; flex-wrap: wrap; }
.tabs a, .widget-tabs a { padding: 9px 5px; color: var(--muted); }
.tabs a[aria-current], .widget-tabs .active { color: var(--leaf); border-bottom: 2px solid var(--leaf); font-weight: 700; }
.widget-grid img { width: 100%; aspect-ratio: 3 / 2; background: var(--mint); }
input:not([type=checkbox]):not([type=search]):not([type=file]), select { min-height: 39px; min-width: 0; border: 1px solid var(--stroke); border-radius: 5px; padding: 5px 8px; background: var(--panel); color: var(--ink); }
input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--leaf); }
.field-inline { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.search-line { justify-content: flex-start; margin-top: 0; }
.empty, .loading { padding: 30px 15px; color: var(--muted); }
.empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.empty h2 { font-size: 18px; }
.manual-links { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#load-more { margin-top: 12px; }
dialog { width: min(calc(100% - 26px), 560px); max-height: 86vh; max-height: 86dvh; border: 1px solid var(--stroke); border-radius: 8px; padding: 17px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgba(13, 25, 18, .59); }
dialog > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
dialog progress, dialog p { margin-bottom: 10px; }
dialog canvas { width: 100%; height: auto; margin-bottom: 10px; }
.detail-art { width: 100%; max-height: 245px; background: var(--mint); margin-bottom: 10px; border-radius: 6px; object-fit: contain; }
#dialog[data-view="word-card"][open] {
  display: flex; flex-direction: column; width: min(474px, calc(100% - 32px)); max-width: none;
  height: min(630px, 82vh); height: min(630px, 82dvh); max-height: none;
  padding: 8px; border-radius: 26px; overflow: hidden; box-shadow: 0 12px 28px #0003;
  animation: word-card-open 330ms cubic-bezier(.18,.85,.25,1);
}
#dialog[data-view="word-card"]::backdrop { background: rgb(0 0 0 / 38%); }
:root[data-motion="reduce"] #dialog[data-view="word-card"] { animation: none; }
@keyframes word-card-open { from { opacity: 0; transform: translateY(30px) scale(.92); } }
.word-card-header { flex: none; gap: 8px; padding: 4px 10px; margin-bottom: 0; }
#dialog > .word-card-header { margin-bottom: 0; }
.word-card-header > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; min-width: 0; overflow-wrap: anywhere; }
.word-card-header h2 { font-size: 27px; line-height: 32px; }
.word-card-header .phonetic { color: #676f79; font-size: 15px; line-height: 19px; }
.word-card-header button { flex: none; }
.word-card-body { flex: 1; min-height: 0; padding: 12px 18px; overflow: auto; scrollbar-width: none; overflow-wrap: anywhere; }
.word-card-body::-webkit-scrollbar { display: none; }
.word-card-body .detail-art { display: block; max-height: none; height: auto; aspect-ratio: auto 3 / 2; border-radius: 18px; background: var(--card-paper, #fff); }
.word-card-body .word-card-meaning { margin-bottom: 9px; white-space: pre-wrap; font-size: 17px; font-weight: 700; line-height: 22px; }
.word-card-body .word-card-example { margin-bottom: 5px; font-size: 20px; font-weight: 700; line-height: 25px; }
.word-card-body .word-card-translation { margin: 0; color: var(--muted); font-size: 17px; line-height: 22px; }
.word-card-pill, .word-card-review { min-height: 46px; padding: 7px 14px; border: 0; border-radius: 18px; font-weight: 700; }
.word-card-pill { background: var(--card-sky, #e7f4ff); color: var(--station-blue, #195495); }
.word-card-listen { display: grid; grid-template-columns: 18px 1fr; gap: 6px; width: 100%; border-radius: 28px; }
.word-card-listen .icon { width: 18px; height: 18px; }
.word-card-notes { color: var(--muted); font-size: 14px; line-height: 18px; }
.word-card-notes p { margin: 0; }
.word-card-notes .word-card-caption { color: var(--station-blue, #195495); font-weight: 700; }
.word-card-source { font-size: 12px; line-height: 16px; }
.word-card-review { flex: none; background: var(--ink); color: var(--card-paper, #fff); }
:root[data-theme="dark"] #dialog[data-view="word-card"] {
  --card-paper: #000; --card-sky: #1e344a; --station-blue: #89c6ff; background: #2a2e35;
}
:root[data-theme="dark"] .word-card-header .phonetic { color: #adb5c0; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] #dialog[data-view="word-card"] {
    --card-paper: #000; --card-sky: #1e344a; --station-blue: #89c6ff; background: #2a2e35;
  }
  :root[data-theme="system"] .word-card-header .phonetic { color: #adb5c0; }
}
.form label { display: grid; gap: 3px; margin-bottom: 12px; }
#toast { position: fixed; z-index: 9; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 22px); border-radius: 6px; padding: 9px 15px; background: #1f4032; color: #f8fff4; }
.study-milestone { position: fixed; z-index: 12; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 9px 16px; border-radius: 23px; background: #000d; color: white; font-size: 16px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.study-confetti { position: fixed; z-index: 13; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (max-width: 1080px) {
  .sidebar { width: 193px; }
  .workspace { margin-left: 193px; }
  main { padding-inline: 24px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .sidebar { inset: auto 0 0; width: 100%; padding: 2px 5px env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--stroke); }
  .brand, .sidebar-bottom { display: none; }
  #navigation { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; }
  #navigation a { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 1px; font-size: 11px; text-align: center; }
  #navigation .icon { width: 19px; height: 19px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 54px; padding: 5px 12px; }
  .topbar > div { gap: 6px; }
  .topbar > div:first-child > span:not(.top-icon), .profile strong { display: none; }
  .topbar > div:first-child strong::before { content: "果糖单词 · "; }
  main { padding: 17px 13px calc(78px + env(safe-area-inset-bottom)); }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  .map-hero { min-height: 255px; }
  .map-hero::after { background: linear-gradient(0deg, rgba(17, 42, 32, .94), rgba(17, 43, 32, .47) 62%, rgba(17, 43, 32, .02)); }
  .hero-content { align-self: end; max-width: none; padding: 16px; }
  .hero-content h2 { font-size: 32px; }
  .hero-btn { margin-top: 10px; }
  .stats > * { padding: 9px 4px; gap: 5px; font-size: 12px; }
  .stats strong { font-size: 19px; }
  .stat-icon { width: 28px; height: 28px; flex-basis: 28px; }
  .stat-icon .icon { width: 15px; }
  .stat-arrow { display: none; }
  .section-head { gap: 7px; }
  .section-head .search { width: min(51%, 275px); }
  .trail-row { padding-inline: 9px; gap: 8px; }
  .shelf, .widget-grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-info { padding: 8px; }
  .book-info h2 { font-size: 15px; }
  .lesson-card { gap: 12px; }
  .lesson-card { grid-template-columns: 1fr; }
  .lesson-card img { max-height: 300px; object-fit: contain; }
  .lesson-body { grid-template-columns: 1fr; }
  .lesson-guide { justify-self: end; margin-top: 6px; }
  .manual-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 370px) {
  .shelf { grid-template-columns: 1fr; }
  .book-art img { max-height: 132px; }
  .stats > * { gap: 3px; }
  .stat-icon { width: 23px; height: 23px; flex-basis: 23px; }
  .button, .btn { padding-inline: 8px; }
  .options { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

.atlas-layout { display: grid; grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.atlas { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 610px; overflow: hidden; border-radius: 8px; background: #597977; }
.atlas-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-position: center; }
.atlas::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(#151e2970, #2624421f 31%, #13262a8c); }
.atlas-header { padding: 12px 9px 4px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.atlas-book { display: block; border: 0; background: #fffdf3e8; color: #242d2c; border-radius: 8px; padding: 5px 8px; text-align: center; }
.atlas-title { font-size: inherit; }
.atlas-book strong, .atlas-book small { display: block; margin: 0; line-height: 1.3; }
.atlas-book strong { font-size: 16px; }
.atlas-book small { color: #484d48; }
.atlas-book .icon { width: 13px; height: 13px; color: #b9680d; }
.atlas-route { position: relative; flex: 1 1 auto; min-height: 400px; width: min(100%, 510px); margin-inline: auto; }
.atlas-route .atlas-board, .atlas-route .atlas-track { position: absolute; inset: 0; }
.atlas-line { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; }
.atlas-path { stroke: #fff9eeed; stroke-width: 5px; }
.atlas-dashes { stroke: #3a6677; stroke-width: 2px; stroke-dasharray: 2 6; }
.atlas-stop { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); color: #0b415f; }
.stop-number { display: block; width: calc(var(--marker-width) * .75); height: calc(var(--marker-height) * .75); }
.stop-caption { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); width: max-content; max-width: 104px; padding: 3px 5px; background: #fffdf3ed; border-radius: 6px; font-size: 11px; text-align: center; line-height: 1.24; }
.atlas-stop.facing-left .stop-caption { left: auto; right: calc(100% + 4px); }
.stop-caption > * { display: block; }
.stop-caption small { margin-top: 2px; color: #425963; white-space: nowrap; }
.atlas-pages, .atlas-actions { display: flex; justify-content: center; align-items: center; gap: 8px; }
.atlas-pages { color: #fff; font-variant-numeric: tabular-nums; background: #13262aab; margin: 4px auto 7px; padding-inline: 4px; border-radius: 6px; }
.atlas-pages .icon-btn { color: inherit; height: 34px; }
.atlas-pages .icon-btn:hover { background: #284653; }
.atlas-pages a[aria-disabled] { opacity: .34; pointer-events: none; }
.atlas-actions { padding: 0 9px 10px; }
.atlas-actions .btn { flex: 1; max-width: 190px; }
.atlas-actions .atlas-continue { flex-grow: 1.4; background: #1c252a; color: #fff; }
.atlas-empty { min-height: 60dvh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; text-align: center; }
.atlas-empty h1 { font-size: 20px; }
.atlas-empty .btn {
  min-height: 46px; padding-inline: 14px; border: 0; border-radius: 18px;
  background: #fff; background: light-dark(#fff, #2a2e35); color: var(--ink); font-size: 15px; box-shadow: 0 2px 4px #0002;
}
.atlas-directory { min-width: 0; }
.atlas-directory h1 { font-size: 25px; }
.atlas-directory .page-title { margin-block: 2px 8px; }
.atlas-directory .search { width: 100%; margin-block: 10px; }
.atlas-directory .trail { max-height: 445px; overflow-y: auto; }
.atlas-stats { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.atlas-stats .icon { width: 14px; color: var(--leaf); }
.shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 820px; margin-inline: auto; gap: 16px 22px; }
.book { display: block; border: 0; background: transparent; overflow: visible; }
.book-art { display: block; position: relative; overflow: hidden; border-radius: 5px; box-shadow: 0 2px 5px #221a1740; }
.book-art img { width: 100%; height: auto; max-height: none; aspect-ratio: 0.71; }
.jacket-label { position: absolute; inset: auto 0 0; display: grid; align-content: end; min-height: 45%; padding: 12px 9px 7px; background: linear-gradient(transparent, #161f24d4 44%, #161f24f5); color: #fff; line-height: 1.3; }
.jacket-label small { color: #f4e7af; font-family: ui-monospace, monospace; }
.jacket-label strong { font-size: 17px; }
.jacket-label > span { overflow-wrap: anywhere; font-size: 12px; }
.book-ribbon { position: absolute; top: 0; right: 8px; padding: 2px 4px 6px; background: #f4dc91; color: #333222; border-radius: 0 0 5px 5px; }
.book-ribbon .icon { width: 15px; }
.book-info { display: block; padding: 7px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.jacket-edge { display: none; }

@media (max-width: 950px) {
  .atlas-layout { gap: 12px; }
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
}
@media (max-width: 740px) {
  .sidebar { inset: auto 50% calc(env(safe-area-inset-bottom) + 6px) auto; transform: translateX(50%); width: min(calc(100% - 24px), 284px); padding: 2px 4px; border: 1px solid var(--stroke); border-radius: 8px; box-shadow: 0 3px 10px #252c262a; }
  #navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #navigation a { min-height: 43px; }
  .topbar > div:nth-child(2) { gap: 0; }
  .topbar .profile { display: none; }
  .atlas-layout { grid-template-columns: 1fr; gap: 14px; }
  .atlas { min-height: max(490px, calc(100svh - 145px)); }
  .atlas-route { min-height: 338px; }
  .atlas-directory .trail { max-height: 310px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 630px) {
  .sidebar { inset: 0 auto 0 0; width: calc(68px + env(safe-area-inset-left)); padding: 9px 4px 6px calc(4px + env(safe-area-inset-left)); border-radius: 0; transform: none; border: 0; border-right: 1px solid var(--stroke); box-shadow: none; }
  .brand, .sidebar-bottom { display: none; }
  #navigation { grid-template-columns: 1fr; gap: 4px; }
  #navigation a { flex-direction: column; justify-content: center; gap: 3px; padding: 4px; font-size: 11px; }
  .workspace { margin-left: calc(68px + env(safe-area-inset-left)); }
  .topbar { min-height: 44px; padding: 2px max(9px, env(safe-area-inset-right)); }
  .topbar .icon-btn { height: 36px; }
  main { padding: 9px max(9px, env(safe-area-inset-right)) 25px 9px; }
  .atlas-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .atlas { min-height: 310px; height: max(310px, calc(100svh - 61px)); }
  .atlas-route { min-height: 145px; }
  .atlas-header { padding-top: 5px; }
  .stop-number { width: calc(var(--marker-width) * .56); height: calc(var(--marker-height) * .56); }
  .atlas-pages { margin-block: 2px 3px; }
  .atlas-pages .icon-btn { height: 29px; }
  .atlas-actions { padding-bottom: 5px; }
  .atlas-actions .btn { min-height: 37px; padding-inline: 6px; }
  .atlas-directory h1 { font-size: 22px; }
  .atlas-directory .trail { max-height: max(125px, calc(100svh - 197px)); }
  .trail-row { min-height: 49px; padding-block: 5px; }
  .lesson-card { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
  .lesson-card img { max-height: min(39vh, 240px); object-fit: contain; }
  .lesson-body { grid-template-columns: minmax(0, 1fr) auto; }
  .lesson-guide img { width: 45px; height: 45px; }
  .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 630px) and (max-width: 590px) {
  .atlas-layout { grid-template-columns: 1fr; }
  .lesson-body { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (orientation: portrait) and (max-width: 740px) {
  :root:is([data-theme="light"], [data-theme="system"]) {
    --bg: #fff; --panel: #fff; --ink: #19191b; --muted: #56595c; --stroke: #dadcde;
    --leaf: #195390; --mint: #e7efff; --sand: #f2f3f4;
  }
  :root[data-theme="dark"] {
    --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7; --stroke: #46444f;
    --leaf: #89c0ff; --mint: #1e355a; --sand: #2a2e35;
  }
  .sidebar { bottom: calc(env(safe-area-inset-bottom) + 8px); padding: 4px; border: 1px solid #ffffff70; border-radius: 31px; backdrop-filter: blur(18px); }
  #navigation a { min-height: 48px; font-size: 12px; border-radius: 25px; gap: 2px; }
  #navigation .icon { width: 21px; height: 21px; }
  body:is([data-page="station"], [data-page="study"], [data-page="settings"]) .sidebar { display: none; }
  body:is([data-page="station"], [data-page="study"]) .topbar { display: none; }
  body:is([data-page="station"], [data-page="study"]) main { padding: calc(8px + env(safe-area-inset-top)) 20px 25px; }
  .lesson-card img { max-height: 360px; }
  .lesson-guide { display: none; }
}
@media (orientation: portrait) {
  body[data-page="map"] .topbar, body[data-page="map"] .brand, body[data-page="map"] .sidebar-bottom { display: none; }
  body[data-page="map"] .workspace { margin: 0; }
  body[data-page="map"] main { width: 100%; padding: 0; }
  body[data-page="map"] .sidebar {
    inset: auto 50% calc(env(safe-area-inset-bottom) + 8px) auto; transform: translateX(50%);
    width: min(calc(100% - 32px), 284px); padding: 4px;
    background: #faffffd9; border: 1px solid #ffffff70; border-radius: 31px; backdrop-filter: blur(18px);
  }
  body[data-page="map"] #navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="map"] #navigation a { min-height: 48px; flex-direction: column; gap: 2px; font-size: 12px; color: #19191b; border-radius: 25px; }
  body[data-page="map"] #navigation a[aria-current] { background: #252d3c17; }
  .atlas-layout { display: block; }
  .atlas { height: 100dvh; min-height: 0; border-radius: 0; }
  .atlas-empty { min-height: 100dvh; padding-block: env(safe-area-inset-top) calc(64px + env(safe-area-inset-bottom)); background: var(--atlas-paper, #fff); color: var(--atlas-ink, #19191b); }
  .atlas-empty .btn { color: inherit; }
  .atlas-art { filter: saturate(var(--atlas-saturation, .77)); }
  .atlas::after {
    background: var(--atlas-shade, linear-gradient(#00000024, #00000013, #00000049)), var(--atlas-tint, transparent);
  }
  :root[data-theme="dark"] :is(.atlas, .atlas-empty) {
    --atlas-saturation: .58;
    --atlas-tint: rgb(9 16 28 / 60%);
    --atlas-shade: linear-gradient(#00000018, #00000006, #00000024);
    --atlas-glass: #15203385;
    --atlas-ink: #f3f3f5;
    --atlas-muted: #bbbfc7;
    --atlas-paper: #000;
  }
  @media (prefers-color-scheme: dark) {
    :root[data-theme="system"] :is(.atlas, .atlas-empty) {
      --atlas-saturation: .58;
      --atlas-tint: rgb(9 16 28 / 60%);
      --atlas-shade: linear-gradient(#00000018, #00000006, #00000024);
      --atlas-glass: #15203385;
      --atlas-ink: #f3f3f5;
      --atlas-muted: #bbbfc7;
      --atlas-paper: #000;
    }
  }
  .atlas-header { position: relative; z-index: 1; padding: calc(6px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); pointer-events: none; }
  .atlas-book, .atlas-actions .secondary {
    border: 0; background: var(--atlas-glass, #f9fdff9c); color: var(--atlas-ink, #19191b);
    backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px #ffffff45, 0 2px 6px #0003;
  }
  .atlas-book { padding: 9px 22px; border-radius: 24px; pointer-events: auto; }
  .atlas-book strong { font-size: 20px; }
  .atlas-book small { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 4px; color: var(--atlas-muted, #56595c); font-size: 12px; }
  .atlas-book .icon { align-self: center; }
  .atlas-scroll {
    position: absolute; inset: 0; overflow: hidden auto; scrollbar-width: none; overscroll-behavior: contain;
    mask-image: linear-gradient(transparent 12%, #000 18%, #000 81%, transparent 90%);
    --atlas-edge: clamp(92px, 23dvh, 165px);
  }
  .atlas-scroll .atlas-board { height: calc(var(--stops) * max(96px, 11.5dvh)); }
  .atlas-scroll .atlas-board:first-child { padding-top: var(--atlas-edge); height: calc(var(--stops) * max(96px, 11.5dvh) + var(--atlas-edge)); }
  .atlas-scroll .atlas-board:last-child { padding-bottom: var(--atlas-edge); height: calc(var(--stops) * max(96px, 11.5dvh) + var(--atlas-edge)); }
  .atlas-scroll .atlas-board:only-child { height: max(100%, calc(var(--stops) * max(96px, 11.5dvh) + 2 * var(--atlas-edge))); }
  .atlas-track { position: relative; height: 100%; max-width: 500px; margin-inline: auto; }
  .atlas-path { stroke: #ffffffee; }
  .atlas-dashes { stroke: #236582aa; }
  .stop-number { width: var(--marker-width); height: var(--marker-height); }
  .stop-caption {
    left: calc(100% + 6px); width: 65px; max-width: none; padding: 3px 4px; border-radius: 13px;
    font-size: 15px; font-weight: 700; color: #005a91; background: #fffffff6;
  }
  .atlas-stop.facing-left .stop-caption { right: calc(100% + 6px); }
  .stop-caption:has(strong:not(.wide-caption)) { width: 96px; }
  .stop-caption strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stop-caption .wide-caption { display: none; }
  .stop-caption small { margin: 0; color: #005a91; font-size: inherit; }
  .atlas-actions {
    position: absolute; z-index: 1; inset: auto 0 calc(76px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: minmax(min-content, 1.05fr) minmax(min-content, 1.85fr);
    width: min(100%, 452px); margin-inline: auto;
    padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); gap: 9px;
  }
  .atlas-actions .btn {
    min-width: min-content; max-width: none; min-height: 50px; padding: 0 6px;
    border: 0; border-radius: 30px; font-size: 17px; gap: 7px;
  }
  .atlas-actions .icon { flex: none; width: 24px; height: 24px; }
  .atlas-actions .secondary:only-child { grid-column: 1 / -1; margin-inline-end: 9px; }
  .atlas-actions .atlas-continue {
    background: var(--atlas-ink, #19191b); color: var(--atlas-paper, #fff); box-shadow: 0 3px 8px #0004;
  }
}
@media (prefers-color-scheme: dark) and (orientation: portrait) and (max-width: 740px) {
  :root[data-theme="system"] {
    --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7; --stroke: #46444f;
    --leaf: #89c0ff; --mint: #1e355a; --sand: #2a2e35;
  }
}

body[data-page="guide"] { color: #19191b; background: #fff; }
.word-light {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  padding: 0; border: 0; border-radius: 8px; background: transparent;
}
.word-light:hover { background: var(--mint); }
.lamp-face { display: block; width: 23px; height: 23px; flex: none; }
.lamp-face[data-color="red"] { --lamp-fill: #ff968c; }
.lamp-face[data-color="yellow"] { --lamp-fill: #ffce44; }
.lamp-face[data-color="blue"] { --lamp-fill: #65ccfa; }
.lamp-face rect { fill: var(--lamp-fill); stroke: #202325; stroke-width: 1.7; }
.lamp-face circle { fill: #202325; }
.lamp-face path { fill: none; stroke: #202325; stroke-width: 1.7; stroke-linecap: round; }
body[data-page="guide"] :is(.topbar, .sidebar) { display: none; }
body[data-page="guide"] .workspace { margin: 0; }
body[data-page="guide"] main { width: 100%; padding: 0; }
.guide-page {
  --ink: #19191b; --muted: #56595c; --stroke: #dadee2; --panel: #fff;
  color-scheme: light; height: 100dvh; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  max-width: 640px; margin-inline: auto; overflow: hidden;
}
.guide-trail { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); height: 34px; flex: none; margin-inline: 28px; }
.guide-trail > button { z-index: 2; border: 0; padding: 0; background: transparent; }
.guide-trail-track { position: absolute; inset: 50% 15px auto; height: 7px; translate: 0 -50%; border-radius: 4px; background: #eff1f4; pointer-events: none; }
.guide-trail-track > i { display: block; height: 100%; width: calc(var(--step) * 100%); border-radius: inherit; background: #ffba62; }
.guide-trail span { position: absolute; top: 50%; left: calc(15px + (100% - 30px) * var(--position)); translate: -50% -50%; width: 4px; height: 4px; border-radius: 50%; background: #c4c5c7; pointer-events: none; }
.guide-trail .reached { background: white; }
.guide-paw { position: absolute; z-index: 3; top: 50%; left: calc(var(--step) * 100%); translate: -50% -50%; width: 28px; height: 24px; border: 1.5px solid #fff7e9; border-radius: 12px; background: #ffbb65; }
.guide-paw i { position: absolute; left: 50%; top: 50%; width: 3px; height: 3.5px; border-radius: 50%; background: #763813; }
.guide-paw i:nth-child(1) { width: 7.4px; height: 5.6px; translate: -50% -.9px; }
.guide-paw i:nth-child(2) { translate: -5.6px -3.7px; }
.guide-paw i:nth-child(3) { translate: -2.8px -6.1px; }
.guide-paw i:nth-child(4) { translate: .6px -6.2px; }
.guide-paw i:nth-child(5) { translate: 3.5px -3.7px; }
.guide-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.guide-content { min-height: 100%; padding: 14px 22px 36px; display: flex; flex-direction: column; }
.guide-content header { margin-bottom: 22px; }
.guide-content h1 { font-size: 34px; line-height: 1.16; margin: 0; }
[data-step="7"] .guide-content h1 { font-size: 30px; }
.guide-content header p { font-size: 17px; color: #56595c; margin: 8px 0 0; }
.guide-walker { width: min(335px, 100%); height: auto; aspect-ratio: .94; object-fit: contain; align-self: center; margin-block: auto; transform-origin: center bottom; }
.guide-demo { width: min(100%, 440px); margin: auto; padding: 17px; border: 1px solid var(--stroke); border-radius: 22px; }
.guide-demo-title, .guide-demo-row { display: flex; align-items: center; gap: 8px; padding-block: 8px; }
.guide-demo-title { padding: 0 0 12px; border-bottom: 1px solid var(--stroke); margin-bottom: 12px; font-size: 17px; }
.guide-demo-title strong, .guide-demo-row strong { flex: 1; }
.guide-demo-title small, .guide-demo-row span { color: #56595c; }
.guide-demo-row [lang] { font-size: 22px; }
.guide-demo-row [aria-pressed="true"] .icon { fill: #195390; }
.guide-demo-status { font-weight: 700; margin: 10px 0 0; color: var(--guide-lamp); }
.guide-demo-action { width: 100%; margin-top: 10px; color: #fff; background: #19191b; }
.guide-shelf { width: 100%; margin-top: 0; padding: 13px 14px; border-radius: 20px; }
.guide-shelf .guide-demo-title { margin-bottom: 16px; }
.guide-covers { --columns: 2; display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 22px 16px; padding-bottom: 22px; }
@media (max-width: 339px) { .guide-covers { --columns: 1; } }
@media (min-width: 482px) { .guide-covers { --columns: 3; } }
@media (min-width: 624px) { .guide-covers { --columns: 4; } }
.guide-covers button { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.guide-page .book-art { border-radius: 6px; }
.guide-page .book-art::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, #0007, #fff1); }
.guide-page .book-ribbon { width: 15px; height: 20px; padding: 0; right: 10px; background: #ff8b2e; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%); }
.guide-covers .jacket-label { min-height: 85px; padding: 10px 12px; }
.guide-covers .jacket-label strong { font-size: 20px; }
.guide-page .jacket-label small { color: #fff; font-size: 10px; }
.guide-lights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 8px; border-top: 1px solid var(--stroke); }
.guide-lights button { display: grid; justify-items: center; align-content: center; gap: 5px; height: 68px; border: 0; border-radius: 13px; background: white; }
.guide-lights button[aria-pressed="true"] { background: var(--guide-tint); }
.guide-demo [data-light="0"] { --guide-lamp: #c94753; --guide-tint: #ffefed; }
.guide-demo [data-light="1"] { --guide-lamp: #92671b; --guide-tint: #fff6da; }
.guide-demo [data-light="2"] { --guide-lamp: #195390; --guide-tint: #e8f2fb; }
.guide-lamp { display: grid; place-items: center; flex: none; }
button.guide-lamp { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; }
.guide-demo-word { overflow: hidden; border: 1px solid var(--stroke); border-radius: 17px; background: #fafafa; }
.guide-demo-art { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.guide-demo-copy { padding: 12px; }
.guide-demo-copy .guide-demo-row { padding-top: 0; }
.guide-demo-copy .guide-demo-row strong { font-size: 28px; min-width: 0; }
.guide-demo-copy .guide-demo-row .icon-btn { min-width: 34px; }
.guide-demo-notes { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.guide-demo-notes strong { white-space: pre-line; }
.guide-demo-listen { flex-shrink: 0; min-height: 36px; padding-inline: 9px; background: #e8f2ff; border: 0; color: #195390; font-size: 14px; }
.guide-demo-saved { padding-bottom: 0; margin-top: 4px; }
.guide-review-banner, .guide-review-map { position: relative; overflow: hidden; height: 128px; border-radius: 12px; background: #f3f4f4; }
.guide-review-map { height: 190px; border-radius: 15px; }
.guide-review-banner img, .guide-review-map img { width: 100%; height: 100%; object-fit: cover; }
.guide-review-route { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; }
.guide-review-route path:first-child { stroke: white; stroke-width: 5px; }
.guide-review-route path:last-child { stroke: #665f53; stroke-width: 2px; stroke-dasharray: 2 6; }
.guide-review-stop { position: absolute; left: 56%; top: 49%; translate: -50% -50%; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid white; border-radius: 50%; background: #ffba62; font-weight: 700; box-shadow: 0 2px 6px #0003; }
.guide-review-map .btn { position: absolute; bottom: 12px; left: 12px; background: white; }
.guide-review-banner > div { position: absolute; inset: auto 0 0; color: white; padding: 12px; background: #19191bc9; }
.guide-review-banner small, .guide-backup-row small { display: block; }
.guide-question-label { color: var(--muted); font-weight: 700; }
.guide-question-word { display: block; font-size: 34px; }
.guide-demo-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guide-demo-options .btn { background: #f2f3f4; justify-content: center; }
.guide-demo-options [aria-pressed="true"] { background: #e8f2ff; }
.guide-demo-options [disabled][data-guide-wrong="true"][aria-pressed="true"] { background: #ffefed; opacity: 1; }
.guide-backup-row { width: 100%; min-height: 48px; padding: 6px 0; display: grid; grid-template-columns: 24px 1fr 18px; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left; }
.guide-backup-row small { margin-top: 2px; font-size: 13px; color: var(--muted); }
.guide-demo hr { margin: 0; border: 0; border-top: 1px solid var(--stroke); }
.guide-demo-file { margin: 6px 0 6px 36px; color: #195390; font-size: 14px; font-weight: 700; }
.guide-ticket-lamps { display: grid; grid-template-columns: repeat(3, 31px) minmax(0, 1fr); align-items: center; min-height: 31px; }
.guide-ticket-lamps .lamp-face { justify-self: center; }
.guide-ticket-lamps strong { color: #195390; font-size: 15px; }
.guide-demo-ticket { display: grid; justify-items: center; gap: 8px; background: #f2f6fa; padding: 18px 10px; margin-top: 10px; }
.guide-departure { display: grid; justify-items: center; gap: 18px; margin-block: auto; }
.guide-departure .book-art { width: min(216px, 100%, max(120px, 33dvh)); transform: rotate(-2deg); }
.guide-departure .jacket-label { min-height: 65px; padding: 6px 7px; }
.guide-departure .jacket-label strong { font-size: 15px; }
.guide-departure .jacket-label > span { font-size: 10px; }
.guide-departure > strong { background: #ffeddb; border-radius: 22px; padding: 9px 16px; text-align: center; }
.guide-footer { display: grid; justify-items: stretch; padding: 6px 22px; flex: none; }
.guide-footer .text-btn { min-height: 44px; color: #56595c; font-size: 14px; justify-self: center; }
.guide-footer .guide-next { min-height: 56px; padding: 0 22px; border-radius: 28px; color: white; background: #000; font-size: 18px; justify-content: space-between; }
.portrait-lesson { max-width: 600px; margin-inline: auto; }
.portrait-lesson.has-dock { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.portrait-lesson:has(.learn-dock) { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
.practice-header { position: sticky; top: 0; z-index: 2; padding-block: 4px 6px; background: var(--bg); }
.practice-bar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; text-align: center; font-size: 15px; }
.practice-back { display: grid; place-items: center; height: 44px; border: 1px solid var(--study-back-border, #00000014); border-radius: 50%; background: var(--study-back, #f5f5f6); }
.practice-back .icon { width: 23px; height: 23px; stroke-width: 2.5px; }
.practice-progress { display: flex; align-items: center; padding: 14px; font-size: 12px; }
.practice-progress > strong { flex: none; white-space: nowrap; }
.practice-progress > span { display: flex; gap: 4px; flex: 1; min-width: 0; }
.practice-progress i { position: relative; flex: 0 1 30px; height: 16px; border-radius: 8px; background: var(--sand); overflow: hidden; }
.practice-progress i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--fill); border-radius: inherit; background: var(--study-orange); }
.practice-progress .punched::after {
  content: ""; position: absolute; inset: 0; background:
    radial-gradient(ellipse 3.68px 2.56px at 50% 62%, var(--ink) 95%, transparent),
    radial-gradient(circle 1.44px at calc(50% - 3.36px) 34%, var(--ink) 90%, transparent),
    radial-gradient(circle 1.44px at 50% 25%, var(--ink) 90%, transparent),
    radial-gradient(circle 1.44px at calc(50% + 3.36px) 34%, var(--ink) 90%, transparent);
}
.portrait-lesson .lesson-body, .portrait-lesson .lesson-card { display: block; }
.portrait-lesson .lesson-body { position: relative; }
html:has(.word-turn-overlay) { overflow-x: clip; }
.word-turn-overlay { position: fixed; inset-inline: 0; z-index: 1; overflow: clip; pointer-events: none; }
.portrait-lesson .turning-word { position: absolute; pointer-events: none; }
.portrait-lesson .lesson-card, .portrait-lesson .quiz-example { border: 1px solid var(--stroke); border-radius: 8px; overflow: hidden; padding: 0; background: var(--panel); }
.portrait-lesson .lesson-card-text, .portrait-lesson .quiz-example blockquote { padding: 14px; }
.lesson-media { display: contents; }
.portrait-lesson .lesson-card img, .portrait-lesson .quiz-example img {
  max-height: 355px; width: 100%; height: auto; aspect-ratio: auto 3 / 2;
  object-fit: contain; border-radius: 0; background: transparent;
}
.practice-term { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; min-width: 0; }
.practice-term h1 { font: 700 34px/1.1 var(--sans, system-ui); }
.practice-term .phonetic { margin: 0; }
.lesson-word-notes { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; margin-top: 10px; }
.portrait-lesson .lesson-word-notes .meaning { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.33; white-space: pre-line; }
.portrait-lesson blockquote { display: grid; gap: 8px; justify-items: start; background: transparent; border: 0; border-top: 1px solid var(--stroke); padding: 12px 0 0; }
.portrait-lesson .lesson-card blockquote p { font: 600 20px/1.3 Georgia, serif; }
.portrait-lesson .lesson-card blockquote small { font-size: 17px; }
.portrait-lesson .quiz-heading { font-size: 34px; margin-bottom: 16px; }
.portrait-lesson .quiz-prompt { display: flex; align-items: center; gap: 16px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 24px; min-height: 88px; margin-bottom: 16px; box-shadow: 0 2px 4px #0001; }
.portrait-lesson .quiz-prompt h1 { font-size: 20px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.quiz-prompt-copy { flex: 1; min-width: 0; }
.quiz-prompt-copy .phonetic { font-size: 12px; }
.quiz-prompt-copy .quiz-context-translation { font-size: 15px; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.quiz-prompt-copy .actions { gap: 8px; }
#listen-term { margin-top: 8px; font-size: 20px; animation: reveal-study-term 160ms ease-out; }
.portrait-lesson .quiz-reaction { flex: none; width: 61px; height: 61px; object-fit: contain; animation: study-reaction 405ms cubic-bezier(.333333,1.5,.666667,1); }
.portrait-lesson .quiz-reply {
  display: flex; align-items: center; gap: 8px; min-height: 45px; padding: 8px 15px; margin-bottom: 13px;
  border: 1px dashed var(--muted); border-radius: 32px; color: var(--muted); font-size: 16px; font-weight: 700;
  overflow-wrap: anywhere;
}
.portrait-lesson .quiz-reply.selected { border-color: var(--study-orange); border-style: solid; box-shadow: inset 0 0 0 1px var(--study-orange); background: var(--study-selected); color: var(--ink); }
.portrait-lesson .options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.portrait-lesson .option {
  display: grid; align-content: start; gap: 4px; min-height: 84px; border-radius: 18px;
  padding: 10px 13px; color: var(--ink); line-height: 1.3; font-size: 18px;
}
@media (orientation: portrait) {
  .portrait-lesson .option { align-self: start; }
  .portrait-lesson .options > .option:last-child:nth-child(odd) {
    grid-column: 1 / -1; margin-inline-end: 5px;
  }
}
.portrait-lesson .option-top { display: flex; align-items: center; justify-content: space-between; margin: 0; }
.portrait-lesson .option-top b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 12px; background: var(--sand); color: var(--muted); font: 12px monospace; }
.portrait-lesson .option-mark { color: var(--study-orange); font-size: 14px; font-style: normal; }
.portrait-lesson .option[aria-pressed="true"]:not(:disabled) { background: var(--study-option-selected); border-color: var(--study-orange); box-shadow: inset 0 0 0 1px var(--study-orange); }
.portrait-lesson .option:is([aria-pressed="true"], .right) b { background: var(--ink); color: var(--panel); }
.portrait-lesson .option[aria-pressed="true"] .option-mark::before { content: "\25cf"; }
.portrait-lesson .option.right { background: var(--panel); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.portrait-lesson .option.right .option-mark::before { content: "\2713"; color: var(--ink); }
.portrait-lesson .option.wrong {
  background: var(--study-option-wrong, var(--study-wrong));
  border-color: var(--study-red); box-shadow: inset 0 0 0 1px var(--study-red);
}
.portrait-lesson .option.wrong .option-mark::before { content: "\00d7"; color: var(--study-red); }
.portrait-lesson .option.wrong b { background: var(--study-red); }
.portrait-lesson .feedback {
  padding: 12px 14px; border-radius: 24px; justify-content: flex-start; margin-bottom: 12px;
  overflow-wrap: anywhere; animation: study-feedback 260ms cubic-bezier(.333333,1.216667,.666667,1);
}
.portrait-lesson .feedback .quiz-reaction { width: 76px; height: 76px; }
.portrait-lesson .feedback.right { background: var(--ink); color: var(--panel); }
.portrait-lesson .feedback.wrong { background: var(--study-wrong); color: var(--ink); }
.portrait-lesson .feedback > div { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.feedback-term { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; min-width: 0; }
.feedback-term > * { min-width: 0; }
.portrait-lesson .feedback h2 { font-size: 28px; }
.portrait-lesson .feedback .phonetic { color: inherit; font-size: 15px; opacity: .78; }
.portrait-lesson .feedback .feedback-result { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 17px; }
.portrait-lesson .feedback-result span { margin: 0; }
.portrait-lesson .feedback.right .feedback-result { color: var(--study-feedback-accent); }
.portrait-lesson .feedback.wrong :is(.feedback-result, .feedback-given) { color: var(--study-red); }
.portrait-lesson .feedback-given { font-size: 14px; }
.portrait-lesson .feedback-streak { font-size: 15px; font-weight: 700; }
.portrait-lesson .feedback-meaning { font-size: 17px; font-weight: 700; white-space: pre-line; }
.portrait-lesson .quiz-example { border-radius: 24px; box-shadow: 0 2px 4px #0001; }
.portrait-lesson .quiz-example blockquote { display: grid; gap: 8px; justify-items: start; margin: 0; padding: 16px; border: 0; }
.portrait-lesson .quiz-example p { font: 600 20px/1.3 Georgia, serif; }
.portrait-lesson .quiz-example small { font-size: 17px; }
.quiz-options-review { margin-top: 10px; }
.quiz-options-review > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 8px 10px; border-radius: 18px;
  cursor: pointer; list-style: none; background: var(--panel); color: var(--study-blue); font-weight: 700;
}
.quiz-options-review > summary::-webkit-details-marker { display: none; }
.quiz-options-review > summary .icon { flex: none; width: 16px; height: 16px; transform: rotate(90deg); }
.quiz-options-review[open] > summary .icon { transform: rotate(-90deg); }
html:has(.quiz-frame) {
  scroll-padding-top: calc(100px + env(safe-area-inset-top));
  scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.portrait-lesson #spell-form input { width: 100%; min-height: 54px; padding: 10px 15px; border-radius: 18px; font-size: 22px; scroll-margin: 6px 0; }
.letter-header { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.letter-header strong { flex: 1; font-size: 17px; }
.letter-header .icon-btn { width: 50px; height: 46px; flex-basis: 50px; }
.letter-header .icon-btn:disabled { opacity: .4; }
.letter-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(54px, 100%), 1fr)); gap: 6px; margin: 3px; }
.letter-tiles button { min-height: 44px; border: 1px solid var(--study-stamp-border); border-radius: 12px; background: var(--panel); font-size: 21px; box-shadow: 0 2px 4px #0002; }
.practice-dock { position: fixed; z-index: 3; inset: auto 0 0; background: var(--panel); padding: 6px 20px calc(7px + env(safe-area-inset-bottom)); }
main[data-study-keyboard] :is(.letter-header, .letter-tiles) { display: none; }
main[data-study-keyboard] .practice-dock { bottom: var(--study-keyboard-inset); padding-bottom: 7px; }
main[data-study-keyboard] .portrait-lesson.has-dock { padding-bottom: calc(76px + var(--study-keyboard-inset)); }
.practice-dock .actions { max-width: 560px; margin-inline: auto; flex-wrap: nowrap; }
.practice-dock .btn { flex: 1; min-height: 53px; border-radius: 28px; padding-inline: 12px; font-size: 17px; }
.practice-dock .check-dock .btn { min-height: 56px; border-radius: 36px; }
.practice-dock .check-dock .secondary { background: var(--sand); border-color: transparent; }
.practice-dock .turn-dock .primary, .practice-dock.learn-dock .primary { justify-content: space-between; padding-inline: 20px; }
.practice-dock .primary .icon { width: 20px; height: 20px; }
.practice-dock .turn-dock .primary .icon, .practice-dock.learn-dock .primary .icon { order: 2; }
.practice-dock.learn-dock .actions { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
.practice-dock.learn-dock .secondary { border: 0; min-height: 44px; }
.practice-dock .primary { background: var(--ink); color: var(--panel); }
.practice-dock .primary:disabled { opacity: .72; cursor: default; }
.portrait-lesson .practice-listen, .portrait-lesson .practice-show-term { min-height: 48px; border: 0; border-radius: 28px; padding: 8px 10px; font-size: 15px; }
.portrait-lesson .practice-listen { color: var(--study-blue); background: var(--blue); }
.portrait-lesson .practice-show-term { color: var(--ink); background: var(--sand); }
.study-voice-wave { display: grid; grid-template-columns: repeat(11, 1fr); place-items: center; flex: 0 0 21px; width: 21px; height: 28px; }
.study-voice-wave i { display: block; width: .88px; height: var(--bar-height); border-radius: 1px; background: currentColor; }
main[data-prompt-playing] .study-voice-wave i { animation: study-voice-wave 349ms linear infinite var(--bar-offset); }
:root[data-motion="reduce"] .study-voice-wave i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  main[data-prompt-playing] .study-voice-wave i { animation: none; }
}
@keyframes study-voice-wave {
  0%, 50%, 100% { transform: scaleY(.78); }
  25% { transform: scaleY(1); }
  75% { transform: scaleY(.56); }
}
body:has(.portrait-lesson) {
  --bg: #fff; --panel: #fff; --ink: #19191b; --muted: #56595c; --stroke: #dadee2;
  --sand: #f2f3f4; --blue: #e7efff; color: var(--ink); background: var(--bg);
  --study-orange: #fd893f; --study-feedback-accent: #ffab63; --study-selected: #ffecd8;
  --study-option-selected: #fff2e6; --study-wrong: #ffeeeb; --study-red: #b22c3a;
  --study-blue: #195795; --study-stamp-border: #a0b8d3;
}
body:has(.portrait-lesson) :is(.sidebar, .topbar) { display: none; }
body:has(.portrait-lesson) .workspace { margin: 0; }
:root[data-theme="dark"] body:has(.portrait-lesson) {
  --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7; --stroke: #464a52;
  --sand: #2a2e35; --blue: #1e344a;
  --study-orange: #ff9d63; --study-feedback-accent: #9e3800; --study-selected: #432d22;
  --study-option-selected: #443023; --study-option-wrong: #452622; --study-wrong: #402320; --study-red: #ff9aa4;
  --study-blue: #89c4ff; --study-stamp-border: #536c87;
  --study-card: #17191d; --study-back: #121315; --study-back-border: #ffffff14;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] body:has(.portrait-lesson) {
    --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7; --stroke: #464a52;
    --sand: #2a2e35; --blue: #1e344a;
    --study-orange: #ff9d63; --study-feedback-accent: #9e3800; --study-selected: #432d22;
    --study-option-selected: #443023; --study-option-wrong: #452622; --study-wrong: #402320; --study-red: #ff9aa4;
    --study-blue: #89c4ff; --study-stamp-border: #536c87;
    --study-card: #17191d; --study-back: #121315; --study-back-border: #ffffff14;
  }
}
/* Android fits one stamp per 60dp after subtracting 32dp, up to 640dp. */
@media (orientation: portrait) {
  .letter-tiles { grid-template-columns: repeat(var(--stamp-columns, 2), minmax(0, 1fr)); }
}
@media (orientation: portrait) and (min-width: 212px) { .letter-tiles { --stamp-columns: 3; } }
@media (orientation: portrait) and (min-width: 272px) { .letter-tiles { --stamp-columns: 4; } }
@media (orientation: portrait) and (min-width: 332px) { .letter-tiles { --stamp-columns: 5; } }
@media (orientation: portrait) and (min-width: 392px) { .letter-tiles { --stamp-columns: 6; } }
@media (orientation: portrait) and (min-width: 452px) { .letter-tiles { --stamp-columns: 7; } }
@media (orientation: portrait) and (min-width: 512px) { .letter-tiles { --stamp-columns: 8; } }
@media (orientation: portrait) and (min-width: 572px) { .letter-tiles { --stamp-columns: 9; } }
@media (orientation: portrait) and (min-width: 632px) { .letter-tiles { --stamp-columns: 10; } }
@media (orientation: landscape) {
  body:has(.portrait-lesson) main {
    padding: env(safe-area-inset-top) max(22px, env(safe-area-inset-right)) 16px max(22px, env(safe-area-inset-left));
  }
  .portrait-lesson { max-width: 1024px; }
  .portrait-lesson.has-dock, .portrait-lesson:has(.learn-dock) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .practice-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 32%); align-items: center; gap: 16px; }
  .practice-progress { padding-inline: 4px 0; }
  .portrait-lesson .quiz-frame { margin-inline: auto; }
  .portrait-lesson :is(.lesson-card, .quiz-example):has(> .lesson-media) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); align-items: center;
    gap: 0; border-radius: 24px;
  }
  .portrait-lesson .lesson-media {
    display: block; position: relative; width: 100%; aspect-ratio: 3 / 2; justify-self: center;
    overflow: hidden; background: var(--sand);
  }
  .portrait-lesson .lesson-media .lesson-art {
    position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; max-height: none;
    aspect-ratio: auto; object-fit: contain; object-position: center;
  }
  .portrait-lesson .lesson-media .lesson-art[data-original-art] {
    max-width: min(100%, calc(var(--original-art-width) / var(--art-pixel-ratio, 1)));
  }
  .portrait-lesson .lesson-card-text { padding: 16px; }
  .portrait-lesson .quiz-question {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 16px;
  }
  .portrait-lesson .quiz-question:has(#spell-form) { padding-top: 6px; }
  html:has(.quiz-frame) { scroll-padding-top: 64px; }
  .practice-dock .actions { max-width: 740px; }
  .practice-dock.learn-dock .actions { flex-direction: row; align-items: center; gap: 10px; }
  .practice-dock.learn-dock .primary { order: 1; }
  .practice-dock.learn-dock .secondary { background: var(--sand); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .practice-header { padding-block: 1px 4px; }
  .portrait-lesson .quiz-heading { font-size: 28px; margin-bottom: 9px; }
  .portrait-lesson .lesson-card-text { padding: 10px 14px; }
  .portrait-lesson .lesson-card .practice-term h1 { font-size: 28px; }
  .lesson-word-notes { margin-top: 6px; }
  .portrait-lesson .lesson-word-notes .meaning { margin: 0; overflow-wrap: anywhere; }
  .portrait-lesson .lesson-card blockquote { gap: 5px; margin: 8px 0 0; padding-top: 8px; }
  .portrait-lesson .lesson-card blockquote p { font-size: 18px; }
  .portrait-lesson .lesson-card .practice-listen { min-height: 44px; }
  .portrait-lesson .lesson-media { width: min(100%, max(170px, calc((100dvh - 150px) * 1.5))); }
}
@media (orientation: landscape) and (min-height: 650px) and (min-width: 960px) {
  .portrait-lesson .lesson-body:has(> .lesson-card:first-child) {
    display: flex; align-items: center; min-height: calc(100dvh - 128px);
  }
  .portrait-lesson .lesson-body > .lesson-card { width: 100%; }
}
@keyframes study-reaction { from { transform: rotate(-7deg) scale(.86); } to { transform: none; } }
@keyframes study-feedback { from { transform: translateY(10px); opacity: .65; } to { transform: none; opacity: 1; } }
@keyframes reveal-study-term { from { opacity: 0; } }
:root[data-motion="reduce"] .portrait-lesson :is(.quiz-reaction, .feedback, #listen-term) { animation: none; }
@media (orientation: portrait) {
  html:has(.practice-dock.learn-dock) { scroll-padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  body[data-page="study"]:has(.portrait-lesson) main {
    width: 100%; max-width: none; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  }
  .portrait-lesson { max-width: none; }
  .portrait-lesson .lesson-body { max-width: 600px; margin-inline: auto; }
  .portrait-lesson .lesson-card { border-radius: 18px; background: var(--study-card, var(--panel)); }
  .portrait-lesson .lesson-card img { max-height: none; }
  .portrait-lesson .lesson-card blockquote { margin: 12px 0 0; }
  .portrait-lesson .lesson-card .practice-listen { height: 46px; min-height: 46px; padding-inline: 14px; }
  .practice-dock.learn-dock { background: var(--bg); }
  .practice-dock.learn-dock .actions { max-width: none; }
  .practice-dock.learn-dock .primary { border-radius: 18px; color: var(--bg); }
  .practice-dock.learn-dock .secondary { background: transparent; font-size: 15px; }
}
.journal-home { width: min(100%, 608px); margin-inline: auto; display: grid; gap: 14px; }
.journal-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.journal-heading h1 { margin: 0; font-size: 34px; font-weight: 800; }
.journal-heading .icon-btn { border: 1px solid var(--stroke); border-radius: 50%; }
.journal-shop { height: 166px; position: relative; isolation: isolate; overflow: hidden; border-radius: 8px; text-align: left; color: white; }
.journal-shop::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(25deg, #0009, transparent 70%); }
.journal-shop img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; }
.journal-shop strong { position: absolute; bottom: 14px; left: 15px; font-size: 22px; }
.journal-shop .icon { position: absolute; bottom: 12px; right: 15px; width: 30px; height: 30px; padding: 5px; background: #f8f8f1; color: #19191b; border-radius: 50%; transform: rotate(-40deg); }
.journal-thanks {
  min-height: 81px; padding: 13px 18px; display: grid; justify-items: start; align-content: center; gap: 4px;
  border: 1px solid #dfd1b9; border-radius: 8px; color: #352b24; background: #f8ead6; margin-top: 8px;
}
.journal-thanks strong { font-size: 18px; }
.journal-thanks .icon { width: 15px; height: 15px; }
.journal-week {
  --week-paper: #e4f1fc;
  --week-border: #d2dbdf;
  --week-blue: #185487;
  --week-sky: #dcecf9;
  position: relative; isolation: isolate; padding: 15px;
}
html[data-theme="dark"] .journal-week {
  --week-paper: #19293a; --week-border: #39464e; --week-blue: #9dcdf2; --week-sky: #263d52;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .journal-week {
    --week-paper: #19293a; --week-border: #39464e; --week-blue: #9dcdf2; --week-sky: #263d52;
  }
}
.journal-week::before {
  content: ""; position: absolute; z-index: -1; inset: 3px 0 0;
  border: 1px solid var(--week-border); border-radius: 18px;
  background: linear-gradient(140deg, var(--week-paper), var(--panel));
}
.journal-week::after {
  content: ""; position: absolute; top: 1px; left: 20px; width: 6px; height: 10px;
  border: 2px solid #7195b2; border-radius: 3px;
}
.journal-week-head::before {
  content: ""; position: absolute; top: 1px; right: 20px; width: 6px; height: 10px;
  border: 2px solid #7195b2; border-radius: 3px;
}
.journal-week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.journal-week-head h2 { margin: 0; font-size: 22px; font-weight: 900; }
.journal-week-head small { color: var(--muted); font-size: 12px; font-weight: 700; }
.journal-week-head .icon { color: var(--week-blue); width: 21px; height: 21px; }
.journal-week-head > span { font-size: 15px; font-weight: 700; }
.journal-week-head > span .icon { width: 15px; color: inherit; }
.journal-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 13px; }
.journal-week-days button {
  position: relative; min-width: 0; display: grid; justify-items: center; grid-template-rows: 16px 16px 37px auto;
  padding: 0; border: 0; border-radius: 8px; background: transparent;
}
.journal-week-days button:not(:last-child)::after {
  content: ""; position: absolute; top: 6px; left: calc(50% + 7px); width: max(0px, calc(100% - 14px)); height: 5px;
  border-bottom: 1px dashed #739cb47a; border-radius: 50%; pointer-events: none;
}
.journal-week-days button:nth-child(even)::after {
  top: 3px; border-bottom: 0; border-top: 1px dashed #739cb47a;
}
.journal-week-days button:hover { background: var(--week-sky); }
.journal-week-days strong {
  align-self: end; width: min(32px, 100%); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: 17px;
}
.journal-week-days .studied strong { background: var(--week-sky); }
.journal-week-days .today strong { background: var(--ink); color: var(--panel); }
.journal-week-days small { color: var(--muted); font-size: 11px; font-weight: 700; }
.journal-week-days small:last-child { margin-top: 3px; }
.journal-week-days .studied small:last-child { color: var(--week-blue); }
.week-star { color: #8bacbe; font-size: 10px; }
.journal-week-days .studied .week-star { color: #b9630c; font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="reduce"]) .week-star {
    animation: journal-star 400ms cubic-bezier(.333, 1.25, .667, 1) calc(var(--day-index) * 35ms) both;
  }
}
@keyframes journal-star { from { transform: translateY(-5px) scale(.58); } to { transform: none; } }
.journal-week-foot { border-top: 1px solid var(--stroke); margin-top: 10px; padding-top: 12px; font-weight: 700; font-size: 14px; }
.journal-week-check-in {
  display: grid; grid-template-columns: 57px minmax(0, 1fr) 20px; align-items: center; gap: 13px;
  width: 100%; min-height: 78px; border: 0; border-radius: 17px; padding: 12px 13px;
  color: #fff; background: linear-gradient(135deg, #262426, #101010 55%, #060606); text-align: start;
  box-shadow: 0 2px 4px #0002;
}
.journal-week-check-in strong, .journal-week-check-in small { display: block; overflow-wrap: anywhere; }
.journal-week-check-in strong { font-size: 20px; }
.journal-week-check-in small { color: #eee; font-size: 14px; font-weight: 400; }
.journal-check-in-print { position: relative; display: grid; place-items: center; height: 55px; }
.journal-check-in-print::before {
  content: ""; position: absolute; width: 51px; height: 49px; background: #194f85;
  border-radius: 5px; transform: rotate(5deg);
}
.journal-check-in-print > span {
  width: 53px; height: 48px; padding: 3px; border-radius: 5px; background: #fff;
  color: #194f85; transform: rotate(-7deg);
}
.journal-check-in-print img { display: block; width: 100%; height: 31px; object-fit: cover; }
.journal-check-in-print .icon { display: block; width: 9px; height: 9px; margin: 1px 0 0 auto; }
.journal-albums { display: flex; gap: 11px; padding: 3px 1px 6px; overflow-x: auto; scrollbar-width: none; }
.journal-album {
  position: relative; isolation: isolate; flex: 0 0 116px; height: 164px; padding: 5px 7px 5px 5px;
  overflow: hidden; border-radius: 6px; text-align: center; color: #f7d69b;
  background: linear-gradient(90deg, transparent 5%, #0003 5% 10%, transparent 10%) var(--album);
  box-shadow: 0 2px 4px #0003;
}
.journal-album-stock { position: absolute; z-index: -1; inset: 0; width: 116px; height: 164px; }
.journal-album::after {
  content: ""; position: absolute; z-index: -1; inset: 4px 0 4px auto; width: 3px;
  border-radius: 1px; background: repeating-linear-gradient(90deg, #f7e9cc 0 1px, #b6a589 1px 2px);
}
.journal-album-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;
  border: 1px solid #f7d69b80; border-radius: 2px; font-size: 12px; font-weight: 700; line-height: 1.22;
}
.journal-album-label strong { margin-top: 3px; font-size: 16px; }
.journal-album-label small { font-size: 10px; }
.journal-album-label small:last-child { margin-top: 8px; font-size: 11px; }
.journal-album-mark { display: block; width: 36px; height: 36px; margin-top: 6px; }
.journal-calendar {
  --calendar-paper: #fffdfa;
  --calendar-studied: #e7f0fc;
  --calendar-selected: #205792;
  --calendar-selected-ink: #fff;
  width: min(100%, 620px); margin-inline: auto;
}
:root[data-theme="dark"] .journal-calendar {
  --calendar-paper: #24262c; --calendar-studied: #283e58;
  --calendar-selected: #9ec7fb; --calendar-selected-ink: #152435;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .journal-calendar {
    --calendar-paper: #24262c; --calendar-studied: #283e58;
    --calendar-selected: #9ec7fb; --calendar-selected-ink: #152435;
  }
}
.calendar {
  border: 1px solid var(--stroke); border-radius: 17px; overflow: hidden;
  box-shadow: 0 3px 8px #0002; background: var(--calendar-paper);
}
.calendar-head {
  padding: 3px 13px 8px; border-bottom: 3px solid #ff9b2c; color: #fff;
  background: linear-gradient(135deg, #a4232e, #e0452e 57%, #ba2926);
}
.calendar-rings { height: 18px; display: flex; align-items: center; justify-content: space-around; }
.calendar-rings i { width: 8px; height: 14px; border: 2px solid #fff8; border-radius: 5px; background: #601a2b; }
.calendar-heading { display: flex; align-items: center; gap: 7px; }
.calendar-pick {
  flex: 1; min-width: 0; display: grid; justify-items: start; gap: 1px;
  border: 0; background: none; padding: 0; text-align: start; color: inherit;
}
.calendar-pick:focus-visible, .calendar-arrows .icon-btn:focus-visible { outline-color: #fff; }
.calendar-pick small { display: flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 700; }
.calendar-pick .icon { width: 13px; height: 13px; }
.calendar-pick strong { font-size: 34px; line-height: 1.14; }
.calendar-reaction { width: 48px; height: 48px; object-fit: contain; transform: rotate(-7deg); }
.calendar-arrows {
  display: flex; border: 1px solid #fff5; border-radius: 22px; background: #0003;
}
.calendar-arrows .icon-btn { width: 39px; height: 40px; border: 0; background: transparent; color: inherit; }
.month-pages { position: relative; }
.month-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 24px repeat(6, 44px);
  padding: 7px 5px; background: var(--calendar-paper);
}
.month-page-copy { position: absolute; inset: 0; pointer-events: none; }
.month-page-tear { transform-origin: top left; will-change: transform, clip-path; }
.month-page-tear::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 38px; opacity: var(--tear-sheen, 0);
  background: linear-gradient(169deg, #0006, #fffb 10px, #fff0 36px);
}
.month-grid .weekday, .month-grid .day { display: grid; place-content: center; text-align: center; }
.month-grid .weekday { color: var(--muted); font-size: 13px; }
.month-grid .weekday:nth-child(6), .month-grid .weekday:nth-child(7) { color: #d65a55; }
.month-grid .day { min-width: 0; border-radius: 10px; line-height: 1.1; font-size: 16px; }
.month-grid .day small { margin-top: 2px; font-size: 12px; }
.month-grid .day.studied { background: var(--calendar-studied); font-size: 14px; }
.month-grid .day[aria-current="date"] { background: var(--calendar-selected); color: var(--calendar-selected-ink); }
.month-grid .day:focus-visible { outline-offset: -2px; }
.calendar-records { margin-top: 14px; }
.calendar-records > p { color: var(--muted); }
.calendar-records h2 { margin: 15px 0 8px; font-size: 20px; }
.calendar-date-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.calendar-date-form input { flex: 1; }

@media (orientation: portrait) {
  body[data-view="calendar"] .sidebar { display: none; }
  body[data-view="calendar"] main { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (min-width: 720px) {
  .journal-calendar {
    width: min(100%, 950px); display: grid;
    grid-template-columns: minmax(290px, 1.25fr) minmax(240px, 1fr);
    gap: 0 22px; align-items: start;
  }
  .journal-calendar .check-in-header { grid-column: 1 / -1; }
  .calendar-records { margin-top: 0; }
}
.journal-pocket {
  position: relative; display: block; isolation: isolate; height: 148px;
  border-radius: 20px; overflow: hidden; background: #122c36; color: #fff;
}
.journal-pocket-fan {
  position: absolute; inset: 0; display: grid; place-items: start center;
  text-align: center; font-size: 13px;
}
.journal-pocket-fan p { display: grid; place-items: center; height: 90px; margin: 0; padding-inline: 14px; }
.journal-ticket-slot { position: absolute; }
.journal-ticket-slot .ticket-face, .ticket-flight-pocket-face .ticket-face {
  width: 340px; height: 173px; min-height: 0; transform-origin: top left;
  transform: scale(var(--ticket-scale, var(--flight-scale, 1)));
}
.journal-pocket-tab {
  position: absolute; inset: auto 0 0; display: flex; align-items: center; height: 58px;
  padding: 0 18px; gap: 10px;
  background: linear-gradient(#d4af70, #d4af70) 0 2px / 100% 2px no-repeat,
    linear-gradient(109deg, #286774, #10343d);
}
.journal-pocket-tab::before {
  content: ""; position: absolute; inset: 8px 6px 5px;
  border: 1px dashed #c2c0ae; border-radius: 6px; pointer-events: none;
}
.journal-pocket-tab::after {
  content: ""; position: absolute; top: 0; left: calc(50% - 11px); width: 22px; height: 10px;
  border-radius: 2px; background: linear-gradient(#896c3f, #896c3f) center / 8px 2px no-repeat, #e6bf77;
}
.journal-pocket-tab > .icon { width: 23px; height: 23px; color: #f7d69b; }
.journal-pocket-tab strong { flex: 1; font-size: 22px; }
.journal-pocket-tab span { white-space: nowrap; }
.ticket-flight, .ticket-flight-cards { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ticket-flight { z-index: 9; }
.ticket-flight-pocket, .ticket-flight-card { position: absolute; }
.ticket-flight-card { top: 0; left: 0; border-radius: 16px; box-shadow: 0 4px 12px #0004; }
.ticket-flight-paper { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; }
.ticket-flight-paper > div { position: absolute; inset: 0; }
.ticket-flight-drawer-face .ticket-face { width: 100%; height: 100%; min-height: 0; }
.journal-thanks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr)); gap: 10px; }
.album-view { width: min(100%, 616px); margin-inline: auto; display: grid; gap: 7px; }
.album-actions { display: flex; align-items: center; gap: 9px; min-height: 45px; }
.album-actions button { border: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 700; }
.album-actions button:first-of-type { margin-inline-start: auto; min-height: 42px; padding-inline: 5px; }
.album-actions .album-emblem {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--album); border-radius: 50%; background: #f7d69b;
}
.album-emblem canvas { display: block; width: 19px; height: 19px; }
.album-volume {
  display: grid; grid-template-rows: auto minmax(315px, 1fr) auto; min-height: max(419px, calc(100dvh - 188px));
  overflow: hidden; padding: 0 3px 0 6px; background: var(--album); color: #fff; border-radius: 8px;
}
.album-heading {
  min-height: 62px; display: grid; grid-template-columns: 41px minmax(0, 1fr) max-content;
  align-items: center; gap: 8px; padding: 9px 10px;
}
.album-heading canvas { display: block; width: 41px; height: 41px; }
.album-heading span { display: block; color: #f7d69b; font-size: 12px; font-weight: 700; }
.album-heading h1 { margin: 0; font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.album-heading > strong { font-size: 13px; }
.album-pagination { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; }
.album-pagination button {
  min-height: 45px; display: grid; place-items: center; padding: 0; border: 0; background: none;
  color: #fff; font-size: 15px; font-weight: 700;
}
.album-pagination button:disabled { opacity: .32; cursor: default; }
.album-pagination button:nth-child(2):disabled { opacity: 1; }
.album-pager { position: relative; overflow: hidden; touch-action: pan-y; }
.album-curl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.album-leaf-curling { visibility: hidden; }
.album-leaf {
  position: absolute; inset: 0; overflow: hidden;
  background: repeating-linear-gradient(transparent 0 23px, color-mix(in srgb, var(--album) 13%, transparent) 23px 24px) #faf4e7;
  color: var(--album);
}
:root[data-theme="dark"] .album-leaf { background-color: #e9dfca; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .album-leaf { background-color: #e9dfca; }
}
.album-leaf.primary::before {
  position: absolute; content: ""; left: 19px; top: 0; bottom: 0; border-left: 1px solid #d88a7770;
}
.album-sheet-index { position: absolute; top: 6px; left: 13px; font: 700 11px monospace; }
.album-empty { position: absolute; inset: 0; display: grid; place-content: center; font-size: 17px; color: #726f69; }
.album-clipping {
  position: absolute; top: var(--clipping-y, 49%); left: var(--clipping-x, 50%); transform: translate(-50%, -50%);
  width: var(--clipping-width, 87%); height: var(--clipping-height, 66%); padding: 10px 12px;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 6px;
  container-type: size;
}
.album-clipping.picture-first { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.album-clipping.picture-first .album-photo { grid-column: 1; }
.album-clipping.picture-first .album-caption { grid-column: 2; }
.album-leaf[data-count="2"] .album-clipping { --clipping-y: 29%; --clipping-x: 46%; --clipping-height: 40%; }
.album-leaf[data-count="2"] .album-clipping:last-child { --clipping-y: 71%; --clipping-x: 54%; --clipping-height: 41%; }
.album-leaf[data-count="3"] .album-clipping { --clipping-y: 23%; --clipping-x: 47%; --clipping-width: 89%; --clipping-height: 29%; }
.album-leaf[data-count="3"] .album-clipping:nth-of-type(2) { --clipping-y: 53.5%; --clipping-x: 54%; --clipping-width: 86%; --clipping-height: 28%; }
.album-leaf[data-count="3"] .album-clipping:nth-of-type(3) { --clipping-y: 83%; }
.album-leaf.three-offset[data-count="3"] .album-clipping { --clipping-y: 22.5%; --clipping-x: 54%; }
.album-leaf.three-offset[data-count="3"] .album-clipping:nth-of-type(2) { --clipping-y: 52.5%; --clipping-x: 47%; }
.album-leaf.three-offset[data-count="3"] .album-clipping:nth-of-type(3) { --clipping-y: 82%; }
.album-leaf.mirrored .album-clipping { left: calc(100% - var(--clipping-x, 50%)); }
.album-photo, .album-caption { grid-row: 1; min-width: 0; }
.album-photo {
  position: relative; display: block; width: 100%; width: min(100%, 150cqh); justify-self: center;
  height: auto; max-height: min(100%, 191px); aspect-ratio: 3 / 2;
  grid-column: 2; padding: 3px; border: 0; background: #fff; transform: rotate(var(--photo-angle, -5deg));
  box-shadow: 0 2px 4px #0003;
}
.album-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.album-clipping:not(.stamped) img { filter: grayscale(1); }
.album-clipping.stamped .album-photo::before {
  position: absolute; content: ""; z-index: 1; width: 43px; height: 8px; top: -4px; left: calc(50% - 21.5px);
  background: repeating-linear-gradient(135deg, transparent 0 5px, #fff8 5px 7px), color-mix(in srgb, var(--album) 81%, transparent);
  transform: rotate(5deg);
}
.album-caption { display: grid; place-content: center; justify-items: center; grid-column: 1; text-align: center; line-height: 1.15; }
.album-caption canvas { width: 54px; height: 54px; }
.album-caption strong { font: 700 24px/1.05 monospace; color: #74716a; }
.album-caption h2 { margin: 0; color: #726f69; font: 700 14px/1.2 Georgia, "Songti SC", SimSun, serif; overflow-wrap: anywhere; }
.album-caption small { margin-top: 2px; color: #88847a; font-size: 11px; font-weight: 700; }
.stamped .album-caption strong, .stamped .album-caption small { color: inherit; font-size: 12px; }
.stamped .album-caption small { font-size: 11px; }
.stamped .album-caption h2 { color: #393630; }
.album-preview img { display: block; width: 100%; max-height: 53dvh; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 8px; background: var(--sand); }
.album-preview h3 { margin-top: 12px; font-size: 24px; overflow-wrap: anywhere; }
.album-preview h3 small { color: var(--muted); font-size: 15px; font-weight: 400; }
.album-preview .btn { width: 100%; }
.album-page-choices, .album-picture-choices { display: grid; gap: 7px; }
.album-picture-choices { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.album-page-choices button, .album-picture-choices button {
  min-height: 42px; padding: 5px; border: 1px solid var(--stroke); border-radius: 6px; background: var(--panel);
  color: var(--ink); overflow-wrap: anywhere;
}
.album-picture-choices button img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.album-page-choices [aria-current], .album-picture-choices [aria-pressed="true"] { background: var(--mint); border-color: var(--leaf); }
@media (max-height: 560px) {
  .album-leaf[data-count="3"] .album-caption canvas { width: 36px; height: 36px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .album-volume {
    grid-template: minmax(0, 1fr) auto / minmax(146px, 30%) minmax(0, 1fr);
    min-height: max(280px, calc(100dvh - 111px)); padding: 3px;
  }
  .album-heading { grid-area: 1 / 1; align-content: start; grid-template-columns: 36px minmax(0, 1fr); }
  .album-heading canvas { width: 36px; height: 36px; }
  .album-heading > strong { grid-column: 2; }
  .album-pagination { grid-area: 2 / 1; grid-template-columns: 41px minmax(0, 1fr) 41px; }
  .album-pager { grid-area: 1 / 2 / 3 / 3; }
}
@media (orientation: portrait) {
  body[data-view="album"] main { padding: calc(5px + env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); }
  body[data-view="album"] .album-volume { min-height: max(419px, calc(100dvh - 142px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
  dialog[data-view="album-picture"] {
    width: min(100%, 560px); margin: auto auto 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 8px 8px 0 0;
  }
}
.journal-thanks-grid figure { margin: 0; }
.journal-thanks-grid img { width: 100%; aspect-ratio: 3/2; }
@media (orientation: portrait) {
  body[data-page="study"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="study"] .workspace { margin: 0; }
  body[data-page="study"] main { padding: calc(5px + env(safe-area-inset-top)) 20px 25px; }
  body:is([data-page="books"], [data-page="journal"], [data-page="settings"]) .topbar { display: none; }
  body[data-page="settings"] .sidebar { display: none; }
  body:is([data-page="books"], [data-page="journal"], [data-page="settings"]) .workspace { margin: 0; }
  body:is([data-page="books"], [data-page="journal"]) :is(.brand, .sidebar-bottom) { display: none; }
  body:is([data-page="books"], [data-page="journal"]) .sidebar {
    inset: auto 50% calc(env(safe-area-inset-bottom) + 8px) auto; transform: translateX(50%);
    width: min(calc(100% - 32px), 284px); padding: 4px; border: 1px solid var(--stroke); border-radius: 31px;
  }
  body:is([data-page="books"], [data-page="journal"]) #navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body:is([data-page="books"], [data-page="journal"]) #navigation a { flex-direction: column; min-height: 48px; gap: 2px; font-size: 12px; border-radius: 25px; }
  .sidebar:has(> #navigation[data-dock]) {
    width: min(calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)), 284px);
    background: var(--panel);
    background: light-dark(#f5f8fdf2, #222630f0);
    border: 0; border-radius: 28px;
    box-shadow: inset 0 0 0 1px #ffffff50, 0 3px 8px #0003;
  }
  body[data-page="map"] .sidebar:has(> #navigation[data-dock]) {
    background: #f9fdff9c;
    background: light-dark(#f9fdff9c, #15203385);
  }
  #navigation[data-dock] {
    position: relative; isolation: isolate; gap: 0; touch-action: pan-y; user-select: none;
  }
  #navigation[data-dock]::before {
    content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: calc(100% / 3);
    pointer-events: none; border-radius: 24px;
    background: #09192c19; background: light-dark(#09192c19, #ffffff2d);
    transform: translateX(calc(var(--dock-position, 0) * 100%));
  }
  @media (prefers-reduced-motion: no-preference) {
    #navigation[data-dock][data-dock-motion]:not([data-dragging])::before {
      transition: transform 235ms cubic-bezier(.2, .76, .23, 1);
    }
  }
  body[data-page] #navigation[data-dock] a {
    min-height: 48px; padding: 0; gap: 0; justify-content: center; font-weight: 700;
    color: var(--muted); background: transparent;
  }
  body[data-page] #navigation[data-dock] a[aria-current] { color: var(--ink); }
  #navigation[data-dock] .icon { width: 21px; height: 21px; }
  body[data-page="books"] main { max-width: 640px; padding: calc(16px + env(safe-area-inset-top)) 20px calc(84px + env(safe-area-inset-bottom)); }
  body[data-page="journal"] main { padding: calc(16px + env(safe-area-inset-top)) 16px calc(84px + env(safe-area-inset-bottom)); }
  body[data-page="settings"] main { max-width: 640px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .book-shelf-view h1 { font-size: 34px; }
  .book-shelf-view .page-title { margin-bottom: 18px; }
  .book-shelf-view .page-title .btn {
    min-height: 40px; flex: none; gap: 7px; padding: 5px 10px; border-radius: 15px;
    color: var(--ink); background: var(--panel); font-size: 15px;
  }
  .book-shelf-view .page-title .icon { width: 28px; height: 28px; color: var(--leaf); }
  .book-shelf-view .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 22px; }
  :is(.book-shelf-view, .book-leaf) .book-art {
    aspect-ratio: .71; padding: 0 2px 5px 0; border-radius: 6px;
    background: var(--jacket-cloth); box-shadow: 0 3px 7px #0004;
  }
  :is(.book-shelf-view, .book-leaf) .book-art img { height: 100%; border-top-right-radius: 6px; }
  :is(.book-shelf-view, .book-leaf) .book-art::after {
    content: ""; position: absolute; inset: 0 auto 4px 0; width: 10px; pointer-events: none;
    background: linear-gradient(90deg, #0009, #0002 28%, #fff6 46%, #0003 62%, transparent);
  }
  :is(.book-shelf-view, .book-leaf) .jacket-edge {
    display: block; position: absolute; inset: auto 0 0; height: 6px; border-radius: 3px; pointer-events: none;
    background: linear-gradient(#faf5e8 0 17%, #f7efe1 17% 36%, #afa99d 36% 48%, #e7dfcb 48% 70%, transparent 70%)
      center / calc(100% - 2px) 100% no-repeat, var(--jacket-cloth);
  }
  :is(.book-shelf-view, .book-leaf) .jacket-label {
    right: 2px; bottom: 5px; height: 85px; min-height: 0; padding: 10px 12px; line-height: 1.1;
    background: linear-gradient(transparent, #0e152099, #141f20e3);
  }
  :is(.book-shelf-view, .book-leaf) .jacket-label small { color: #fff; font-size: 10px; }
  .book-shelf-view .jacket-label strong { font-size: 20px; }
  .book-shelf-view .book-ribbon { width: 15px; height: 20px; padding: 0; right: 12px; background: #ff8b2e; clip-path: polygon(0 0, 100% 0, 100% 88%, 96% 95%, 86% 93%, 50% 70%, 14% 93%, 4% 95%, 0 88%); }
  .book-shelf-view .book-ribbon .icon { display: none; }
}
@media (orientation: portrait) and (max-width: 337px) { .book-shelf-view .shelf { grid-template-columns: 1fr; } }
@media (orientation: portrait) and (min-width: 498px) { .book-shelf-view .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (orientation: portrait) and (min-width: 658px) { .book-shelf-view .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.book-leaf {
  --book-accent: var(--book-color);
  --book-accent: light-dark(var(--book-color), var(--book-night));
  display: flex; flex-direction: column; height: max(270px, calc(100dvh - 110px)); min-width: 0;
}
.book-leaf-header.check-in-header { flex: none; min-height: 44px; margin: 0; font-weight: 700; }
.book-leaf-header > span { text-align: center; color: var(--muted); }
.book-lookup {
  display: flex; flex: none; align-items: center; min-height: 46px; margin-block: 8px 7px;
  border-radius: 15px; background: var(--sand);
}
.book-lookup input { flex: 1; width: 100%; min-width: 0; border: 0; padding: 10px 13px; background: transparent; font-size: 16px; }
.book-lookup input::-webkit-search-cancel-button { display: none; }
.book-leaf-directory[hidden] { display: none; }
.book-lookup-clear[hidden] { display: none; }
.book-lookup-count { margin: 0; padding: 5px 4px; color: var(--muted); font-size: 14px; font-weight: 700; }
.book-leaf-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.book-leaf-summary {
  display: grid; grid-template-columns: min(158px, max(min(123px, 33.333%), 37%)) minmax(0, 1fr);
  align-items: start; gap: 18px; padding-block: 18px 22px;
}
.book-leaf-summary h1 { font-size: 27px; line-height: 1.2; margin: 7px 0 5px; }
.book-leaf-summary p { margin: 0; color: var(--muted); font-size: 15px; }
.book-leaf-summary .book-leaf-count { margin-top: 7px; color: var(--book-accent); font-size: 13px; }
.book-leaf-code { color: var(--book-accent); font: 12px ui-monospace, monospace; }
.book-leaf .jacket-label { height: 65px; min-height: 65px; padding: 6px 7px; }
.book-leaf .jacket-label strong { font-size: 15px; }
.book-leaf .jacket-label > span { font-size: 10px; }
.book-leaf-download { margin-top: 12px; }
.book-leaf-stations h2 { font-size: 20px; }
.book-leaf-station { border-bottom: 1px solid var(--stroke); }
.book-leaf-toggle {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; align-items: center; gap: 12px;
  min-height: 53px; width: 100%; padding: 11px 0; border: 0; background: transparent; text-align: start;
}
.book-leaf-toggle span {
  display: grid; place-items: center; min-height: 31px; border-radius: 10px; color: var(--book-accent);
  background: color-mix(in srgb, var(--book-accent) 9%, transparent); font: 15px ui-monospace, monospace;
}
.book-leaf-toggle strong { font-size: 17px; }
.book-leaf-toggle .icon { width: 18px; height: 18px; color: var(--muted); }
.book-leaf-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.book-leaf-footer { flex: none; padding-top: 8px; }
.book-leaf-switch.btn { width: 100%; min-height: 53px; justify-content: space-between; padding: 10px 20px; border-radius: 18px; font-size: 17px; background: var(--ink); color: var(--panel); }
.book-leaf-switch .icon { order: 1; width: 22px; height: 22px; }
.book-leaf-empty { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 12px; padding-right: 12px; border-radius: 17px; background: var(--mint); }
.book-leaf-empty img { width: 104px; height: 106px; object-fit: contain; }
.book-leaf-empty h2 { font-size: 18px; }
.book-leaf-empty p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.book-leaf .station-paper-term { display: grid; gap: 0; }
.book-leaf .station-paper-term strong { font-size: 20px; }
.book-lookup-hit > p { margin: 10px 0 0; padding-inline: 5px; color: var(--leaf); font-size: 12px; font-weight: 700; }
.book-turn { position: fixed; z-index: 12; inset: 0; overflow: hidden; touch-action: none; }
.book-turn .book-turn-surface {
  position: absolute; margin: 0; max-width: none; overflow: hidden; background: var(--bg);
}
.book-turn-dim, .book-turn canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.book-turn-dim { background: #000; }
@media (orientation: portrait) {
  body[data-page="book"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="book"] .workspace { margin: 0; }
  body[data-page="book"] main { width: min(100%, 640px); padding: calc(10px + env(safe-area-inset-top)) 22px calc(10px + env(safe-area-inset-bottom)); }
  .book-leaf { height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .book-leaf-download { display: none; }
}
@media (orientation: landscape) {
  .book-leaf-directory { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 20px; padding: 4px; }
  .book-leaf-summary { padding-top: 6px; }
}
@media (orientation: landscape) and (max-height: 630px) {
  body[data-page="book"] main { padding-bottom: 9px; }
  .book-leaf { height: max(270px, calc(100dvh - 62px)); }
  .book-leaf-summary { grid-template-columns: min(105px, 37%) minmax(0, 1fr); gap: 12px; }
}
@media (orientation: portrait) {
  body:is([data-page="station"], [data-page="words"], [data-page="review"]) {
    --bg: #fff; --panel: #fff; --ink: #19191b; --muted: #56595c;
    --stroke: #dadbde; --sand: #f2f3f4; --station-blue: #195495;
    background: var(--bg); color: var(--ink);
  }
  :root[data-theme="dark"] body:is([data-page="station"], [data-page="words"], [data-page="review"]) {
    --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7;
    --stroke: #464a52; --sand: #2a2c35; --station-blue: #89c6ff;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body:is([data-page="station"], [data-page="words"], [data-page="review"]) {
      --bg: #000; --panel: #000; --ink: #f3f3f5; --muted: #bbbfc7;
      --stroke: #464a52; --sand: #2a2c35; --station-blue: #89c6ff;
    }
  }
  body[data-page="station"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="station"] .workspace { margin: 0; }
  body[data-page="station"] main {
    width: min(100%, 640px); padding: 0 22px calc(85px + env(safe-area-inset-bottom));
  }
}
.station-paper { --station-blue: var(--goal-blue); }
.station-paper-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; color: var(--muted); background: var(--bg);
  padding: calc(6px + env(safe-area-inset-top)) 0 6px; font-size: 15px;
}
.station-paper-header .icon-btn {
  width: 44px; height: 44px; flex-basis: 44px; border-radius: 50%;
  color: var(--ink); background: var(--sand); border: 1px solid var(--stroke);
}
.station-paper-banner {
  height: 184px; position: relative; overflow: hidden; margin-top: 6px;
  border-radius: 19px; background: var(--sand); box-shadow: 0 2px 8px #171b251f;
}
.station-paper-banner img { width: 100%; height: 100%; object-fit: cover; }
.station-paper-banner div {
  position: absolute; inset: 0; display: grid; align-content: end; gap: 4px;
  padding: 15px 16px; color: #fff; background: linear-gradient(transparent, #00000016, #000000bd);
}
.station-paper-banner strong { font-size: 15px; }
.station-paper-banner h1 { font-size: 28px; line-height: 35px; overflow-wrap: anywhere; }
.station-paper-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 14px; }
.station-paper-heading h2 { font-size: 20px; line-height: 25px; }
.station-paper-heading output, .station-paper-ticket { color: var(--station-blue); }
.station-paper-words { padding: 4px 16px; }
.station-paper-word { display: flex; align-items: center; min-height: 49px; border-bottom: 1px solid var(--stroke); }
.station-paper-word .icon-btn, .station-paper-word .word-light {
  flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent;
}
.station-paper-word .icon-btn[aria-pressed=true] { color: var(--station-blue, var(--leaf)); }
.station-paper .station-paper-word .icon-btn:not([aria-pressed=true]) { color: var(--muted); }
.station-paper .station-paper-word .icon-btn .icon { width: 23px; height: 23px; stroke-width: 1.7; }
.station-paper .station-paper-word .icon-btn[aria-pressed=true] .icon { fill: currentColor; }
.station-paper-term {
  min-width: 0; min-height: 44px; flex: 1; display: flex; flex-wrap: wrap; align-items: center;
  gap: 2px 8px; background: none; border: 0; padding: 2px 8px; text-align: left;
}
.station-paper-term strong, .station-paper-term small { display: block; }
.station-paper-term strong { font-size: 17px; line-height: 22px; }
.station-paper-term small { color: var(--muted); font-size: 12px; line-height: 16px; }
.station-paper-term > span:last-child { color: var(--muted); line-height: 19px; overflow-wrap: anywhere; }
.station-paper .station-paper-term > span { max-width: 100%; overflow-wrap: anywhere; }
.station-paper .station-paper-term > span:first-child { flex: 1 0 auto; }
.station-paper .station-paper-term > span:last-child { font-size: 15px; white-space: pre-line; }
.station-paper-ticket { margin-top: 18px; font-size: 15px; font-weight: 700; }
#station-start:disabled[data-mastered="true"] { color: var(--station-blue); }
@media (orientation: portrait) {
  .station-paper-dock {
    position: fixed; z-index: 3; inset: auto 0 0; background: var(--bg);
    padding: 7px 20px calc(7px + env(safe-area-inset-bottom));
  }
  .station-paper-dock button {
    display: block; width: min(100%, 600px); min-height: 53px; margin: auto; padding: 10px 20px;
    border: 0; border-radius: 17px; background: var(--ink); color: var(--panel);
    text-align: left; font-size: 17px; line-height: 22px; font-weight: 700;
  }
  .station-paper-dock button:disabled { background: var(--sand); color: var(--muted); }
  body[data-page="check-in"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="check-in"] .workspace { margin: 0; }
  body:is([data-page="check-in"], [data-page="study"]):has(.check-in-view) main {
    padding: env(safe-area-inset-top) 12px calc(85px + env(safe-area-inset-bottom));
  }
}
@media (orientation: landscape) {
  body[data-page="station"] main { padding-block: 8px; }
  .station-paper {
    display: grid; height: max(254px, calc(100dvh - 86px)); gap: 8px 16px;
    grid-template: "head head" auto "banner list" minmax(130px, 1fr)
      "ticket list" auto "start list" auto / minmax(0, 2fr) minmax(0, 3fr);
  }
  .station-paper-header { grid-area: head; position: static; padding: 0; }
  .station-paper-banner { grid-area: banner; height: auto; margin: 0; border-radius: 8px; }
  .station-paper-banner div { padding: 10px 12px; }
  .station-paper-banner h1 { font-size: 22px; line-height: 28px; }
  .station-paper-list {
    grid-area: list; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border-block: 1px solid var(--stroke);
  }
  .station-paper-heading { flex-wrap: wrap; margin: 6px 8px; }
  .station-paper-heading h2 { font-size: 17px; line-height: 22px; }
  .station-paper-words {
    flex: 1; padding: 0 6px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  }
  .station-paper-ticket { grid-area: ticket; margin: 0; overflow-wrap: anywhere; }
  .station-paper .station-paper-dock { grid-area: start; }
  .station-paper .station-paper-dock button {
    width: 100%; min-height: 46px; padding: 8px 12px; border: 0; border-radius: 8px;
    background: var(--ink); color: var(--panel); text-align: left; font-weight: 700;
  }
  .station-paper .station-paper-dock button:disabled { background: var(--sand); color: var(--muted); }
}
@media (orientation: landscape) and (max-height: 630px) {
  .station-paper { height: max(254px, calc(100dvh - 60px)); }
}
.check-in-view { width: min(100%, 520px); margin-inline: auto; }
.check-in-header {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px;
  min-height: 53px; margin-bottom: 8px;
}
.check-in-header .icon-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--sand); color: var(--ink);
}
.check-in-header h1 { font-size: 15px; text-align: center; }
.catalog-view {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px;
  height: max(330px, calc(100dvh - 108px)); max-width: 1000px; margin-inline: auto;
}
.catalog-head { display: grid; gap: 8px; }
.catalog-head .check-in-header { margin: 0; min-height: 44px; }
.catalog-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.catalog-filters button, .catalog-search {
  min-width: 0; border: 0; border-radius: 13px; background: var(--sand); color: var(--ink);
}
.catalog-filters button {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 42px; padding: 4px; font-size: 14px; font-weight: 700;
}
.catalog-filters button[aria-pressed="true"] { background: var(--lamp-selection); color: #171719; }
.catalog-filters [data-color="red"] { --lamp-selection: #ffa297; }
.catalog-filters [data-color="yellow"] { --lamp-selection: #ffd457; }
.catalog-filters [data-color="blue"] { --lamp-selection: #77d3f9; }
.catalog-search { width: 100%; min-height: 44px; padding: 8px 14px; font-size: 17px; }
.catalog-coverage { color: var(--muted); font-size: 13px; }
.catalog-deck {
  position: relative; min-width: 0; overflow: clip; touch-action: pan-y pinch-zoom;
}
.catalog-track { position: absolute; inset: 0; transform: translateX(var(--catalog-offset, 0px)); }
.catalog-slide {
  position: absolute; inset: 0; overflow: hidden auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom;
  transform: translateX(calc(var(--position) * (100% - var(--catalog-overlap, 0px))));
  scrollbar-width: none; padding: 2px 2px 8px;
}
.catalog-slide[inert] { pointer-events: none; }
.catalog-slide img { -webkit-user-drag: none; }
.catalog-deck:focus-visible { outline-offset: -2px; }
.catalog-deck > p { text-align: center; color: var(--muted); padding: 24px 8px; }
.catalog-card {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 18px;
  overflow: hidden; box-shadow: 0 2px 4px #0002; overflow-wrap: anywhere;
}
.catalog-card img { display: block; width: 100%; aspect-ratio: auto 3 / 2; object-fit: contain; }
.catalog-picture { background: var(--sand); }
.catalog-copy { min-width: 0; padding: 14px; }
.catalog-term { display: grid; grid-template-columns: minmax(0, 1fr) 42px 42px; align-items: start; }
.catalog-term > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; }
.catalog-term h2 { font-size: 34px; line-height: 1.17; min-width: 0; }
.catalog-term .phonetic { font-size: 15px; min-width: 0; }
.catalog-term button { width: 42px; height: 46px; }
.catalog-term button:not(:hover) { background: transparent; }
.catalog-term .word-light { border: 0; }
.catalog-term .icon-btn[aria-pressed="true"] { color: var(--leaf); }
.catalog-meaning { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; }
.catalog-meaning p { flex: 1; min-width: 0; white-space: pre-line; font-size: 17px; font-weight: 700; }
.catalog-card .practice-listen {
  flex: none; min-height: 44px; border: 0; border-radius: 28px; padding: 8px 12px;
  background: var(--blue); color: var(--leaf); font-size: 15px;
}
.catalog-example { margin-top: 12px; }
.catalog-example img { border-radius: 8px; margin-bottom: 5px; }
.catalog-example strong { display: block; font: 700 20px/1.35 Georgia, serif; }
.catalog-example p { margin: 5px 0 6px; color: var(--muted); font-size: 17px; }
.catalog-dock { display: flex; align-items: center; justify-content: center; gap: 8px; }
.catalog-dock span { min-width: 100px; text-align: center; font-variant-numeric: tabular-nums; }
.catalog-dock button:disabled { opacity: .4; }
@media (orientation: landscape) {
  .catalog-card.has-picture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-picture { position: sticky; top: 0; align-self: start; }
  .catalog-picture img { max-height: max(110px, calc(100dvh - 266px)); }
}
@media (orientation: landscape) and (max-height: 540px) {
  body[data-page="catalog"] .topbar { display: none; }
  body[data-page="catalog"] main { padding-block: 6px; }
  .catalog-view { height: max(242px, calc(100dvh - 12px)); }
  .catalog-picture img { max-height: max(96px, calc(100dvh - 208px)); }
}
@media (orientation: landscape) and (max-width: 740px) {
  body[data-page="catalog"] .sidebar { display: none; }
}
@media (orientation: portrait) {
  body[data-page="catalog"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="catalog"] .workspace { margin: 0; }
  body[data-page="catalog"] main { max-width: 680px; padding: 0; }
  .catalog-view {
    grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh;
    padding: calc(6px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .catalog-head { padding-inline: 18px; }
  .catalog-deck { --catalog-overlap: 14px; }
  .catalog-slide { padding-inline: 20px; }
  .catalog-dock { display: none; }
}
@media (orientation: portrait) {
  body[data-page="words"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="words"] .workspace { margin: 0; }
  body[data-page="words"] main { max-width: 680px; padding: 0; }
  .word-shelf {
    height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr);
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  }
  .word-shelf-head { display: grid; gap: 8px; padding: 9px 20px 6px; }
  .word-shelf-head .check-in-header { min-height: 44px; margin: 0; }
  #shelf-count { color: var(--station-blue); font-size: 15px; font-weight: 700; }
  .word-shelf-head input {
    width: 100%; min-height: 44px; padding: 7px 13px; border: 1px solid var(--stroke); border-radius: 18px;
    background: var(--panel); color: var(--ink); font-size: 17px;
  }
  .word-shelf-filters { display: flex; gap: 5px; }
  .word-shelf-filters button, #shelf-practice {
    min-height: 44px; padding: 6px 10px; border: 0; border-radius: 17px;
    background: var(--panel); color: var(--muted); font-size: 15px; font-weight: 700;
  }
  .word-shelf-filters button:not(#shelf-tier) { flex: 1; }
  .word-shelf-filters button[aria-pressed="true"], #shelf-practice { color: var(--panel); background: var(--ink); }
  #shelf-tier { color: var(--station-blue); }
  .word-shelf-words { overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
  .word-shelf-row {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; align-items: center; gap: 3px;
    min-height: 60px; padding: 6px 14px; border-bottom: 1px solid var(--stroke);
  }
  .word-shelf-row .icon-btn, .word-shelf-row .word-light {
    width: 100%; height: 48px; border: 0; border-radius: 8px; background: transparent;
  }
  .word-shelf-row .icon-btn[aria-pressed="true"] { color: var(--station-blue); }
  .word-shelf-row .icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
  .word-shelf-term {
    min-width: 0; border: 0; background: none; padding: 0; text-align: left; overflow-wrap: anywhere;
  }
  .word-shelf-term > * { display: block; }
  .word-shelf-term strong { font-size: 20px; line-height: 24px; }
  .word-shelf-term small { color: var(--muted); font-size: 12px; }
  .word-shelf-term span { color: var(--muted); font-size: 14px; line-height: 20px; }
  .word-shelf-tiers button {
    display: block; width: 100%; min-height: 48px; border: 0; border-bottom: 1px solid var(--stroke);
    background: var(--panel); padding: 8px 5px; text-align: left;
  }
  .word-shelf-tiers button[aria-pressed="true"] { color: var(--station-blue); font-weight: 700; }
  body[data-page="review"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="review"] .workspace { margin: 0; }
  body[data-page="review"] main {
    max-width: 680px; padding: calc(6px + env(safe-area-inset-top)) 16px calc(78px + env(safe-area-inset-bottom));
  }
  .review-paper .check-in-header { min-height: 44px; margin: 0 0 12px; }
  .review-paper .review-paper-banner { height: 130px; min-height: 0; }
}
.review-paper-banner h2 { font-size: 25px; line-height: 30px; }
.review-paper-banner p { margin-top: 3px; font-size: 15px; line-height: 20px; }
.review-paper-count {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0;
  color: var(--muted); font-size: 13px;
}
.review-goal {
  display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 6px; min-height: 44px; padding: 6px 13px;
  color: var(--station-blue, var(--leaf)); background: var(--blue); border: 0; border-radius: 16px; font-weight: 700;
}
.review-goal .icon { width: 16px; height: 16px; transform: rotate(90deg); }
.review-paper-words .station-paper-word { min-height: 57px; }
.review-paper-words .station-paper-term {
  display: flex; flex-flow: column nowrap; align-items: stretch; justify-content: center;
  gap: 4px; padding-block: 5px;
}
.review-paper-words .station-paper-term strong { font-size: 20px; line-height: 25px; }
.review-paper-empty { margin-top: 8px; color: var(--muted); font-size: 18px; font-weight: 700; }
:root {
  --goal-panel: linear-gradient(#fafbfd, #fff);
  --goal-border: #f8faff;
  --goal-handle: #c6c9cf;
  --goal-ink: #19191b;
  --goal-fill: #f2f3f4;
  --goal-blue: #195495;
  --goal-tint: #e7f4ff;
  --goal-dim: .25;
  --passport-paper: #fff;
  --passport-muted: #56595c;
}
:root[data-theme="dark"] {
  --goal-panel: linear-gradient(#21242b, #17191f);
  --goal-border: #353941;
  --goal-handle: #5b606a;
  --goal-ink: #f3f3f5;
  --goal-fill: #2a2e35;
  --goal-blue: #89c6ff;
  --goal-tint: #1e344a;
  --goal-dim: .39;
  --passport-paper: #000;
  --passport-muted: #bbbfc7;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --goal-panel: linear-gradient(#21242b, #17191f);
    --goal-border: #353941;
    --goal-handle: #5b606a;
    --goal-ink: #f3f3f5;
    --goal-fill: #2a2e35;
    --goal-blue: #89c6ff;
    --goal-tint: #1e344a;
    --goal-dim: .39;
    --passport-paper: #000;
    --passport-muted: #bbbfc7;
  }
}
.travel-sheet[open] {
  position: fixed; inset: 0; display: flex; justify-content: center; align-items: end;
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  padding: calc(12px + env(safe-area-inset-top)) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  border: 0; border-radius: 0; overflow: hidden; background: transparent; color: var(--goal-ink);
}
.travel-sheet::backdrop { background: rgb(0 0 0 / var(--goal-dim)); }
.travel-sheet-panel {
  display: flex; flex-direction: column; width: min(100%, 460px); max-height: 100%; min-height: 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0; box-shadow: inset 0 0 0 1px var(--goal-border), 0 -4px 14px #0002;
  background: var(--goal-panel);
}
.travel-sheet-handle {
  display: grid; flex: 0 0 28px; place-items: center; touch-action: none;
  border: 0; border-radius: 30px 30px 0 0; background: transparent;
}
.travel-sheet-handle::before {
  content: ""; width: 36px; height: 4px; border-radius: 4px; background: var(--goal-handle);
}
.travel-sheet-body {
  min-height: 0; padding: 2px 20px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.travel-sheet h2 { text-align: center; }
.map-today-portrait {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; object-fit: contain;
  background: var(--goal-fill); box-shadow: 0 1px 3px #0003, 0 0 0 1px var(--stroke);
}
.travel-sheet[data-view="map-today"] h2 { font-size: 22px; }
.travel-sheet[data-view="map-today"] .travel-sheet-body { padding-bottom: 2px; }
.map-today-caption { margin: 6px 0 20px; text-align: center; font-size: 14px; color: var(--passport-muted); }
.map-today-action {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 12px 16px; border: 0; border-radius: 27px;
  background: var(--goal-ink); color: var(--passport-paper); font-size: 17px; font-weight: 700;
}
.map-today-action .icon { width: 22px; height: 22px; }
.travel-sheet[data-view="review-goal"] h2 { margin-bottom: 16px; }
.review-goal-options { display: grid; gap: 6px; }
.review-goal-options button {
  display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 10px 18px;
  border: 0; border-radius: 16px; background: var(--goal-fill); text-align: left; font-size: 17px;
}
.review-goal-options button[aria-pressed="true"] { background: var(--goal-tint); color: var(--goal-blue); font-weight: 700; }
.review-goal-options .icon { width: 22px; height: 22px; }
@media (orientation: landscape) {
  body[data-page="review"] main { padding-block: 10px; }
  .review-paper {
    display: grid; grid-template: "head head" auto "summary list" minmax(0, 1fr) "start list" auto / minmax(0, 2fr) minmax(0, 3fr);
    gap: 8px 18px; height: calc(100dvh - 90px); min-height: 230px;
  }
  .review-paper .check-in-header { grid-area: head; margin: 0; }
  .review-paper-summary {
    grid-area: summary; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  }
  .review-paper-banner { position: relative; overflow: hidden; border-radius: 8px; background: var(--sand); }
  .review-paper-banner img { width: 100%; height: 100%; object-fit: cover; }
  .review-paper-banner div {
    position: absolute; inset: auto 0 0; padding: 12px; color: #fff;
    background: linear-gradient(transparent, #000c);
  }
  .review-paper-list {
    grid-area: list; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-block: 1px solid var(--stroke);
  }
  .review-paper-words .station-paper-word { display: flex; align-items: center; border-bottom: 1px solid var(--stroke); }
  .review-paper-words .station-paper-term {
    min-width: 0; flex: 1; background: none; border: 0; padding-inline: 8px; text-align: left; overflow-wrap: anywhere;
  }
  .review-paper-words .station-paper-term small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
  .review-paper-words .station-paper-term > span:last-child { color: var(--muted); }
  .review-paper-words :is(.word-light, .icon-btn) { flex: 0 0 44px; width: 44px; height: 44px; border: 0; }
  .review-paper .station-paper-dock { grid-area: start; }
  .review-paper .station-paper-dock button {
    width: 100%; min-height: 46px; padding: 8px 14px; border: 0; border-radius: 8px;
    background: var(--ink); color: var(--panel); text-align: left; font-weight: 700;
  }
  .review-paper .station-paper-dock button:disabled { background: var(--sand); color: var(--muted); }
  #dialog[data-view="word-card"][open] { width: min(780px, calc(100% - 32px)); }
  .word-card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
}
@media (orientation: landscape) and (max-height: 630px) {
  .review-paper { height: calc(100dvh - 66px); }
}
.check-in-print {
  position: relative; overflow: hidden; border: 1px solid var(--stroke);
  border-radius: 20px; background: var(--panel);
}
.check-in-print canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.check-in-art {
  position: absolute; right: 11px; top: calc(59.6% - 46px); min-height: 36px; padding: 6px 12px;
  border: 0; background: #000b; color: white; border-radius: 18px;
}
.check-in-art:focus-visible { outline: 2px solid #fff; }
dialog:is([data-view="check-in-picker"], [data-view="ticket-picker"]) { max-width: min(560px, calc(100% - 24px)); }
dialog:is([data-view="check-in-picker"], [data-view="ticket-picker"])::backdrop { background: #0006; }
.check-in-original {
  border: 0; border-radius: 18px; padding: 6px 12px; min-height: 34px;
  background: var(--sand); color: var(--leaf); white-space: nowrap;
}
.check-in-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px 10px; }
.check-in-art-grid button {
  display: grid; align-content: start; gap: 3px; min-width: 0; padding: 0;
  border: 0; background: transparent; color: var(--ink); text-align: left; overflow-wrap: anywhere;
}
.check-in-art-preview { position: relative; overflow: hidden; border-radius: 8px; background: var(--sand); }
.check-in-art-preview img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.check-in-art-preview .icon {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 3px;
  border-radius: 50%; background: #165ba0; color: white;
}
@media (orientation: portrait) {
  dialog:is([data-view="check-in-picker"], [data-view="ticket-picker"]) {
    position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%, 560px); max-width: 100%;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
  }
}
.check-in-share, .check-in-return {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px;
  padding: 0 18px; border: 0; border-radius: 17px; font-size: 17px; font-weight: 700;
  background: var(--ink); color: var(--panel);
}
.check-in-share { margin-top: 18px; }
.check-in-share:disabled, .check-in-save:disabled { opacity: .5; }
.check-in-share .icon { width: 20px; height: 20px; }
.check-in-save {
  display: block; width: 100%; min-height: 46px; margin: 10px 0 4px; padding: 7px 0;
  text-align: center; border: 0; background: transparent; color: var(--leaf); font-weight: 700;
}
.check-in-note { margin: 0; color: var(--muted); text-align: center; font-size: 13px; }
.check-in-empty {
  display: grid; align-content: center; justify-items: center; gap: 8px;
  min-height: 256px; text-align: center; color: var(--muted);
}
.check-in-empty h2 { color: var(--ink); font-size: 21px; }
@media (orientation: landscape) and (min-width: 520px) {
  .check-in-view:has(.check-in-print) {
    width: fit-content; max-width: 100%;
    display: grid; align-items: start;
    grid-template-columns: minmax(0, max(148px, min(448px, calc((100dvh - 120px) * .8)))) minmax(190px, 280px);
    grid-template-rows: auto auto 1fr;
    column-gap: 22px;
  }
  .check-in-view .check-in-header { grid-column: 1 / -1; }
  .check-in-print { grid-row: 2 / span 2; }
  .check-in-actions, .check-in-view:has(.check-in-print) .station-paper-dock { grid-column: 2; }
  .check-in-share { margin-top: 0; }
  .check-in-view .station-paper-dock { margin-top: 14px; }
}
.ticket-detail-view { width: min(100%, 604px); margin-inline: auto; }
.ticket-detail-preview, .ticket-detail-content { display: contents; }
@media (orientation: landscape) and (min-width: 560px) {
  .ticket-detail-view {
    width: min(100%, 1024px); display: grid; align-items: start;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); column-gap: 22px;
  }
  .ticket-detail-view > header { grid-column: 1 / -1; }
  .ticket-detail-preview, .ticket-detail-content { display: block; }
  .ticket-detail-content > .ticket-recovered:first-child, .ticket-detail-content > .ticket-detail-actions:first-child {
    margin-top: 0;
  }
}
.ticket-cabinet { width: min(100%, 1024px); margin-inline: auto; }
.cabinet-back { display: flex; align-items: center; min-height: 44px; }
.cabinet-back .icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--sand); color: var(--ink); }
.ticket-cabinet > header { margin: 12px 0 14px; }
.ticket-cabinet h1 { margin: 0 0 16px; font-size: 32px; line-height: 1.15; }
.ticket-cabinet header p, .cabinet-row > p { margin: 0; color: var(--muted); font-size: 13px; }
.ticket-cabinet header p { padding-bottom: 10px; }
.cabinet-categories {
  position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.cabinet-categories a {
  flex: none; display: grid; place-items: center; min-height: 40px; padding: 0 13px;
  border-radius: 24px; background: var(--sand); font-size: 14px; font-weight: 700;
}
.cabinet-categories [aria-current] { background: var(--ink); color: var(--panel); }
.cabinet-section > h2 { margin: 13px 0 8px; font-size: 17px; }
.cabinet-section:has([data-ticket-print]) > h2 { color: var(--muted); font-size: 15px; }
.cabinet-section + .cabinet-section > div:first-child { margin-top: 13px; }
.cabinet-section > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.cabinet-row { min-width: 0; }
.cabinet-row > a { display: block; }
.cabinet-row > p { margin-top: 6px; overflow-wrap: anywhere; }
.ticket-locked-label {
  position: absolute; top: 10px; right: 10px; padding: 4px 8px; border-radius: 16px;
  background: #000b; color: #fff; font-size: 11px; font-weight: 700;
}
.ticket-face-locked img { filter: grayscale(1); }
.ticket-face-locked .ticket-face-stamp:has(canvas) { background: #dedbd3; }
.ticket-thanks-motif {
  position: absolute; right: 16px; bottom: 13px; display: grid; place-items: center;
  width: 41px; height: 42px; border-radius: 50%; background: var(--seal-ink);
}
.ticket-thanks-motif::before {
  content: ""; position: absolute; inset: 3px; border: 1px dashed #fffc; border-radius: 50%;
}
.ticket-thanks-motif canvas { width: 25px; height: 25px; }
@media (orientation: portrait) {
  .ticket-cabinet { max-width: 600px; }
  .cabinet-back {
    position: sticky; z-index: 2; top: 0;
    padding-top: calc(3px + env(safe-area-inset-top)); background: var(--panel);
  }
  .cabinet-section > div { grid-template-columns: minmax(0, 1fr); }
  body[data-view="ticket-cabinet"] .sidebar { display: none; }
  body[data-view="ticket-cabinet"] main {
    min-height: 100dvh; padding: 0 20px calc(22px + env(safe-area-inset-bottom)); background: var(--panel);
  }
}
.ticket-face {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.97;
  min-height: 130px; border-radius: 8px; background: #213a40; color: #fff;
}
.ticket-face :is(img, .ticket-art-copy), .ticket-face::before { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; }
.ticket-face :is(img, .ticket-art-copy) { z-index: -2; object-fit: cover; }
.ticket-face::before { content: ""; background: linear-gradient(#0002, #0001, #000c); }
.ticket-paper {
  min-height: 0;
  border-radius: 3.333% / 6.567%;
  mask-image: radial-gradient(ellipse 2.222% 4.378% at left center, transparent 97%, #000),
    radial-gradient(ellipse 2.222% 4.378% at right center, transparent 97%, #000);
  mask-composite: intersect;
}
.cabinet-row .ticket-paper { min-height: 84px; }
.ticket-paper::before { background: linear-gradient(#00000016, #0000000a, #000000cb); }
.ticket-paper::after {
  content: ""; position: absolute; inset: 2.736% 1.389%;
  border: 1px solid #ffffff72; border-radius: 2.857% / 5.78%; pointer-events: none;
}
.ticket-face-label {
  position: absolute; top: 12px; left: 17px; background: #000a;
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.ticket-face-label .icon { width: 14px; height: 14px; }
.ticket-face-name { position: absolute; left: 17px; right: 83px; bottom: 10px; }
.ticket-face-name h2 { font-size: 23px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-face-name small { font: 700 10px/1.4 monospace; }
.ticket-face-stamp {
  position: absolute; right: 17px; bottom: 13px; width: 57px; height: 47px; transform: rotate(-8deg);
  display: grid; place-content: center; justify-items: center; gap: 2px;
  background: #fff3d8; color: #23406a; border-radius: 7px;
}
.ticket-face-stamp small { font: 700 8px monospace; }
.ticket-face-stamp:has(canvas) { gap: 0; background: #fff4d8; color: #22576a; }
.ticket-face-stamp canvas { display: block; width: 31px; height: 31px; }
.chapter-arrival {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 10px 21px; border: 0; border-radius: 0; overflow: hidden;
  background: transparent; color: #fff; box-shadow: none;
}
.chapter-arrival[open] { display: grid; place-items: center; }
.chapter-arrival::backdrop { background: rgb(0 0 0 / calc(.451 * var(--arrival-shade, 1))); }
.chapter-arrival.with-motion::backdrop { animation: arrival-shade 230ms ease-out both; }
.chapter-arrival .study-confetti { position: fixed; z-index: 0; inset: 0; width: 100%; height: 100%; margin: 0; pointer-events: none; }
.arrival-ticket, .arrival-album { position: relative; z-index: 1; width: min(100%, 430px); text-align: center; }
.arrival-ticket { display: grid; gap: 16px; }
.arrival-ticket h1 { font-size: 28px; line-height: 1.2; }
.arrival-ticket p { margin: 0; font-size: 15px; font-weight: 700; }
.arrival-ticket-card { position: relative; }
.arrival-ticket-card .ticket-face { min-height: 0; }
.arrival-ticket-card button {
  position: absolute; inset: 0; width: 100%; border: 0; border-radius: 8px; background: transparent;
}
.arrival-album {
  display: grid; justify-items: center; padding: 22px;
  border: 1px solid #cfbfa4; border-radius: 8px; background: #fff8e3; color: #19191b;
}
.arrival-album > span:first-child {
  width: 100%; padding-bottom: 13px; border-bottom: 1px solid #23536433;
  color: #235364; font-size: 16px; font-weight: 700;
}
.arrival-album > span:last-child { margin-top: 7px; color: #54504a; font-size: 15px; }
.arrival-album > strong { margin-top: 14px; font-size: 20px; }
.arrival-print {
  display: grid; place-items: center; align-content: center; margin-top: 10px;
  color: #205770; line-height: 1; transform: rotate(-5deg);
}
.arrival-mark { position: relative; display: grid; place-items: center; width: 168px; height: 110px; }
.arrival-mark canvas { display: block; width: 104px; height: 104px; }
.arrival-rays { position: absolute; inset: 0; opacity: 0; }
.arrival-rays i {
  position: absolute; top: calc(50% - 1px); left: 50%; width: 18.3px; height: 2px;
  border-radius: 1px; background: #c57635;
  transform: rotate(var(--angle)) translateX(44.6px); transform-origin: 0 50%;
}
.arrival-print small { font: bold 17px monospace; }
.chapter-arrival[data-phase="stamp"] .arrival-print { visibility: hidden; }
.arrival-pocket {
  position: absolute; z-index: 2; top: min(78%, calc(50% + 210px)); display: none; place-items: center;
  width: min(62%, 266px); height: 49px; border-radius: 8px; background: #344e36;
  font-weight: 700; pointer-events: none;
}
.chapter-arrival.with-motion[data-phase="ticket"] .arrival-ticket {
  animation: arrival-rise 700ms 85ms cubic-bezier(.2,.8,.3,1.18) both;
}
.chapter-arrival.with-motion[data-phase="ticket"] .ticket-face::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 25%;
  background: linear-gradient(100deg, transparent, #ffffff96, transparent);
  animation: arrival-glint 690ms 465ms ease-in-out both;
}
.chapter-arrival.with-motion[data-phase="dropping"] .arrival-ticket {
  animation: arrival-drop 1030ms cubic-bezier(.29,.12,.66,.98) both;
}
.chapter-arrival.with-motion[data-phase="dropping"] .arrival-pocket {
  display: grid; animation: arrival-pocket 1030ms ease both;
}
.chapter-arrival.with-motion[data-phase="stamp"] .arrival-album {
  animation: arrival-page 225ms cubic-bezier(.25,.02,.24,1) both;
}
.chapter-arrival.with-motion[data-phase="printed"] .arrival-album { animation: arrival-recoil 450ms both; }
.chapter-arrival.with-motion[data-phase="printed"] .arrival-print {
  animation: arrival-print 440ms cubic-bezier(.22,.75,.35,1.13) both;
}
.chapter-arrival.with-motion[data-phase="printed"] .arrival-rays {
  animation: arrival-rays 340ms cubic-bezier(.33,.67,.67,1) both;
}
.chapter-arrival.with-motion[data-phase="printed"] .arrival-rays i {
  animation: arrival-ray 340ms cubic-bezier(.33,.67,.67,1) both;
}
.chapter-arrival[data-phase="binding"] .arrival-album { z-index: 2; pointer-events: none; }
.chapter-arrival[data-phase="binding"] .arrival-print { animation: none; }
.arrival-binding { position: absolute; inset: 0; pointer-events: none; }
.binding-back, .binding-hinge {
  position: absolute;
  top: calc(50% - var(--bound-height) / 2); left: calc(50% - var(--bound-width) / 2);
  width: var(--bound-width); height: var(--bound-height);
}
.binding-back { z-index: 1; background: var(--album); border-radius: 6px; }
.binding-back i { position: absolute; inset: 3px; border-radius: 4px; background: #f9efd4; }
.binding-cover {
  position: absolute; top: calc((100% - 164px) / 2); left: 0;
  width: 116px; height: 164px; border-radius: 6px; transform-origin: left center;
  background: linear-gradient(to right, transparent 5%, #0003 5% 10%, transparent 10%) var(--album);
  color: #f7d69b;
}
.binding-cover-label {
  position: absolute; inset: 5px; display: grid; place-content: center; justify-items: center;
  padding: 5px 4px; border: 1px solid #8a754e88; border-radius: 2px; text-align: center; line-height: 1.15;
}
.binding-cover-label small { font-size: 10px; font-weight: 700; }
.binding-cover-label canvas { display: block; width: 36px; height: 36px; margin: 6px 0 3px; }
.binding-cover-label span { font-size: 12px; font-weight: 700; }
.binding-cover-label small:last-child { margin-top: 8px; font-size: 11px; }
.binding-inner-cover {
  position: absolute; inset: 0; background: #f8ecd1; border: 1px solid var(--album); border-radius: inherit;
}
.binding-edge {
  position: absolute; top: 50%; height: 98%; background: #decba9; transform: translate(-50%, -50%);
}
@media (orientation: portrait) {
  body:has(.chapter-arrival[open]) .sidebar { visibility: hidden; }
}
@keyframes arrival-shade { from { opacity: 0; } to { opacity: 1; } }
@keyframes arrival-rise { from { opacity: 0; transform: translateY(78dvh) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes arrival-glint { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@keyframes arrival-drop {
  0% { transform: none; opacity: 1; }
  38% { transform: translateY(-8px) scale(.55) rotate(-5deg); opacity: 1; }
  78%, 100% { transform: translateY(min(31dvh, 245px)) scale(.55); opacity: 0; }
}
@keyframes arrival-pocket {
  0%, 100% { opacity: 0; transform: translateY(24px); }
  33%, 77% { opacity: 1; transform: none; }
}
@keyframes arrival-page { from { opacity: 0; transform: scale(.91); } to { opacity: 1; transform: none; } }
@keyframes arrival-print { from { opacity: 0; transform: scale(1.6) rotate(-16deg); } to { opacity: 1; transform: rotate(-5deg); } }
@keyframes arrival-recoil {
  0% { transform: none; animation-timing-function: ease-in; }
  15.56% { transform: scale(.973); animation-timing-function: cubic-bezier(.22,.75,.35,1.18); }
  100% { transform: none; }
}
@keyframes arrival-rays { from { opacity: 1; } to { opacity: 0; } }
@keyframes arrival-ray {
  to { width: 0; transform: rotate(var(--angle)) translateX(57.2px); }
}
.ticket-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 14px 20px; }
.ticket-detail-actions .btn { flex: 1; min-height: 46px; }
.ticket-pin-options { display: grid; }
.ticket-pin-options .btn {
  justify-content: flex-start; min-height: 48px; background: transparent; color: var(--ink); text-align: start;
}
.ticket-pin-options .btn:hover { background: var(--sand); }
.thanks-letter {
  padding: 20px; border: 1px dashed var(--seal-ink); border-radius: 15px;
  background: var(--panel); font-size: 17px;
}
.thanks-letter header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 6px 12px; font-size: 12px; font-weight: 700;
}
.thanks-letter :is(time, small) { color: var(--muted); font-size: 12px; font-weight: 400; }
.thanks-letter-heading {
  display: flex; align-items: center; gap: 10px; padding-block: 14px;
  border-bottom: 1px solid var(--stroke);
}
.thanks-letter-heading h2 { font-size: 22px; }
.thanks-letter-heading .ticket-thanks-motif {
  position: relative; inset: auto; flex: none; width: 58px; height: 58px;
}
.thanks-letter-heading canvas { width: 33px; height: 33px; }
.thanks-letter p { margin: 14px 0 0; }
.thanks-letter-signature { text-align: end; }
.ticket-note { padding: 17px; background: var(--sand); border-radius: 19px; }
.ticket-note header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-note h2 { font-size: 13px; color: var(--leaf); }
.ticket-note h3 {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px;
  font-size: 34px; line-height: 1.2; margin-top: 10px; overflow-wrap: anywhere;
}
.ticket-note h3 small { font-size: 15px; font-weight: 400; color: var(--muted); }
.ticket-note p { color: var(--muted); font-size: 15px; white-space: pre-line; }
.ticket-example { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--stroke); }
.ticket-example strong { font: 600 20px/1.3 Georgia, serif; }
.ticket-example p { margin-top: 10px; }
.ticket-picker .phonetic { color: var(--muted); font-size: 12px; }
.ticket-recovered { margin-top: 14px; }
.ticket-recovered h2 { font-size: 16px; }
.ticket-recovered-row {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; min-height: 58px;
}
.ticket-recovered-row::after {
  content: ""; position: absolute; inset: auto 0 0 52px; border-bottom: 1px solid var(--stroke);
}
.ticket-recovered-row :is(.word-light, .icon-btn) {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent;
}
.ticket-recovered-row .icon-btn[aria-pressed="true"] { color: var(--leaf); }
.ticket-recovered-word {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 4px 8px; width: 100%; min-height: 44px; padding: 5px 8px;
  text-align: start; background: transparent; border: 0; overflow-wrap: anywhere;
}
.ticket-recovered-word strong, .ticket-recovered-word small { display: block; }
.ticket-recovered-word strong { font-size: 20px; }
.ticket-recovered-word small { color: var(--muted); font-size: 12px; }
.ticket-recovered-word > span:last-child { color: var(--muted); font-size: 15px; white-space: pre-line; }
.word-editor {
  display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 7px;
  height: max(240px, calc(100dvh - 115px)); margin-inline: auto; max-width: 850px;
}
.word-editor .check-in-header { margin: 0; min-height: 44px; }
.word-editor h1 { overflow-wrap: anywhere; }
.word-editor input {
  width: 100%; min-height: 42px; padding: 7px 11px; border: 0; border-radius: 8px;
  background: var(--panel); color: var(--ink); font-size: 16px;
}
.word-editor-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.word-editor-filters button, .word-editor-add {
  min-height: 42px; border: 0; border-radius: 8px; background: var(--panel); color: var(--ink);
  font-size: 15px; font-weight: 700;
}
.word-editor-filters [aria-pressed="false"] { opacity: .55; }
.word-editor-add { background: var(--ink); color: var(--panel); }
.word-editor-list { overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.word-editor-row {
  display: flex; align-items: center; min-height: 55px; gap: 6px; border-bottom: 1px solid var(--stroke);
}
.word-editor-row .word-light { width: 44px; height: 44px; flex: none; }
.word-editor-term {
  flex: 1; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: var(--ink);
  text-align: start; overflow-wrap: anywhere; user-select: none; -webkit-touch-callout: none;
}
.word-editor-term strong { font-size: 20px; line-height: 24px; }
.word-editor-term small { display: block; font-size: 12px; color: var(--muted); }
.word-editor-term span { display: block; font-size: 15px; color: var(--muted); }
.word-editor-menu { display: grid; gap: 8px; }
.word-editor-menu button { justify-content: start; }
@media (orientation: portrait) {
  body[data-page="word-editor"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="word-editor"] .workspace { margin: 0; }
  body[data-page="word-editor"] main { padding: calc(7px + env(safe-area-inset-top)) 16px calc(7px + env(safe-area-inset-bottom)); }
  .word-editor { height: max(240px, calc(100dvh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
  .word-editor-row [aria-haspopup] { position: absolute; opacity: 0; pointer-events: none; }
  .word-editor-row [aria-haspopup]:focus-visible { position: static; opacity: 1; pointer-events: auto; }
}
.settings-paper .check-in-header { margin-bottom: 15px; }
.icon-sprite { position: absolute; overflow: hidden; pointer-events: none; }
.transfer-view { max-width: 680px; margin-inline: auto; }
.transfer-summary {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  border-radius: 8px; background: #19191b; color: #fff;
}
.transfer-summary > .icon { width: 33px; height: 33px; flex: none; color: #ffb142; }
.transfer-summary h2 { font-size: 20px; overflow-wrap: anywhere; }
.transfer-summary p { margin-top: 5px; color: #dedede; font-size: 15px; }
.transfer-sections { display: grid; gap: 16px; margin-top: 16px; }
.transfer-sections section > h2 { margin: 0 0 5px; font-size: 15px; }
.transfer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 62px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--stroke);
  background: transparent; color: var(--ink); text-align: left;
}
.transfer-row strong, .transfer-row small { display: block; }
.transfer-row strong { font-size: 16px; }
.transfer-row small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.transfer-row > .icon { flex: none; color: var(--muted); }
@media (orientation: portrait) {
  body[data-page="transfer"] :is(.topbar, .sidebar) { display: none; }
  body[data-page="transfer"] .workspace { margin: 0; }
  body[data-page="transfer"] main { padding: calc(6px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
}
.transfer-view .check-in-header { min-height: 44px; }
.settings-passport {
  position: relative; display: flex; align-items: center; padding: 14px 16px; border-radius: 20px;
  background: linear-gradient(to bottom right, var(--goal-tint), var(--passport-paper)); color: var(--goal-ink);
  box-shadow: 0 1px 3px #0002;
}
.settings-passport::before {
  content: ""; position: absolute; inset: 5px; border: 1px dashed var(--goal-blue); border-radius: 16px;
  opacity: .29; pointer-events: none;
}
.settings-passport .passport-avatar {
  position: relative; display: grid; place-items: center; flex: 0 0 60px; width: 60px; height: 60px; padding: 0;
  margin-right: 14px; border: 1px solid var(--goal-blue); border-radius: 50%; background: #fff; transform: rotate(-7deg);
}
.passport-avatar::before {
  content: ""; position: absolute; inset: 2px; border: 1px dashed var(--goal-blue); border-radius: 50%; pointer-events: none;
}
.passport-avatar img { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; }
.passport-name { flex: 1; min-width: 0; }
.passport-name span { display: block; margin-bottom: 5px; color: var(--goal-blue); font-size: 12px; font-weight: 700; }
.passport-mark {
  position: relative; width: 14px; height: 44px; flex: 0 0 14px; color: var(--goal-blue); opacity: .6;
}
.passport-mark::before {
  content: ""; position: absolute; top: 10px; left: 4px; width: 6px; height: 6px; border: 1.5px solid; border-radius: 50%;
}
.passport-mark::after {
  content: ""; position: absolute; top: 25px; left: 3px; width: 8px; height: 1px; background: currentColor;
  box-shadow: 0 2px currentColor, 0 5px currentColor, 0 8px currentColor, 0 10px currentColor;
}
.passport-name strong {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 22px; font-weight: 750; overflow-wrap: anywhere;
}
.settings-passport .icon-btn { color: inherit; }
.travel-sheet[data-view="passport-name"][open] {
  top: var(--passport-viewport-top, 0px); bottom: auto; height: var(--passport-viewport-height, 100%);
}
.travel-sheet[data-view="passport-name"] .travel-sheet-body { padding-bottom: 2px; }
.passport-name-picture {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; object-fit: contain;
  background: var(--goal-fill); box-shadow: 0 1px 3px #0003, 0 0 0 1px var(--goal-border);
}
.passport-name-form { display: grid; gap: 18px; padding-top: 18px; }
.passport-name-form input {
  width: 100%; min-height: 54px; padding: 12px 16px; border: 1px solid var(--goal-blue);
  border-radius: 16px; background: var(--goal-fill); color: inherit; caret-color: var(--goal-blue); font-size: 18px;
}
.passport-name-form input::placeholder { color: var(--passport-muted); }
.passport-name-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.passport-name-actions button {
  min-height: 52px; padding: 10px; border: 0; border-radius: 26px; background: var(--goal-fill); font-size: 17px; font-weight: 700;
}
.passport-name-actions button[type="submit"] { background: var(--goal-ink); color: var(--passport-paper); }
.passport-name-actions button:disabled { opacity: .4; }
.settings-sheet {
  --settings-orange: #fd893f;
  --settings-red: #b22c3a;
  --settings-track: #c9c9cd;
  margin-top: 17px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--panel);
}
:root[data-theme="dark"] .settings-sheet {
  --settings-orange: #ff9d63; --settings-red: #ff9aa4; --settings-track: #606064;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .settings-sheet {
    --settings-orange: #ff9d63; --settings-red: #ff9aa4; --settings-track: #606064;
  }
}
.settings-sheet section {
  min-width: 0;
  padding: 14px 15px 10px 28px;
  background: linear-gradient(to right, transparent 17px, var(--stroke) 17px, var(--stroke) 18px, transparent 18px);
}
.settings-sheet section + section { border-top: 1px solid var(--stroke); }
.settings-sheet h2 {
  display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--settings-heading, var(--goal-blue));
  padding: 4px 9px; margin-bottom: 8px; border-radius: 6px;
  background: var(--goal-tint);
  background: color-mix(in srgb, currentColor 13.33%, transparent);
}
.settings-sheet h2 .icon { width: 15px; height: 15px; }
.settings-appearance { --settings-heading: var(--settings-orange); }
.settings-sound { --settings-heading: var(--settings-red); }
@media (orientation: landscape) and (min-width: 560px) {
  .settings-sheet {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "appearance sound" "learning sound" "manual feedback" "offline offline";
  }
  .settings-sheet section {
    padding-inline: 20px 11px;
    background: linear-gradient(to right, transparent 10px, var(--stroke) 10px, var(--stroke) 11px, transparent 11px);
  }
  .settings-sheet .settings-modes { grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)); }
  .settings-sheet .settings-appearance { grid-area: appearance; }
  .settings-sheet .settings-learning { grid-area: learning; }
  .settings-sheet .settings-sound { grid-area: sound; border-top: 0; border-left: 1px solid var(--stroke); }
  .settings-sheet .settings-manual { grid-area: manual; }
  .settings-sheet .settings-feedback { grid-area: feedback; border-left: 1px solid var(--stroke); }
  .settings-sheet .settings-offline { grid-area: offline; }
}
.settings-harbor {
  height: 150px; position: relative; overflow: hidden; background: var(--goal-fill); border-radius: 12px;
}
.settings-harbor::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--stroke);
  pointer-events: none;
}
.settings-harbor canvas {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
}
.settings-harbor img {
  position: absolute; bottom: 0; left: 50%; width: 135px; height: 135px; object-fit: contain;
  transform: translateX(-50%) rotate(-2deg);
}
.settings-harbor[data-theme-choice="light"] img { left: 43%; }
.settings-harbor[data-theme-choice="dark"] img { left: 57%; transform: translateX(-50%) rotate(3deg); }
:root[data-appearance-transition]::view-transition { pointer-events: none; }
:root[data-appearance-transition]::view-transition-group(root) { animation-duration: 360ms; }
:root[data-appearance-transition]::view-transition-old(root) {
  animation: settings-appearance-fade 360ms cubic-bezier(.42,0,.58,1);
  mix-blend-mode: normal;
  z-index: 1;
}
:root[data-appearance-transition]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@keyframes settings-appearance-fade { from { opacity: 1; } to { opacity: 0; } }
.settings-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 5px; }
.settings-modes button {
  border: 0; background: transparent; color: var(--passport-muted); border-radius: 24px;
  min-height: 46px; padding: 3px 1px; font-size: 13px;
}
.settings-modes button[aria-pressed=true] { background: var(--goal-ink); color: var(--passport-paper); }
.settings-row {
  display: flex; width: 100%; min-height: 50px; align-items: center; justify-content: space-between;
  gap: 8px; text-align: left; padding: 5px 0; border: 0; border-bottom: 1px solid var(--stroke);
  background: transparent; font-size: 17px; color: var(--ink);
}
.settings-row > * { min-width: 0; overflow-wrap: anywhere; }
.settings-row > :nth-child(2) { color: var(--goal-blue); }
.settings-row > span:nth-child(2) { text-align: right; }
.settings-row .icon { width: 15px; height: 15px; }
label.settings-row { cursor: pointer; }
.settings-row [role=switch] {
  appearance: none; flex: 0 0 39px; width: 39px; height: 23px; margin: 0;
  border: 0; border-radius: 14px; background: var(--settings-track); position: relative; cursor: pointer;
}
.settings-row [role=switch]:checked { background: var(--goal-blue); }
.settings-row [role=switch]::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 19px; height: 19px;
  background: #fff; border-radius: 50%;
}
.settings-row [role=switch]:checked::after { left: 18px; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .settings-row [role=switch] { transition: background-color .15s ease-out; }
  :root:not([data-motion="reduce"]) .settings-row [role=switch]::after { transition: left .15s ease-out; }
}
.travel-sheet[data-view="settings-books"] .travel-sheet-panel {
  height: min(700px, 81vh); height: min(700px, 81dvh);
}
.travel-sheet[data-view="settings-books"] h2 { flex: none; padding: 6px 20px; }
.travel-sheet[data-view="settings-books"] .travel-sheet-body {
  flex: 1; padding: 8px 16px;
  mask-image: linear-gradient(to bottom, transparent, black var(--sheet-fade-top, 0px),
    black calc(100% - var(--sheet-fade-bottom, 0px)), transparent);
}
.settings-book-picker { display: grid; gap: 2px; padding-bottom: 2px; }
.settings-book-picker button {
  display: flex; align-items: center; gap: 14px; text-align: left; min-height: 62px; min-width: 0;
  padding: 8px 12px; border: 0; border-radius: 16px; background: transparent; font-size: 17px;
}
.settings-book-picker button:focus-visible { outline-offset: -2px; }
.settings-book-picker button[aria-pressed="true"] { background: var(--goal-tint); color: var(--goal-blue); font-weight: 700; }
.settings-book-picker img {
  flex: 0 0 33px; width: 33px; height: 46px; border-radius: 5px; background: var(--goal-fill);
  box-shadow: 0 1px 3px #0003;
}
.settings-book-picker button > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.settings-book-selected {
  display: grid; place-items: center; flex: 0 0 21px; height: 21px;
  border-radius: 50%; background: var(--goal-blue); color: #fff;
}
.settings-book-selected .icon { width: 14px; height: 14px; }
:root[data-theme="dark"] .settings-book-selected { color: #000; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .settings-book-selected { color: #000; }
}
@media (orientation: landscape) and (min-width: 560px) {
  .travel-sheet[data-view="settings-books"] .travel-sheet-panel { width: min(100%, 540px); }
  .settings-book-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
}
.settings-rate-options { display: grid; gap: 5px; }
.settings-rate-options button {
  width: 100%; min-height: 50px; padding: 5px 9px; border: 0; border-radius: 8px;
  text-align: left; color: var(--ink); background: var(--panel);
}
#dialog[data-view="voice-samples"][open] {
  --voice-paper: #fff; --voice-border: #dadbde; --voice-text: #19191b; --voice-muted: #56595c;
  --voice-blue: #195495; --voice-tint: #e7f4ff; --voice-orange: #fd893f;
  position: fixed; inset: auto env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex; flex-direction: column; margin: 0 auto; overflow: hidden;
  width: min(calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)), 530px); max-width: none;
  max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 14px 18px; border: 0; border-radius: 24px; color: var(--voice-text); background: var(--voice-paper);
  box-shadow: inset 0 0 0 1px var(--voice-border);
}
:root[data-theme="dark"] #dialog[data-view="voice-samples"][open] {
  --voice-paper: #000; --voice-border: #464a52; --voice-text: #f3f3f5; --voice-muted: #bbbfc7;
  --voice-blue: #89c6ff; --voice-tint: #1e344a; --voice-orange: #ff9d63;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] #dialog[data-view="voice-samples"][open] {
    --voice-paper: #000; --voice-border: #464a52; --voice-text: #f3f3f5; --voice-muted: #bbbfc7;
    --voice-blue: #89c6ff; --voice-tint: #1e344a; --voice-orange: #ff9d63;
  }
}
#dialog > .voice-samples-header {
  display: grid; flex: 0 0 auto; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; text-align: center; margin-bottom: 9px;
}
.voice-samples-header h2 { font-size: 15px; }
.voice-samples-header .icon-btn {
  width: 44px; height: 44px; color: inherit; border-radius: 50%; background: var(--voice-border);
}
.voice-samples {
  display: grid; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.voice-samples button {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 29px; align-items: center; gap: 10px;
  min-height: 56px; padding: 5px 6px; border: 0; background: transparent; text-align: left;
}
.voice-samples button:focus-visible { outline-offset: -2px; }
.voice-samples strong { display: block; font-size: 17px; line-height: 1.25; }
.voice-samples small { display: block; color: var(--voice-muted); font-size: 12px; line-height: 1.3; }
.voice-sample-wave {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--voice-tint); color: var(--voice-blue); font-size: 22px; font-weight: 700;
}
.voice-sample-play, .voice-sample-stop { text-align: center; font-size: 18px; font-weight: 700; }
.voice-sample-play { color: var(--voice-blue); }
.voice-sample-stop { color: var(--voice-orange); }
.voice-sample-stop, .voice-samples [aria-pressed="true"] .voice-sample-play { display: none; }
.voice-samples [aria-pressed="true"] .voice-sample-stop { display: block; }
@media (orientation: landscape) and (min-width: 560px) {
  .voice-samples { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
}
@media (orientation: portrait) {
  body:has(.check-in-view) { background: var(--panel); }
  .check-in-view .station-paper-dock { background: var(--panel); }
  body[data-view="ticket-detail"] .sidebar { display: none; }
  body[data-view="ticket-detail"] main {
    background: var(--panel); min-height: 100dvh;
    padding: calc(5px + env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom));
  }
}
@media (orientation: landscape) and (max-height: 540px) {
  .guide-content { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 16px; }
  .guide-content h1 { font-size: 27px; }
  .guide-walker { max-height: 44dvh; width: 100%; }
}
