:root {
  color-scheme: light;
  --ink: #171c1f;
  --forest: #031f41;
  --muted: #59636f;
  --paper: #f6fafe;
  --white: #ffffff;
  --line: #c4c6cf;
  --teal: #006591;
  --teal-dark: #004666;
  --teal-pale: #c9e6ff;
  --coral: #f97316;
  --coral-strong: #783200;
  --yellow: #f59e0b;
  --sky-pale: #e4f3ff;
  --leaf-pale: #f0f4f8;
  font-family: "Quicksand", "Rubik", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background-color: var(--paper); background-image: radial-gradient(rgba(3, 31, 65, .055) .8px, transparent .8px); background-size: 24px 24px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, .file-button:focus-within { outline: 3px solid rgba(67, 141, 125, .42); outline-offset: 3px; }
.page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 42px; }
.page-narrow { width: min(680px, calc(100% - 40px)); }
.launch-help { display: grid; min-height: 100svh; place-items: center; padding: 24px; }
.launch-help-card { width: min(520px, 100%); padding: clamp(25px, 6vw, 42px); border: 2px solid #dfe3e7; border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 7px 0 #c4c6cf, 0 18px 45px rgba(3,31,65,.08); text-align: center; }
.launch-help-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 18px; place-items: center; border: 1px solid #d9e8d8; border-radius: 20px; background: #eef6e9; font-size: 32px; }
.launch-help-card h1 { margin: 8px 0 12px; color: var(--ink); font-size: clamp(25px, 7vw, 34px); letter-spacing: -.04em; }
.launch-help-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.launch-help-steps { display: grid; justify-items: center; gap: 10px; margin-top: 24px; padding: 18px; border-radius: 15px; background: #f4f7ef; color: #526b60; font-size: 13px; }
.launch-help-steps code { padding: 8px 13px; border-radius: 9px; color: #fff; background: var(--forest); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.topbar, .study-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.topbar { position: sticky; top: 8px; z-index: 6; min-height: 62px; padding: 8px 17px; border: 2px solid #1d3557; border-radius: 18px; color: white; background: var(--forest); box-shadow: 0 5px 0 #001b3c, 0 8px 18px rgba(3, 31, 65, .12); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; color: white; background: transparent; font-size: 17px; font-weight: 800; letter-spacing: .025em; text-align: left; }
.brand:hover { opacity: .88; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; height: 25px; padding: 0 3px; }
.brand-mark span { display: block; width: 8px; border: 1px solid rgba(40, 102, 99, .2); border-radius: 2px; background: var(--teal); }
.brand-mark span:first-child { height: 14px; background: #e9b969; }
.brand-mark span:nth-child(2) { height: 21px; background: #77aaa0; }
.brand-mark span:last-child { height: 17px; background: var(--coral); }
.topbar-profile { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-right: 20px; font-size: 14px; }
.topbar-profile > span:first-child { font-size: 20px; }
.topbar-profile b { color: white; }
.topbar-profile .grade-chip { color: white; background: rgba(255,255,255,.15); }
.topbar-back { color: white; }
.grade-chip, .daily-chip { border-radius: 999px; background: #edf0df; padding: 6px 10px; color: #587267; font-size: 11px; font-weight: 700; }
.quiet-button, .text-button, .home-bottom-links button, .small-link { border: 0; background: transparent; }
.quiet-button { min-height: 44px; padding: 0 13px; border-radius: 12px; color: #60767a; font-size: 14px; font-weight: 700; }
.quiet-button:hover, .text-button:hover, .home-bottom-links button:hover { background: rgba(67, 141, 125, .1); }
.eyebrow { color: #8b9b99; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
.welcome-block { padding: 55px 0 26px; }
.welcome-block h1, .home-copy h1, .subpage-heading h1, .result-heading h1 { margin: 12px 0; color: var(--ink); font-size: clamp(34px, 5vw, 51px); font-weight: 850; letter-spacing: -.055em; line-height: 1.16; }
.welcome-block h1 em, .home-copy h1 em, .subpage-heading h1 em, .result-heading h1 em { color: var(--teal); font-style: normal; }
.welcome-block p, .home-copy > p, .subpage-heading p, .result-heading p { margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.profile-list { display: grid; gap: 12px; }
.profile-card-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; overflow: hidden; min-height: 80px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: 0 5px 20px rgba(40, 70, 69, .035); }
.profile-card { display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 78px; padding: 12px 18px; border: 0; background: transparent; text-align: left; }
.profile-card:hover { background: #f3f8ec; }
.profile-avatar { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; background: #edf4e8; font-size: 25px; }
.profile-main { display: grid; gap: 4px; }
.profile-main b { font-size: 17px; }
.profile-main small { color: var(--muted); font-size: 12px; }
.selected-label { margin-left: auto; color: var(--teal); font-size: 12px; font-weight: 800; }
.profile-arrow, .mini-arrow { margin-left: auto; color: #a3b2af; font-size: 25px; font-weight: 300; }
.profile-card-tools { display: flex; gap: 2px; padding: 0 9px; }
.text-button { min-width: 44px; min-height: 44px; border-radius: 10px; color: #6b7e81; font-size: 12px; font-weight: 700; }
.delete-text { color: #b27f75; }
.profile-actions { display: flex; justify-content: center; padding: 20px 0 27px; }
.primary-button, .secondary-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid transparent; border-radius: 13px; font-size: 14px; font-weight: 800; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.primary-button { color: white; border-color: #c2410c; background: linear-gradient(180deg, #fc7519, #e85e08); box-shadow: 0 5px 0 #783200, inset 0 2px 0 rgba(255,255,255,.35); }
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(180deg, #ff842b, #f26a12); box-shadow: 0 6px 0 #783200, inset 0 2px 0 rgba(255,255,255,.4); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #783200, inset 0 2px 0 rgba(255,255,255,.3); }
.secondary-button { border-color: #004c6e; color: white; background: var(--teal); box-shadow: 0 4px 0 #00334d; }
.secondary-button:hover { color: white; background: #0076a8; }
.secondary-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #00334d; }
.empty-card, .card, .local-tools { border: 2px solid #dfe3e7; border-radius: 18px; background: var(--white); box-shadow: 0 5px 0 #c4c6cf; }
.empty-card { display: grid; justify-items: center; padding: 29px 20px; text-align: center; }
.empty-sparkle { display: grid; width: 44px; height: 44px; margin-bottom: 12px; place-items: center; border-radius: 15px; color: #a28444; background: #fff4d9; font-size: 22px; }
.empty-card b { font-size: 15px; }
.empty-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.profile-form { margin: 0 0 26px; padding: 22px; }
.form-title { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.form-title h2 { margin: 6px 0 0; font-size: 20px; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 12px; color: #81908e; background: #f4f5ef; font-size: 24px; }
.field-label { display: block; margin: 16px 0 8px; color: #4f6668; font-size: 12px; font-weight: 800; }
.profile-form input[name="nickname"] { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #dfe5dd; border-radius: 11px; color: var(--ink); background: white; font-size: 16px; }
.grade-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.grade-option { display: grid; min-height: 50px; place-items: center; border: 1px solid #dfe5dd; border-radius: 11px; color: #718185; background: white; font-size: 14px; font-weight: 800; cursor: pointer; }
.grade-option input { position: absolute; opacity: 0; pointer-events: none; }
.grade-option.is-selected { border-color: #83b68f; color: var(--teal-dark); background: #e8f4e6; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.local-tools { padding: 18px 20px; background: rgba(255, 254, 250, .76); }
.local-tools h2 { margin: 0 0 6px; font-size: 14px; }
.local-tools p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.local-tool-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.notice { position: fixed; z-index: 10; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); display: flex; max-width: min(480px, calc(100vw - 40px)); align-items: center; gap: 14px; padding: 14px 14px 14px 18px; border: 1px solid #dce7de; border-radius: 14px; color: #44625c; background: white; box-shadow: 0 18px 55px rgba(46, 67, 67, .08); font-size: 13px; line-height: 1.5; }
.notice-error { border-color: #f0d7ca; color: #9b5947; background: #fffaf7; }
.notice-success { border-color: #c7e0d3; color: #367363; background: #f8fffa; }
.notice-close { width: 35px; height: 35px; flex: 0 0 auto; border: 0; border-radius: 10px; color: inherit; background: transparent; font-size: 21px; }

.home-hero { display: grid; grid-template-columns: .92fr 1.08fr; gap: 30px; align-items: center; min-height: 360px; padding: 30px 0 18px; }
.home-copy { position: relative; z-index: 1; padding: 15px 0 20px; }
.home-copy h1 { margin-top: 15px; font-size: clamp(39px, 5vw, 58px); }
.home-copy > p { max-width: 390px; font-size: 14px; }
.home-quick-stats { display: flex; align-items: center; gap: 21px; margin-top: 28px; }
.home-quick-stats > div { display: grid; gap: 2px; }
.home-quick-stats b { color: var(--ink); font-size: 21px; letter-spacing: -.04em; }
.home-quick-stats span { color: var(--muted); font-size: 11px; }
.home-quick-stats i { width: 1px; height: 27px; background: #deded3; }
.grade-stamps { padding: 4px 0 30px; }
.grade-stamps .section-heading { margin-bottom: 14px; }
.grade-stamps .section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.grade-stamp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.grade-stamp-card { --stamp-bg: #d5e9d1; --stamp-ink: #3e7655; position: relative; overflow: hidden; padding: 15px; border: 1px solid #e4e5d8; border-radius: 18px; background: linear-gradient(145deg, #fffef8, #f7f7e9); box-shadow: 0 5px 15px rgba(55, 78, 61, .045); }
.grade-stamp-card:nth-child(2) { --stamp-bg: #d4e9e2; --stamp-ink: #3c766b; background: linear-gradient(145deg, #fffef8, #f1f7ed); }
.grade-stamp-card:nth-child(3) { --stamp-bg: #f2e5b9; --stamp-ink: #8a7139; background: linear-gradient(145deg, #fffef8, #fbf4df); }
.grade-stamp-card.is-current-grade { border-color: #b9d6bd; box-shadow: 0 7px 18px rgba(71, 123, 85, .09); }
.grade-stamp-card.is-complete { border-color: #dfc772; }
.grade-stamp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grade-stamp-kicker { display: block; min-height: 14px; color: #82948a; font-size: 9px; font-weight: 800; letter-spacing: .045em; white-space: nowrap; }
.grade-stamp-card h3 { margin: 1px 0 0; color: var(--ink); font-size: 20px; font-weight: 850; letter-spacing: -.04em; }
.grade-stamp-count { display: flex; align-items: baseline; gap: 3px; color: #8d9b8e; }
.grade-stamp-count b { color: var(--stamp-ink); font-size: 25px; letter-spacing: -.05em; }
.grade-stamp-count span { font-size: 12px; font-weight: 750; }
.grade-stamp-count small { color: #849287; font-size: 9px; font-weight: 750; }
.grade-stamp-progress { overflow: hidden; height: 7px; margin-top: 10px; border-radius: 99px; background: rgba(121, 147, 116, .16); }
.grade-stamp-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #78b286, #efc55d); transition: width .35s ease; }
.stamp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 13px 0 10px; list-style: none; }
.stamp-slot { position: relative; display: flex; aspect-ratio: 1; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px; border: 1.5px dashed #cbd2c3; border-radius: 50%; color: #758276; background: rgba(255, 255, 255, .62); font-weight: 800; }
.stamp-slot.is-partial { border-style: solid; border-color: #c6d5c1; background: linear-gradient(145deg, rgba(255,255,255,.9), #edf3e7); }
.stamp-slot.is-stamped { border: 1px solid var(--stamp-ink); color: var(--stamp-ink); background: var(--stamp-bg); box-shadow: inset 0 0 0 3px rgba(255,255,255,.44); animation: stamp-pop .32s ease both; }
.stamp-slot.is-stamped::after { position: absolute; inset: 4px; border: 1px dotted rgba(54, 103, 72, .42); border-radius: 50%; content: ""; pointer-events: none; }
.stamp-kanji { font-size: clamp(17px, 1.7vw, 22px); line-height: 1; }
.stamp-mode-row { display: flex; gap: 3px; }
.stamp-mode { display: grid; min-width: 19px; height: 14px; place-items: center; border: 1px solid #d9ded3; border-radius: 999px; color: #9aa397; background: rgba(255,255,255,.72); font-size: 8px; line-height: 1; }
.stamp-mode.is-stamped { border-color: var(--stamp-ink); color: white; background: var(--stamp-ink); }
.grade-stamp-status { display: flex; min-height: 20px; align-items: center; justify-content: space-between; gap: 8px; margin: 0; color: #788a7c; font-size: 11px; font-weight: 700; }
.grade-stamp-status b { color: var(--stamp-ink); font-size: 13px; }
.grade-stamp-total { color: #53697c; font-size: 9px; font-weight: 800; white-space: nowrap; }
.grade-stamp-modes { margin: 3px 0 0; color: #849287; font-size: 10px; text-align: right; }
.home-town { min-width: 0; }
.town-scene { position: relative; overflow: hidden; width: 100%; height: 300px; border: 2px solid rgba(255, 255, 255, .82); border-radius: 30px; background: linear-gradient(180deg, #d9f0e4 0%, #e8f2dd 56%, #f7e7c7 100%); box-shadow: 0 13px 30px rgba(77, 103, 88, .1); isolation: isolate; }
.town-scene::before { position: absolute; z-index: -1; right: 14%; bottom: 16%; left: 14%; height: 23%; border-radius: 50%; background: #d1d9b2; content: ""; }
.town-sun { position: absolute; top: 31px; right: 60px; width: 55px; height: 55px; border-radius: 50%; background: #f5cf79; box-shadow: 0 0 0 10px rgba(245, 207, 121, .14); }
.town-cloud { position: absolute; width: 70px; height: 18px; border-radius: 99px; background: rgba(255, 255, 248, .7); }
.town-cloud::before, .town-cloud::after { position: absolute; bottom: 3px; width: 31px; height: 28px; border-radius: 50%; background: inherit; content: ""; }
.town-cloud::before { left: 11px; }
.town-cloud::after { right: 8px; width: 23px; height: 22px; }
.cloud-a { top: 67px; left: 12%; }
.cloud-b { top: 116px; right: 19%; transform: scale(.7); opacity: .65; }
.town-hills { position: absolute; z-index: -1; bottom: 24%; width: 70%; height: 36%; border-radius: 50% 50% 0 0; }
.hill-a { left: -12%; background: #c9ddc0; transform: rotate(-6deg); }
.hill-b { right: -18%; bottom: 28%; background: #b9d5c1; transform: rotate(7deg); }
.town-ground { position: absolute; z-index: -1; right: -5%; bottom: -17%; left: -5%; height: 43%; border: 10px solid rgba(230, 207, 158, .8); border-radius: 50% 50% 0 0; background: #e4d6b2; }
.town-buildings { position: absolute; z-index: 1; inset: 0; }
.building { position: relative; width: 57px; height: 77px; transform: translateY(12px); animation: building-fade .45s ease both; animation-delay: var(--delay, 0s); }
.building-roof { position: absolute; z-index: 2; top: 0; left: -5px; width: 67px; height: 25px; clip-path: polygon(50% 0, 100% 75%, 100% 100%, 0 100%, 0 75%); background: #d77d61; filter: drop-shadow(0 3px 0 rgba(125, 78, 54, .18)); }
.building-body { position: absolute; top: 21px; left: 5px; display: grid; width: 47px; height: 54px; grid-template-columns: 1fr 1fr; gap: 7px; padding: 8px 7px; border-right: 5px solid rgba(35, 85, 83, .18); border-bottom: 5px solid rgba(35, 85, 83, .22); background: #70a69a; box-shadow: 0 3px 0 rgba(62, 112, 102, .2); }
.building-body b { display: block; min-width: 7px; min-height: 9px; border: 1px solid rgba(89, 117, 109, .15); border-radius: 2px; background: #f9e4ad; }
.building-body b:nth-child(3), .building-body b:nth-child(4) { background: #dcebdc; }
.building-1 .building-roof { background: #d8ad56; }
.building-1 .building-body { background: #cf8c70; }
.building-2 .building-roof { background: #778fbe; }
.building-2 .building-body { background: #e7c477; }
.building-3 .building-roof { background: #806da4; }
.building-3 .building-body { background: #8db6a0; }
.town-buildings > .building:nth-child(1) { position: absolute; bottom: 30%; left: 16%; transform: scale(.73); }
.town-buildings > .building:nth-child(2) { position: absolute; bottom: 27%; left: 35%; transform: scale(.94); }
.town-buildings > .building:nth-child(3) { position: absolute; bottom: 33%; left: 56%; transform: scale(.68); }
.town-buildings > .building:nth-child(4) { position: absolute; bottom: 25%; left: 72%; transform: scale(.88); }
.town-buildings > .building:nth-child(5) { position: absolute; bottom: 37%; left: 27%; transform: scale(.56); }
.town-buildings > .building:nth-child(6) { position: absolute; bottom: 39%; left: 64%; transform: scale(.62); }
.town-buildings > .building:nth-child(7) { position: absolute; bottom: 26%; left: 48%; transform: scale(.7); }
.town-buildings > .building:nth-child(8) { position: absolute; bottom: 31%; left: 82%; transform: scale(.57); }
.town-buildings > .building:nth-child(9) { position: absolute; bottom: 42%; left: 43%; transform: scale(.54); }
.town-buildings > .building:nth-child(10) { position: absolute; bottom: 34%; left: 8%; transform: scale(.57); }
.town-buildings > .building:nth-child(11) { position: absolute; bottom: 24%; left: 60%; transform: scale(.63); }
.town-buildings > .building:nth-child(12) { position: absolute; bottom: 42%; left: 77%; transform: scale(.5); }
.town-seed { position: absolute; z-index: 1; right: 0; bottom: 29%; left: 0; display: grid; justify-items: center; color: #6e9184; }
.town-seed span { display: grid; width: 45px; height: 45px; place-items: center; border: 1px solid rgba(100, 146, 126, .25); border-radius: 16px; background: #eff4dc; font-size: 25px; }
.town-seed small { margin-top: 8px; padding: 5px 9px; border-radius: 99px; background: rgba(255, 254, 245, .8); font-size: 10px; font-weight: 700; }
.town-level { position: absolute; z-index: 2; right: 9%; bottom: 29%; display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: var(--teal-dark); background: white; font-size: 10px; font-weight: 800; }
.town-path { position: absolute; z-index: 1; right: 0; bottom: 17%; left: 0; height: 7px; border-top: 2px solid rgba(173, 149, 105, .25); border-bottom: 2px solid rgba(173, 149, 105, .25); background: #f2e7ca; transform: rotate(-4deg); }
.town-mascot { position: absolute; z-index: 4; bottom: 17%; left: 6%; display: grid; justify-items: center; }
.buddy-svg { display: block; width: 70px; height: 70px; overflow: visible; filter: drop-shadow(0 4px 0 rgba(59, 69, 63, .1)); }
.buddy-antenna-light { animation: buddy-robot-signal 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.town-mascot .buddy-svg { width: 92px; height: 92px; animation: buddy-bob 2.8s ease-in-out infinite; }
.town-buddy-callout { position: relative; z-index: 1; margin-top: -5px; padding: 6px 9px; border: 1px solid rgba(43, 65, 73, .1); border-radius: 12px 12px 12px 4px; color: #516b62; background: #fffdf2; box-shadow: 0 3px 8px rgba(51, 64, 60, .08); font-size: 10px; font-weight: 800; white-space: nowrap; }
.buddy-note { display: flex; align-items: center; gap: 10px; }
.buddy-note .buddy-svg { width: 56px; height: 56px; flex: 0 0 auto; }
.buddy-note > span { padding: 10px 13px; border: 1px solid #e8e2cd; border-radius: 13px 13px 13px 4px; color: #586c65; background: #fffdf4; font-size: 12px; font-weight: 800; }
.hint-buddy-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 13px; padding: 8px 9px; border-radius: 13px; background: #fff9e8; }
.hint-buddy-row .buddy-svg { width: 42px; height: 42px; flex: 0 0 auto; }
.hint-buddy-row span { color: #687c73; font-size: 10px; font-weight: 700; line-height: 1.5; }
.result-buddy-note { justify-content: center; margin-top: 12px; }
.result-buddy-note .buddy-svg { width: 52px; height: 52px; }
.result-buddy-note > span { color: #826348; background: #fff5d9; }
.start-area { padding: 16px 0 30px; }
.home-start-priority { margin-top: 12px; padding: 18px; border: 2px solid #c8dfd0; border-radius: 22px; background: linear-gradient(110deg, #f1fbf4, #fff 68%); box-shadow: 0 5px 0 rgba(113, 159, 129, .16); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.035em; }
.daily-chip { background: #e9eee4; }
.start-button { display: flex; width: 100%; min-height: 78px; justify-content: flex-start; padding: 0 23px; text-align: left; }
.start-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: #47724e; background: rgba(255,255,255,.48); font-size: 16px; }
.start-button > span:nth-child(2) { display: grid; gap: 4px; }
.start-button b { font-size: 16px; }
.start-button small { color: rgba(49,81,63,.78); font-size: 12px; font-weight: 600; }
.button-arrow { margin-left: auto; font-size: 23px; font-weight: 400; }
.start-session-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 10px; }
.start-session-actions .start-button { min-width: 0; }
.session-delete-button { min-height: 42px; padding: 0 13px; border: 2px solid #f0d5d1; border-radius: 13px; color: #9d4d42; background: #fff7f4; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.session-delete-button:hover { border-color: #e5aaa2; background: #fff0ed; }
.session-delete-button:focus-visible { outline: 3px solid #39b8fd; outline-offset: 2px; }
.complete-card { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border: 1px solid #d8e7d8; border-radius: 16px; background: #f3f8ec; }
.complete-card > div { display: grid; grid-template-columns: 34px 1fr; align-items: center; column-gap: 10px; }
.complete-check { display: grid; width: 31px; height: 31px; grid-row: span 2; place-items: center; border-radius: 50%; color: white; background: #75a77f; font-size: 16px; font-weight: 800; }
.complete-card b { font-size: 14px; }
.complete-card small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.paused-session-section { margin: -8px 0 25px; }
.paused-session-list { display: grid; gap: 9px; }
.paused-session-card { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; border: 2px solid #dfe3e7; border-radius: 16px; background: white; box-shadow: 0 4px 0 #c4c6cf; }
.paused-session-card > div:first-child { display: grid; min-width: 0; gap: 4px; }
.paused-session-card b { font-size: 13px; }
.paused-session-card small { color: var(--muted); font-size: 11px; }
.paused-session-card .secondary-button { min-height: 42px; flex: 0 0 auto; padding: 0 14px; font-size: 12px; }
.paused-session-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.paused-session-actions .session-delete-button { min-width: 62px; }
.paused-history-link { display: block; margin: 6px 0 0 auto; }
.home-footer-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card { display: flex; min-height: 73px; align-items: center; gap: 11px; padding: 12px 15px; border: 1px solid #ebe4d3; border-radius: 17px; background: var(--white); box-shadow: 0 4px 12px rgba(63, 73, 58, .035); text-align: left; }
.mini-card:hover { border-color: #c8dcd1; }
.mini-card > span:nth-child(2) { display: grid; gap: 4px; }
.mini-card b { font-size: 12px; }
.mini-card small { color: var(--muted); font-size: 10px; }
.mini-card-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-pale); font-size: 18px; }
.profile-icon { color: #ba846c; background: #fff0e2; }
.mini-arrow { font-size: 19px; }
.home-bottom-links { display: flex; justify-content: space-between; gap: 12px; padding: 17px 4px 0; color: #94a19d; font-size: 10px; }
.home-bottom-links button { min-height: 36px; padding: 4px 8px; border-radius: 8px; color: #718581; font-size: 11px; font-weight: 700; }

.study-page { width: min(1180px, calc(100% - 48px)); padding-top: 18px; }
.study-topbar { min-height: 62px; padding: 7px 12px; border-radius: 18px; color: white; background: var(--forest); box-shadow: 0 7px 18px rgba(47, 91, 69, .18); }
.study-topbar .quiet-button { color: white; }
.study-progress-label { display: grid; justify-items: center; gap: 1px; }
.study-progress-label span { color: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.study-progress-label b { color: white; font-size: 20px; }
.study-progress-label b small { color: rgba(255,255,255,.68); font-size: 13px; font-weight: 600; }
.study-mode-chip { min-width: 54px; padding: 7px 11px; border-radius: 99px; text-align: center; font-size: 11px; font-weight: 800; }
.mode-reading { color: #347c74; background: var(--sky-pale); }
.mode-writing { color: #a85f43; background: #fff0df; }
.mode-sentence { color: #8a6a28; background: #fff1c9; }
.study-progress { overflow: hidden; height: 7px; margin: 7px 0 26px; border-radius: 99px; background: #e4e8d9; }
.study-progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #65ad78, #f1c75d); transition: width .25s ease; }
.question-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(265px, .72fr); gap: 25px; align-items: stretch; }
.question-main { min-width: 0; }
.question-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px 3px; color: #7b8c82; font-size: 11px; font-weight: 700; }
.question-kicker span:first-child { color: #43806d; letter-spacing: .11em; }
.question-dot { width: 4px; height: 4px; border-radius: 50%; background: #bfd5c2; }
.question-card { position: relative; display: flex; min-height: 247px; flex-direction: column; align-items: flex-start; justify-content: center; overflow: hidden; padding: 26px clamp(22px, 5vw, 52px); border: 1px solid #d8e4cf; border-radius: 24px; background: radial-gradient(ellipse at 98% 8%, rgba(187, 225, 190, .42), transparent 43%), linear-gradient(135deg, #fffef8, #f6f8ea); box-shadow: 0 10px 32px rgba(56, 84, 66, .075); }
.question-card::after { position: absolute; top: 19px; right: 26px; color: #e1bf55; content: "✦"; font-size: 22px; opacity: .85; }
.question-label { padding: 5px 9px; border-radius: 99px; color: #557448; background: #e7f0d8; font-size: 11px; font-weight: 800; }
.question-card h1 { margin: 17px 0 21px; color: var(--ink); font-size: clamp(28px, 4.1vw, 43px); font-weight: 800; letter-spacing: -.045em; line-height: 1.5; overflow-wrap: anywhere; }
.question-card .sentence-prompt { font-size: clamp(20px, 2.8vw, 29px); letter-spacing: -.025em; line-height: 1.8; }
.writing-prompt { font-size: clamp(25px, 3.6vw, 37px) !important; }
.vocab-tag { padding: 6px 10px; border-radius: 8px; color: #55776a; background: #e8f1e2; font-size: 11px; font-weight: 700; }
.writing-word-blank { display: inline-block; width: 1.12em; height: 1.12em; flex: 0 0 auto; margin: 0 .12em; border: 2px solid #0b8dc2; border-radius: .08em; background: #fff; font-size: .92em; line-height: 1; vertical-align: -.1em; }
.write-practice { display: grid; justify-items: center; gap: 10px; margin-top: 13px; padding: 15px; border: 1px solid #d8e4cf; border-radius: 18px; background: linear-gradient(135deg, #eff6e8, #fffef8 72%); box-shadow: 0 5px 16px rgba(75, 103, 73, .06); }
.write-practice-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.write-practice-heading > div { display: grid; gap: 3px; }
.write-practice-heading b { font-size: 12px; }
.write-practice-heading small { color: #89958f; font-size: 10px; }
.writing-comparison { display: grid; width: min(100%, 590px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.writing-sample { display: grid; min-width: 0; justify-items: center; gap: 7px; }
.writing-sample-label { color: #73847b; font-size: 10px; font-weight: 800; }
#writing-pad, #writing-model { display: block; width: min(100%, 280px); height: auto; aspect-ratio: 1; overflow: hidden; border: 1px solid #d7e3d1; border-radius: 15px; background-color: #fffef8; background-image: linear-gradient(rgba(174, 198, 173, .52) 1px, transparent 1px), linear-gradient(90deg, rgba(174, 198, 173, .52) 1px, transparent 1px); background-size: 50% 50%; }
#writing-pad { touch-action: none; }
#writing-pad.writing-pad-readonly { pointer-events: none; }
#writing-model { display: grid; place-items: center; touch-action: none; }
#writing-model svg { display: block; width: 100%; height: 100%; }
.writing-model-fallback { color: var(--coral-strong); font-size: clamp(110px, 20vw, 190px); font-weight: 700; line-height: 1; }
.writing-status { min-height: 18px; margin: 0; color: #607e69; font-size: 11px; font-weight: 700; text-align: center; }
.stroke-play-button { min-height: 44px; padding: 0 16px; border: 1px solid #e5cf79; border-radius: 12px; color: #6e6338; background: #fff4c8; font-size: 12px; font-weight: 800; }
.stroke-play-button:disabled { opacity: .55; cursor: wait; }
.answer-area { padding-top: 13px; }
.reveal-button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 12px; border: 1px solid #afd2b2; border-radius: 15px; color: #376b54; background: #eaf5e7; box-shadow: 0 4px 10px rgba(78, 119, 78, .08); font-size: 14px; font-weight: 800; }
.reveal-button:hover { border-color: #89bc91; background: #e0f0dc; }
.reveal-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.reveal-button > span:last-child { font-size: 18px; }
.skip-answer-button { display: block; min-height: 40px; margin: 6px auto 0; padding: 0 10px; border: 0; border-radius: 9px; color: #829087; background: transparent; font-size: 10px; font-weight: 700; }
.skip-answer-button:hover { color: #60766a; background: rgba(102, 129, 123, .08); }
.reveal-eye { color: #7b9c8c; }
.reading-answer-panel { margin-top: 14px; padding: 16px; border: 1px solid #d5e5d4; border-radius: 17px; background: linear-gradient(135deg, #edf6e8, #fffef8); }
.answer-mode-label { display: block; margin-bottom: 9px; color: #4e715a; font-size: 12px; font-weight: 800; }
.reading-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.reading-answer-row input { width: 100%; min-width: 0; min-height: 52px; padding: 0 14px; border: 1px solid #dfd9c7; border-radius: 12px; color: var(--ink); background: white; font-size: 17px; }
.reading-submit { min-width: 108px; min-height: 52px; padding: 0 15px; border: 0; border-radius: 12px; color: white; background: #39755e; font-size: 13px; font-weight: 800; }
.reading-input-note { display: block; margin-top: 8px; color: #839087; font-size: 10px; }
.reading-mode-toggle { min-height: 42px; margin-top: 8px; padding: 0 9px; border: 0; border-radius: 9px; color: #648078; background: transparent; font-size: 11px; font-weight: 800; }
.reading-mode-toggle:hover { background: rgba(102, 129, 123, .08); }
.reading-feedback { margin: 9px 0 0; color: #a66d48; font-size: 12px; font-weight: 800; }
.reading-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reading-choice { min-height: 52px; padding: 8px 10px; border: 1px solid #e5dec8; border-radius: 12px; color: #435b59; background: white; font-size: 16px; font-weight: 800; }
.reading-choice:nth-child(4n + 1) { border-color: #e7ce76; background: #fff6d8; }
.reading-choice:nth-child(4n + 2) { border-color: #b9d9c3; background: #edf7eb; }
.reading-choice:nth-child(4n + 3) { border-color: #efc8af; background: #fff1e6; }
.reading-choice:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(50, 70, 61, .08); }
.reading-choice.is-choice-wrong { border-color: #dfa58d; color: #a35f49; background: #fff0e8; }

.mistakes-page .subpage-heading { padding-bottom: 18px; }
.mistake-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 21px; background: linear-gradient(110deg,#fff7df,#fff); }
.mistake-summary > div { display: grid; gap: 2px; }
.mistake-summary > div > b { color: #006591; font-size: 27px; }
.mistake-summary > div > small { color: #59636f; font-size: 12px; }
.mistake-summary > span { font-size: 35px; }
.mistake-test-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; padding: 17px 20px; border: 2px solid #f0c16b; border-radius: 17px; background: linear-gradient(110deg,#fff6db,#fff); box-shadow: 0 4px 0 #e8d3a2; }
.mistake-test-card > div { display: grid; gap: 4px; }
.mistake-test-card > div b { color: var(--navy); font-size: 15px; }
.mistake-test-card > div small { color: #627d93; font-size: 11px; line-height: 1.6; }
.mistake-test-card .primary-button { flex: 0 0 auto; }
.mistake-list-note { margin: 12px 2px; color: #627d93; font-size: 11px; line-height: 1.7; }
.mistakes-filters { margin-top: 17px; }
.mistake-entry-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr)); align-items: stretch; gap: 13px; }
.mistake-entry { display: grid; gap: 11px; align-content: start; padding: 15px; border: 2px solid #dfe3e7; border-radius: 18px; background: white; box-shadow: 0 4px 0 #c4c6cf; }
.mistake-entry-main { display: flex; min-width: 0; align-items: center; gap: 11px; }
.mistake-entry-kanji { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border-radius: 16px; color: var(--navy); background: #e4f3ff; font-size: 32px; font-weight: 850; }
.mistake-entry-word { display: grid; min-width: 0; flex: 1; gap: 3px; }
.mistake-entry-word b { overflow: hidden; color: var(--navy); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.mistake-entry-word small { color: #627d93; font-size: 11px; }
.mistake-entry-count { padding: 6px 9px; border-radius: 999px; color: #783200; background: #fff0cc; font-size: 11px; font-weight: 850; white-space: nowrap; }
.mistake-entry-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; color: #627d93; font-size: 10px; }
.mistake-entry .secondary-button { width: 100%; min-height: 43px; }
@media (max-width: 520px) {
  .mistake-test-card { align-items: stretch; flex-direction: column; }
  .mistake-test-card .primary-button { width: 100%; }
  .mistake-entry-list { grid-template-columns: minmax(0,1fr); }
}
.review-page .subpage-heading { padding-bottom: 17px; }
.review-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 0 0 12px; }
.review-summary > div { display: grid; gap: 3px; justify-items: center; padding: 14px 8px; border: 2px solid #dfe3e7; border-radius: 16px; background: white; box-shadow: 0 3px 0 #c4c6cf; }
.review-summary b { color: #006591; font-size: 23px; line-height: 1.1; }
.review-summary span { color: #627d93; font-size: 10px; font-weight: 750; text-align: center; }
.review-note { margin: 10px 2px 16px; color: #627d93; font-size: 11px; line-height: 1.7; }
.review-filter-panel { display: grid; gap: 12px; padding: 16px; }
.review-filter-group { display: grid; gap: 3px; }
.review-filter-group > b { color: var(--navy); font-size: 12px; }
.review-filter-group .dictionary-filters { margin: 4px 0; }
.review-search { margin: 0; }
.review-search .quiet-button { min-height: 42px; }
.review-results-heading { display: flex; align-items: baseline; gap: 8px; margin: 19px 2px 10px; color: #627d93; font-size: 12px; }
.review-results-heading b { color: var(--navy); font-size: 17px; }
.review-kanji-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,410px),1fr)); gap: 13px; align-items: start; }
.review-kanji-card { min-width: 0; padding: 14px; border: 2px solid #dfe3e7; border-radius: 18px; background: white; box-shadow: 0 4px 0 #c4c6cf; }
.review-kanji-head { display: flex; min-width: 0; align-items: center; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid #e8edf0; }
.review-kanji-glyph { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: var(--navy); background: #e4f3ff; font-size: 29px; font-weight: 850; }
.review-kanji-head > div { display: grid; min-width: 0; flex: 1; gap: 3px; }
.review-kanji-head > div b { overflow: hidden; color: var(--navy); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.review-kanji-head > div small { color: #627d93; font-size: 11px; }
.review-kanji-count { padding: 5px 9px; border-radius: 999px; color: #006591; background: #e4f3ff; font-size: 10px; font-weight: 850; white-space: nowrap; }
.review-exercise-list { display: grid; gap: 9px; padding-top: 10px; }
.review-exercise-row { display: grid; min-width: 0; gap: 7px; padding: 10px; border-radius: 13px; background: #f6fafe; }
.review-exercise-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.review-exercise-head small { margin-left: auto; color: #74879a; font-size: 9px; }
.review-status-badge, .review-mode-badge { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.review-status-dont_know { color: #a34128; background: #fff0e8; }
.review-status-almost { color: #8d6110; background: #fff5d9; }
.review-status-got_it { color: #167451; background: #e5f8ed; }
.review-status-unverified { color: #426983; background: #e4f3ff; }
.review-mode-badge { color: #53697c; background: #e8edf1; }
.review-exercise-row p { margin: 0; color: var(--navy); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.review-exercise-row .secondary-button { min-height: 38px; justify-self: start; padding: 0 12px; font-size: 11px; }
@media (max-width: 520px) {
  .review-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .review-summary > div { padding: 11px 6px; }
  .review-kanji-grid { grid-template-columns: minmax(0,1fr); }
  .review-filter-panel { padding: 12px; }
  .review-search { flex-wrap: wrap; }
  .review-search input { flex-basis: 55%; }
  .review-search .secondary-button { margin-left: auto; }
}
.sentence-grade-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; margin: 0 auto 16px; padding: 12px 15px; border: 2px solid #dfe3e7; border-radius: 17px; background: white; }
.sentence-grade-selection > b { color: var(--navy); font-size: 13px; }
.sentence-grade-selection > div { display: flex; gap: 7px; }
.sentence-grade-selection .filter-chip { min-height: 36px; padding: 0 13px; }
.sentence-grade-selection > small { flex-basis: 100%; margin-left: 1px; color: #627d93; font-size: 10px; }
@media (max-width: 520px) {
  .sentence-grade-selection { gap: 8px 11px; padding: 11px; }
  .sentence-grade-selection > b { flex-basis: 100%; }
}
.mistake-launcher { border-color: #f5d9a6; background: linear-gradient(145deg,#fff8e8,#fff); }
.mistake-launcher > span { background: #ffedc2; }

/* Quality pass: clearer actions, compact reference pages, and usable detail dialogs. */
.primary-button { color: var(--navy); }
.secondary-button { color: var(--navy); }
.secondary-button:hover { color: var(--navy); }
.start-button small { color: #173c57; }
.reveal-button, .reveal-button:hover { color: var(--navy); }
.bottom-nav-item small { font-size: 10px; }
.grade-stamp-kicker { color: #526578; font-size: 10px; }
.effort-meter > small { color: #526578; font-size: 10px; }
.dictionary-status, .rescue-mark { color: #465466; font-size: 11px; }
.subpage-heading .eyebrow { color: #526578; }
.dictionary-page { width: min(1320px, calc(100% - 56px)); }
.dictionary-page .subpage-heading { padding: 20px 0 13px; }
.dictionary-page .subpage-heading h1 { margin: 0; font-size: 36px; }
.dictionary-modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(3, 31, 65, .62); overscroll-behavior: contain; }
.dictionary-modal-backdrop .dictionary-detail { position: relative; width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow: auto; margin: 0; padding: clamp(20px, 4vw, 32px); border: 2px solid #c4c6cf; border-radius: 24px; background: white; box-shadow: 0 12px 0 rgba(0, 27, 60, .3), 0 30px 75px rgba(0, 0, 0, .28); overscroll-behavior: contain; }
.content-review-badge { display: inline-flex; min-height: 30px; align-items: center; margin: -4px 0 12px; padding: 0 10px; border-radius: 999px; color: #526578; background: #eaf0f5; font-size: 11px; font-weight: 800; }
.storage-warning { margin: 0 0 20px; padding: 17px; border: 2px solid #b42318; border-radius: 17px; color: #69201b; background: #fff3f1; }
.storage-warning p { margin: 7px 0 12px; font-size: 13px; line-height: 1.7; }
.settings-backup-date { display: block; margin-top: 8px; color: #526578; font-size: 12px; }
.boss-seal-track { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0 7px; color: #173c57; font-size: 12px; font-weight: 800; }
.boss-seal-track > span:first-child { margin-right: 2px; }
.boss-seal-track .boss-seal { display: grid; width: 25px; height: 25px; place-items: center; border: 2px solid #627d93; border-radius: 50%; color: #526578; background: white; font-size: 10px; }
.boss-seal-track .boss-seal.is-open { border-color: #047857; color: #047857; background: #e8fff4; }
.boss-seal-track b { margin-left: auto; }

@media (max-width: 760px) {
  .bottom-nav-item small { font-size: 9px; }
  .dictionary-page { width: min(100% - 30px, 1100px); }
  .dictionary-page .dictionary-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); }
  .dictionary-modal-backdrop { padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .dictionary-modal-backdrop .dictionary-detail { max-height: calc(100dvh - 20px); border-radius: 20px; }
}

@media (max-width: 520px) {
  .bottom-nav-item small { font-size: 8px; }
}
.sentence-choice { font-size: 14px; }
.quiz-mode-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; max-width: 1120px; margin: 24px auto; }
.quiz-mode-card { position: relative; display: grid; min-height: 238px; align-content: center; justify-items: center; gap: 11px; padding: 22px 18px 40px; border: 2px solid #b9d9c3; border-radius: 25px; color: var(--navy); background: #fbfffc; box-shadow: 0 6px 0 #d3e6d8; text-align: center; transition: transform .16s ease, box-shadow .16s ease; }
.quiz-mode-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 #c3ddca; }
.quiz-mode-card:active { transform: translateY(2px); box-shadow: 0 3px 0 #c3ddca; }
.quiz-mode-card:focus-visible { outline: 4px solid #f0b84d; outline-offset: 3px; }
.quiz-mode-sample { color: #202b3b; font-size: clamp(40px,5vw,64px); line-height: 1.05; }
.quiz-mode-card > b { font-size: 21px; }
.quiz-mode-card > small { max-width: 28ch; color: #59636f; font-size: 13px; line-height: 1.6; }
.quiz-mode-count { position: absolute; right: 13px; bottom: 12px; left: 13px; color: #376b54; font-size: 11px; font-weight: 850; }
.sentence-quiz-card { border-color: #f1d9a7; background: #fffdf7; box-shadow: 0 6px 0 #f4e7c7; }
.quiz-hub-note { max-width: 740px; margin: 0 auto; color: #687c73; font-size: 12px; line-height: 1.8; text-align: center; }
.kanji-choice { font-size: 26px; }
.kanji-choice-word { display: flex; align-self: center; align-items: center; justify-content: center; gap: .12em; margin: 2px 0 12px; color: var(--navy); font-size: clamp(52px, 8vw, 78px); font-weight: 900; line-height: 1; letter-spacing: .04em; }
.kanji-choice-blank { display: inline-block; width: .88em; height: .88em; flex: 0 0 auto; border: 4px solid var(--sky); border-radius: .13em; background: var(--sky-pale); box-shadow: inset 0 0 0 4px white; }
.kanji-choice-instruction { align-self: center; margin: 0 0 2px; color: #004666; font-size: 13px; font-weight: 800; }
.dictionary-readings { display: grid; gap: 8px; margin: 14px 0; }
.dictionary-readings > div { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: #edf7eb; }
.dictionary-readings span { color: #3c7156; font-size: 12px; font-weight: 850; }
.dictionary-readings b { color: var(--navy); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.reading-result { display: flex; align-items: center; gap: 11px; margin: 0 0 11px; padding: 11px 14px; border-radius: 13px; }
.reading-result > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: #73a47e; font-weight: 900; }
.reading-result > div { display: grid; gap: 3px; }
.reading-result b { font-size: 13px; }
.reading-result small { font-size: 11px; }
.reading-result-correct { color: #3d704b; background: #e7f4e3; }
.reading-result-review { color: #88613f; background: #fff3d6; }
.reading-result-review > span { color: #fff; background: #c2944c; }
.answer-note { margin: 8px 0; color: #748679; font-size: 11px; font-weight: 700; text-align: center; }
.answer-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 17px; padding: 12px 18px; border: 1px solid #c5dfc7; border-radius: 15px; background: #eaf5e6; animation: answer-reveal .25s ease-out both; }
.answer-caption { grid-row: span 2; color: #5c8a68; font-size: 11px; font-weight: 800; }
.answer-card strong { color: #2f6e5c; font-size: 27px; line-height: 1.25; }
.answer-card p { margin: 0; color: #5f7966; font-size: 11px; line-height: 1.5; }
.auto-outcome { display: grid; gap: 3px; margin-top: 12px; padding: 11px 13px; border: 1px solid #dce8d7; border-radius: 12px; color: #526969; background: #f2f7ef; }
.auto-outcome-label { color: #315e4b; font-size: 13px; font-weight: 850; }
.auto-outcome small { color: #718078; font-size: 10px; line-height: 1.55; }
.auto-outcome-got_it { border-color: #b7dfca; background: #e8f8ef; }
.auto-outcome-almost { border-color: #f1d58b; background: #fff8e5; }
.auto-outcome-almost .auto-outcome-label { color: #89631b; }
.auto-outcome-dont_know { border-color: #edcabb; background: #fff0e9; }
.auto-outcome-dont_know .auto-outcome-label { color: #9b5544; }
.auto-outcome-unverified { border-color: #c9d9e8; background: #eef5fb; }
.auto-outcome-unverified .auto-outcome-label { color: #365f7e; }
.writing-self-rating { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid #c8deee; border-radius: 14px; background: #f3f9ff; }
.writing-self-rating-heading { display: grid; gap: 3px; text-align: center; }
.writing-self-rating-heading b { color: var(--navy); font-size: 13px; }
.writing-self-rating-heading small { color: #758a98; font-size: 10px; }
.writing-self-rating-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.writing-self-rating-option { display: grid; min-width: 0; min-height: 58px; align-content: center; gap: 3px; padding: 7px 5px; border: 1px solid #cbd8e0; border-radius: 11px; color: #40586b; background: white; }
.writing-self-rating-option b { font-size: 12px; }
.writing-self-rating-option small { color: #758a98; font-size: 9px; line-height: 1.3; }
.writing-self-rating-option.rating-got_it.is-selected { border-color: #59a87b; color: #24724c; background: #e9f8ef; box-shadow: inset 0 0 0 1px #59a87b; }
.writing-self-rating-option.rating-almost.is-selected { border-color: #dfb648; color: #886214; background: #fff8e4; box-shadow: inset 0 0 0 1px #dfb648; }
.writing-self-rating-option.rating-dont_know.is-selected { border-color: #d78572; color: #9a4d3c; background: #fff0eb; box-shadow: inset 0 0 0 1px #d78572; }
.auto-continue-button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.auto-continue-button { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; gap: 12px; margin-top: 9px; border: 0; border-radius: 13px; color: white; background: var(--teal); box-shadow: 0 3px 0 var(--teal-dark); font-size: 14px; font-weight: 850; }
.auto-continue-button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-dark); }
.auto-continue-button span { font-size: 18px; }
.hint-panel { display: flex; min-height: 100%; flex-direction: column; padding: 22px 20px 18px; border: 1px solid #dce5d5; border-radius: 20px; background: var(--leaf-pale); }
.hint-panel-heading { display: flex; align-items: center; justify-content: space-between; }
.hint-panel-heading h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.035em; }
.hint-counter { padding: 6px 9px; border-radius: 9px; color: #68827a; background: #e2eadb; font-size: 11px; font-weight: 800; }
.hint-intro { margin: 11px 0 14px; color: #81908a; font-size: 11px; line-height: 1.6; }
.hint-list { display: grid; gap: 8px; }
.hint-empty { display: grid; min-height: 113px; align-content: center; justify-items: center; border: 1px dashed #d3dbcc; border-radius: 13px; color: #91a296; text-align: center; }
.hint-empty span { color: #c6b178; font-size: 22px; }
.hint-empty p { margin: 6px 0 0; font-size: 11px; line-height: 1.7; }
.hint-item { display: flex; gap: 10px; padding: 11px 10px; border: 1px solid rgba(222, 228, 213, .95); border-radius: 12px; background: rgba(255, 254, 250, .75); animation: answer-reveal .2s ease-out both; }
.hint-number { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #64877d; background: #e6efe2; font-size: 11px; font-weight: 800; }
.hint-item small { color: #84918c; font-size: 9px; font-weight: 800; }
.hint-item p { margin: 3px 0 0; color: #536866; font-size: 11px; line-height: 1.65; }
.hint-next-button { display: flex; min-height: 47px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 0 13px; border: 1px solid #d6e1d1; border-radius: 12px; color: #4e786d; background: #fbfcf5; font-size: 12px; font-weight: 800; }
.hint-next-button span { font-size: 19px; }
.hint-all-open { display: grid; min-height: 47px; margin-top: 12px; place-items: center; border-radius: 12px; color: #698379; background: #e6eee0; font-size: 11px; font-weight: 800; }
.effort-meter { margin-top: auto; padding-top: 19px; }
.meter-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #768883; font-size: 10px; }
.meter-row b { color: #52786f; }
.effort-bar, .history-bar { overflow: hidden; height: 7px; border-radius: 99px; background: #dde5d6; }
.effort-bar > div, .history-bar-fill { height: 100%; border-radius: inherit; background: #77aa91; transition: width .25s ease; }
.effort-meter > small { display: block; margin-top: 7px; color: #93a099; font-size: 9px; line-height: 1.5; }

.subpage { width: min(900px, calc(100% - 48px)); }
.subpage-heading { padding: 42px 0 24px; }
.subpage-heading h1 { font-size: 45px; }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); }
.history-summary > div { display: grid; justify-items: center; gap: 3px; padding: 5px; border-right: 1px solid #ecebe3; }
.history-summary > div:last-child { border: 0; }
.history-summary b { color: var(--teal-dark); font-size: 24px; letter-spacing: -.05em; }
.history-summary span { color: #87948f; font-size: 10px; }
.history-section { padding-top: 34px; }
.history-list { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--white); }
.history-row { display: grid; grid-template-columns: 95px minmax(50px, 1fr) 135px 100px 64px; gap: 12px; align-items: center; min-height: 75px; padding: 12px 16px; border-bottom: 1px solid #efeee8; }
.history-row:last-child { border-bottom: 0; }
.history-date, .history-count { display: grid; gap: 4px; }
.history-date b { font-size: 12px; }
.history-date small, .history-count span { color: #8d9a96; font-size: 10px; }
.history-bar { height: 6px; background: #edf0e7; }
.history-count b { font-size: 13px; }
.history-count b small { color: #899692; font-size: 10px; font-weight: 600; }
.small-link { min-height: 40px; color: var(--teal); font-size: 11px; font-weight: 800; }
.history-resume { padding: 0 3px; line-height: 1.35; }
.history-delete-button { width: 100%; }
.history-action-placeholder { min-height: 1px; }
.history-building { justify-self: center; color: #d0ad59; }
.subpage-bottom { display: flex; justify-content: center; padding: 27px 0; }
.settings-card { display: flex; gap: 15px; margin: 0 0 12px; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); }
.settings-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: #4b8377; background: #e9f3e8; font-size: 20px; }
.settings-card h2 { margin: 1px 0 6px; font-size: 15px; }
.settings-card p { max-width: 610px; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.settings-card .secondary-button { min-height: 42px; font-size: 12px; }
.settings-footnote { padding: 13px 3px; color: #8b9891; font-size: 10px; line-height: 1.7; }
.settings-home { margin-top: 10px; }

.result-page { width: min(950px, calc(100% - 48px)); }
.result-heading { padding: 38px 0 24px; text-align: center; }
.result-heading h1 { font-size: 47px; }
.result-heading p { font-size: 14px; }
.result-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 13px; }
.result-main-card, .result-stats-card { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--white); }
.result-building-stage { position: relative; display: grid; min-height: 223px; place-items: center; background: linear-gradient(180deg, #e5f2eb, #f1efd9); }
.result-building-stage::before { position: absolute; bottom: 13%; width: 70%; height: 22%; border-radius: 50%; background: #cedcb9; content: ""; }
.result-building-stage .result-building { z-index: 1; width: 96px; height: 125px; margin-top: 21px; transform: translateY(40px) scale(.8); animation: result-building 3.6s cubic-bezier(.17,.74,.27,1) .08s both; }
.result-building .building-roof { left: -8px; width: 112px; height: 42px; }
.result-building .building-body { top: 35px; left: 8px; width: 80px; height: 89px; gap: 11px; padding: 13px 11px; border-right-width: 8px; border-bottom-width: 8px; }
.result-building .building-body b { min-height: 15px; border-radius: 3px; }
.result-sparkle { position: absolute; z-index: 2; color: #d4b45f; animation: sparkle 1.8s ease-in-out infinite alternate; }
.sparkle-one { top: 24%; left: 29%; font-size: 24px; }
.sparkle-two { top: 39%; right: 25%; color: #81aa94; font-size: 19px; animation-delay: .3s; }
.build-cloud { position: absolute; z-index: 2; right: 29%; bottom: 22%; width: 48px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.65); }
.result-main-copy { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 3px 10px; padding: 17px 21px; }
.result-main-copy .complete-check { grid-row: span 2; }
.result-main-copy b { font-size: 14px; }
.result-main-copy small { color: var(--muted); font-size: 11px; }
.result-stats-card { padding: 19px; }
.result-stats-card h2 { margin: 5px 0 13px; font-size: 18px; }
.result-stat-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #efeee8; color: #778782; font-size: 11px; }
.result-stat-row b { color: var(--ink); font-size: 12px; }
.rating-summary { display: flex; flex-wrap: wrap; gap: 5px; padding: 13px 0 4px; }
.rating-pill { padding: 6px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; }
.got-pill { color: #4e7d5f; background: #eff7e9; }
.almost-pill { color: #a2743d; background: #fff7e5; }
.miss-pill { color: #a46c5c; background: #fff0e9; }
.unverified-pill { color: #365f7e; background: #eef5fb; }
.result-actions { display: flex; justify-content: center; gap: 9px; padding-top: 20px; }
.gentle-note { margin: 15px 0 0; color: #94a09a; font-size: 11px; text-align: center; }

@keyframes building-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes answer-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes buddy-bob { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-5px); } }
@keyframes buddy-robot-signal { 0%, 70%, 100% { opacity: .55; transform: scale(.86); } 82% { opacity: 1; transform: scale(1.12); } }
@keyframes result-building {
  0% { opacity: 0; transform: translateY(45px) scale(.7); }
  58% { opacity: 1; transform: translateY(-5px) scale(1.04); }
  76% { transform: translateY(3px) scale(.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sparkle { from { opacity: .4; transform: scale(.8) rotate(-8deg); } to { opacity: 1; transform: scale(1.12) rotate(8deg); } }
@keyframes stamp-pop { from { transform: scale(.82) rotate(-9deg); } to { transform: scale(1) rotate(0); } }

@media (max-width: 760px) {
  .page, .study-page, .subpage, .result-page { width: min(100% - 30px, 660px); }
  .page { padding-top: 16px; }
  .home-hero { grid-template-columns: 1fr; gap: 7px; padding-top: 25px; }
  .home-copy { padding: 8px 0 12px; }
  .home-copy h1 { font-size: 43px; }
  .home-town .town-scene { height: clamp(185px, 46vw, 270px); border-radius: 24px; }
  .home-quick-stats { margin-top: 18px; }
  .grade-stamp-grid { grid-template-columns: 1fr; gap: 10px; }
  .stamp-kanji { font-size: 22px; }
  .start-area { padding-top: 10px; }
  .home-start-priority { margin-top: 8px; padding: 13px; border-radius: 18px; }
  .question-layout { grid-template-columns: 1fr; gap: 13px; }
  .question-card { min-height: 205px; }
  .hint-panel { min-height: auto; }
  .effort-meter { margin-top: 20px; }
  .result-layout { grid-template-columns: 1fr; }
  .boss-exam-categories { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .boss-exam-score-grid { grid-template-columns: 1fr; }
  .boss-result-report { padding: 15px; }
}
@media (max-width: 520px) {
  .page, .study-page, .subpage, .result-page { width: calc(100% - 24px); }
  .topbar-profile { gap: 5px; padding-right: 0; font-size: 12px; }
  .home-copy h1, .welcome-block h1 { font-size: 39px; }
  .home-footer-cards { grid-template-columns: 1fr; }
  .complete-card { align-items: flex-start; flex-direction: column; }
  .complete-card .primary-button, .complete-card .secondary-button { width: 100%; }
  .profile-card-wrap { grid-template-columns: 1fr; }
  .profile-card-tools { justify-content: flex-end; padding: 0 10px 7px; }
  .profile-card { min-height: 70px; padding-bottom: 5px; }
  .study-topbar .quiet-button { padding: 0 5px; font-size: 12px; }
  .study-progress-label b { font-size: 18px; }
  .study-page { padding-top: 9px; }
  .study-progress { margin: 4px 0 18px; }
  .question-card { min-height: 190px; padding: 19px 17px; }
  .question-card h1 { font-size: 28px; }
  .writing-prompt { font-size: 25px !important; }
  .rating-options { gap: 5px; }
  .rating-button { min-height: 58px; }
  .rating-button span { font-size: 12px; }
  .rating-button small { font-size: 8px; }
  .reading-answer-panel { padding: 12px; }
  .reading-answer-row { grid-template-columns: 1fr; }
  .reading-submit { width: 100%; }
  .writing-comparison { grid-template-columns: 1fr; gap: 10px; }
  #writing-pad, #writing-model { width: min(100%, 250px); }
  .history-summary { gap: 2px; padding: 11px 5px; }
  .history-summary b { font-size: 21px; }
  .history-summary span { font-size: 9px; }
  .history-row { grid-template-columns: 54px minmax(22px, 1fr) 54px 44px 42px; gap: 4px; padding: 10px 8px; }
  .history-date b { font-size: 10px; }
  .history-date small, .history-count span { font-size: 8px; }
  .history-count b { font-size: 11px; }
  .history-resume { padding: 0 1px; font-size: 9px; overflow-wrap: anywhere; }
  .history-delete-button { min-height: 40px; padding: 0 2px; border-radius: 11px; font-size: 10px; }
  .result-heading h1, .subpage-heading h1 { font-size: 39px; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions button { width: 100%; }
  .settings-card { gap: 10px; padding: 15px; }
  .settings-icon { width: 36px; height: 36px; }
  .home-bottom-links { align-items: flex-start; flex-direction: column; gap: 3px; }
}
@media (max-height: 720px) and (min-width: 761px) {
  .study-page { padding-top: 10px; }
  .study-progress { margin-bottom: 16px; }
  .question-card { min-height: 205px; }
  .hint-panel { padding-top: 16px; padding-bottom: 14px; }
  .hint-intro { margin: 8px 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Kinetic Quest: Stitch visual system adapted to the existing no-build app. */
:root {
  --navy: #031f41;
  --navy-shadow: #001b3c;
  --sky: #0ea5e9;
  --sky-bright: #39b8fd;
  --lime: #10b981;
  --slate-border: #c4c6cf;
}
button:focus-visible, input:focus-visible, .file-button:focus-within { outline-color: rgba(14, 165, 233, .72); }
body { background-image: radial-gradient(rgba(3, 31, 65, .065) .8px, transparent .8px); }
#app { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.page { padding-bottom: 38px; }
.topbar, .study-topbar { border: 2px solid #1d3557; background: var(--navy); box-shadow: 0 5px 0 var(--navy-shadow), 0 10px 18px rgba(3, 31, 65, .13); }
.topbar { min-height: 64px; }
.brand-mark span { border-color: rgba(255,255,255,.28); }
.brand-mark span:first-child { background: #f59e0b; }
.brand-mark span:nth-child(2) { background: #39b8fd; }
.brand-mark span:last-child { background: #f97316; }
.topbar-coins { display: inline-flex; min-height: 34px; align-items: center; padding: 0 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #ffebad; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 800; white-space: nowrap; }
.quiet-button { color: #526578; }
.quiet-button:hover, .text-button:hover, .home-bottom-links button:hover { color: var(--navy); background: rgba(14,165,233,.1); }
.topbar .topbar-back, .topbar .topbar-back:hover { color: #fff; }
.primary-button, .secondary-button { min-height: 52px; border-radius: 14px; font-weight: 800; }
.primary-button { border: 2px solid #c2410c; background: linear-gradient(180deg, #ff842b, #f97316); box-shadow: 0 5px 0 #783200, inset 0 2px 0 rgba(255,255,255,.38); }
.primary-button:hover { background: linear-gradient(180deg, #ff9342, #f97316); box-shadow: 0 6px 0 #783200, inset 0 2px 0 rgba(255,255,255,.42); }
.secondary-button { border: 2px solid #004c6e; background: var(--sky); box-shadow: 0 4px 0 #00334d; }
.secondary-button:hover { background: #159bd8; }
.primary-button:disabled, .secondary-button:disabled, .feature-launcher:disabled { opacity: .54; filter: saturate(.55); cursor: not-allowed; transform: none; box-shadow: none; }
.card, .empty-card, .local-tools, .profile-card-wrap { border: 2px solid #dfe3e7; border-radius: 20px; box-shadow: 0 5px 0 var(--slate-border); }
.profile-card-wrap { background: white; }
.profile-avatar { border: 2px solid #d5e3ff; color: var(--navy); background: #e4f3ff; }
.profile-card:hover { background: #eff8ff; }
.selected-label { color: #0077aa; }
.grade-chip { color: var(--navy); background: #c9e6ff; }
.welcome-block h1, .home-copy h1, .subpage-heading h1, .result-heading h1 { font-family: "Rubik", "Quicksand", sans-serif; font-weight: 900; }
.eyebrow { color: #627d93; }
.home-copy h1 em, .welcome-block h1 em, .subpage-heading h1 em, .result-heading h1 em { color: #006591; }
.home-quick-stats i { background: #c4c6cf; }
.grade-stamp-card, .grade-stamp-card:nth-child(2), .grade-stamp-card:nth-child(3) { --stamp-bg: #d5f4e7; --stamp-ink: #047857; border: 2px solid #dfe3e7; border-radius: 19px; background: linear-gradient(145deg, #fff, #f0f8ff); box-shadow: 0 5px 0 #c4c6cf; }
.grade-stamp-card:nth-child(2) { --stamp-bg: #d5e3ff; --stamp-ink: #1d4ed8; }
.grade-stamp-card:nth-child(3) { --stamp-bg: #ffebd6; --stamp-ink: #c2410c; }
.grade-stamp-card.is-current-grade { border-color: #39b8fd; box-shadow: 0 5px 0 #0074a6; }
.grade-stamp-card.is-complete { border-color: #f59e0b; }
.grade-stamp-progress { background: #e4e9ed; }
.grade-stamp-progress span { background: linear-gradient(90deg, #0ea5e9, #10b981); }
.stamp-slot { border-color: #c4c6cf; color: #59636f; }
.stamp-slot.is-partial { border-color: #38bdf8; background: #e4f3ff; }
.stamp-slot.is-stamped { border-width: 2px; }
.stamp-slot.is-stamped::after { border-color: currentColor; }
.stamp-mode { border-color: #d6dade; color: #68727e; }
.town-scene { border: 3px solid white; box-shadow: 0 6px 0 #94a3b8, 0 12px 25px rgba(3,31,65,.14); background: linear-gradient(180deg, #c5eaff 0%, #e4f3ff 53%, #d9f0e4 100%); }
.town-scene::before { background: #b6dcf5; }
.town-sun { background: #fbbf24; box-shadow: 0 0 0 10px rgba(251,191,36,.18); }
.hill-a { background: #98cdb5; }
.hill-b { background: #70b78d; }
.town-ground { border-color: rgba(224,175,93,.85); background: #e7c477; }
.town-path { border-color: rgba(3,31,65,.12); background: #f5cf79; }
.town-seed { color: #004666; }
.town-seed span { border: 2px solid #004666; color: #c2410c; background: #fbbf24; }
.town-buddy-callout { border: 2px solid var(--navy); color: var(--navy); background: white; box-shadow: 0 3px 0 #94a3b8; }
.town-scene.theme-sunset { background: linear-gradient(180deg,#fac6a3 0%,#ffe8ba 54%,#d8efcf 100%); }
.town-scene.theme-night { background: linear-gradient(180deg,#17345b 0%,#405b86 56%,#658d88 100%); }
.town-scene.theme-night .town-cloud { background: rgba(231,241,255,.7); }
.town-scene.theme-night .town-seed small { color: var(--navy); }
.town-decoration { position: absolute; z-index: 3; bottom: 28%; font-size: 25px; filter: drop-shadow(0 3px 0 rgba(3,31,65,.16)); }
.decoration-0 { left: 22%; }
.decoration-1 { right: 28%; bottom: 24%; }
.decoration-2 { left: 58%; bottom: 30%; }
.decoration-3 { right: 11%; bottom: 23%; }
.start-button { min-height: 82px; border-radius: 17px; }
.start-icon { color: var(--navy); background: rgba(255,255,255,.72); }
.start-button small { color: rgba(255,255,255,.9); }
.complete-card { border: 2px solid #a7e2c8; border-radius: 17px; background: #e8fff4; box-shadow: 0 5px 0 #99cbb3; }
.complete-check { background: #10b981; }
.mini-card { border: 2px solid #dfe3e7; border-radius: 17px; box-shadow: 0 4px 0 #c4c6cf; }
.mini-card:hover { border-color: #39b8fd; }
.mini-card-icon { color: #004666; background: #c9e6ff; }
.study-topbar { border-radius: 19px; box-shadow: 0 5px 0 #001b3c; }
.study-progress { border: 2px solid #1d3557; background: #dfe3e7; }
.study-progress > div { background: linear-gradient(90deg, #0ea5e9, #10b981, #f59e0b); }
.question-kicker span:first-child { color: #006591; }
.question-dot { background: #39b8fd; }
.question-card { border: 3px solid #dfe3e7; border-radius: 26px; background: radial-gradient(ellipse at 98% 8%, rgba(57,184,253,.17), transparent 45%), linear-gradient(145deg,#fff,#f0f8ff); box-shadow: 0 6px 0 #c4c6cf; }
.question-card::after { color: #f59e0b; }
.question-label { color: #004666; background: #c9e6ff; }
.vocab-tag { color: #004666; background: #e4f3ff; }
.writing-word-blank { color: #004666; border-color: #0b8dc2; background: #fff; }
.question-card .writing-vocab-tag { display: inline-flex; align-items: center; gap: .24em; padding: 8px 12px; color: #004666; font-size: clamp(16px, 2vw, 20px); }
.write-practice, .reading-answer-panel { border: 2px solid #c4dff0; border-radius: 18px; background: linear-gradient(135deg,#e4f3ff,#fff 74%); box-shadow: 0 4px 0 #c4c6cf; }
.writing-status { color: #006591; }
#writing-pad, #writing-model { border: 2px solid #c4c6cf; border-radius: 14px; background-color: white; background-image: linear-gradient(rgba(3,31,65,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(3,31,65,.18) 1px, transparent 1px); }
.stroke-play-button { border: 2px solid #d97706; color: #783200; background: #fef3c7; box-shadow: 0 3px 0 #b45309; }
.reveal-button { border: 2px solid #047857; color: white; background: #10b981; box-shadow: 0 5px 0 #047857; }
.reveal-button:hover { border-color: #047857; color: white; background: #059669; }
.reveal-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #047857; }
.reading-answer-row input { border: 2px solid #c4c6cf; }
.reading-answer-row input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 4px rgba(14,165,233,.18); }
.reading-submit { border: 2px solid #004c6e; background: #006591; box-shadow: 0 4px 0 #00334d; }
.reading-choice { border: 2px solid #c4c6cf; border-radius: 14px; color: var(--navy); box-shadow: 0 3px 0 #d6dade; }
.reading-choice:nth-child(4n + 1) { border-color: #f59e0b; background: #fff7df; }
.reading-choice:nth-child(4n + 2) { border-color: #39b8fd; background: #e4f3ff; }
.reading-choice:nth-child(4n + 3) { border-color: #10b981; background: #e8fff4; }
.reading-choice:nth-child(4n) { border-color: #f97316; background: #fff0e6; }
.reading-choice:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #94a3b8; }
.reading-result-correct, .rating-got { color: #047857; border-color: #a7e2c8; background: #e8fff4; }
.reading-result-correct > span { background: #10b981; }
.reading-result-review, .rating-almost { color: #8a5a00; border-color: #f4d27b; background: #fff7df; }
.reading-result-review > span { background: #f59e0b; }
.answer-card { border: 2px solid #a7e2c8; background: #e8fff4; box-shadow: 0 4px 0 #99cbb3; }
.answer-card strong { color: #047857; }
.rating-miss { color: #b42318; border-color: #ffc9c4; background: #fff0ee; }
.hint-panel { border: 2px solid #c4dff0; border-radius: 21px; background: #eaf6ff; box-shadow: 0 5px 0 #c4c6cf; }

/* Keep the question layout steady; show every answer in the same review dialog. */
.answer-review-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgba(3, 31, 65, .64); overscroll-behavior: contain; }
.answer-review-modal { display: grid; width: min(760px, 100%); max-height: calc(100dvh - 36px); gap: 12px; overflow: auto; padding: clamp(18px, 3vw, 28px); border: 3px solid #c4dff0; border-radius: 25px; background: linear-gradient(145deg, #fff, #f0f8ff); box-shadow: 0 8px 0 #9fa8b7, 0 28px 70px rgba(0, 0, 0, .28); overscroll-behavior: contain; }
.answer-review-heading { display: grid; gap: 2px; }
.answer-review-heading .eyebrow { margin: 0; font-size: 10px; letter-spacing: .15em; }
.answer-review-heading > b { color: var(--navy); font-size: 22px; }
.answer-review-modal .reading-result { margin: 0; }
.answer-review-modal .answer-card { margin: 0; }
.answer-review-modal .auto-outcome { margin: 0; }
.answer-review-modal .writing-self-rating { margin: 0; }
.writing-review-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.writing-review-comparison figure { display: grid; min-width: 0; justify-items: center; gap: 6px; margin: 0; }
.writing-review-comparison figcaption { color: #526578; font-size: 11px; font-weight: 850; }
#writing-answer-copy, #writing-model { width: min(100%, 220px); aspect-ratio: 1; }
#writing-answer-copy { display: block; border: 2px solid #c4c6cf; border-radius: 14px; background-color: white; background-image: linear-gradient(rgba(3,31,65,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(3,31,65,.18) 1px, transparent 1px); background-size: 50% 50%; }
.writing-review-status { margin: -4px 0 0; color: #627d93; font-size: 11px; text-align: center; }
.answer-review-modal .stroke-play-button { justify-self: center; }
.answer-review-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.answer-review-actions:not(.is-writing) { grid-template-columns: 1fr; }
.answer-review-actions .auto-continue-button { margin: 0; min-height: 54px; }
.answer-review-rewrite { min-height: 44px; padding: 0 10px; white-space: nowrap; }
@media (max-width: 600px) {
  .answer-review-backdrop { align-items: end; padding: 0; }
  .answer-review-modal { width: 100%; max-height: min(91dvh, 860px); gap: 10px; padding: 17px 15px calc(16px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border-bottom: 0; }
  .answer-review-heading > b { font-size: 19px; }
  .answer-review-modal .answer-card { padding: 10px 12px; }
  .answer-review-modal .answer-card strong { font-size: 24px; }
  .writing-review-comparison { gap: 8px; }
  .writing-review-comparison figcaption { font-size: 10px; }
  #writing-answer-copy, #writing-model { width: min(100%, 38vw, 175px); }
  .writing-review-status { font-size: 10px; }
  .answer-review-actions { grid-template-columns: 1fr; }
  .answer-review-rewrite { order: 2; }
}
.hint-counter, .hint-number { color: #004666; background: #c9e6ff; }
.hint-empty { border-color: #9ec8e1; }
.hint-next-button { border: 2px solid #006591; color: #004666; background: white; box-shadow: 0 4px 0 #94a3b8; }
.hint-next-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #94a3b8; }

/* Keep reading and writing questions compact; open the handwriting area on demand. */
.question-layout { align-items: start; }
.hint-panel { align-self: start; min-height: 0; position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.write-practice-launch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; margin-top: 13px; padding: 16px 18px; border: 2px solid #c4dff0; border-radius: 18px; background: linear-gradient(135deg,#e4f3ff,#fff 74%); box-shadow: 0 4px 0 #c4c6cf; }
.write-practice-launch-copy { display: grid; gap: 4px; }
.write-practice-launch-copy b { color: var(--navy); font-size: 15px; }
.write-practice-launch-copy small, .write-practice-saved { color: #6b8290; font-size: 12px; line-height: 1.5; }
.write-practice-open { min-height: 52px; padding-inline: 18px; white-space: nowrap; }
.write-practice-saved { grid-column: 1 / -1; color: #08734e; font-weight: 750; }
.writing-practice-backdrop { position: fixed; z-index: 31; inset: 0; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgba(3, 31, 65, .64); overscroll-behavior: contain; }
.writing-practice-modal { display: grid; width: min(620px, 100%); max-height: calc(100dvh - 36px); justify-items: center; gap: 12px; overflow: auto; padding: clamp(18px, 3vw, 28px); border: 3px solid #c4dff0; border-radius: 25px; background: linear-gradient(145deg,#fff,#f0f8ff); box-shadow: 0 8px 0 #9fa8b7, 0 28px 70px rgba(0,0,0,.28); overscroll-behavior: contain; }
.writing-practice-modal-heading { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; }
.writing-practice-modal-heading > div { display: grid; gap: 4px; }
.writing-practice-modal-heading .eyebrow { margin: 0; font-size: 10px; letter-spacing: .15em; }
.writing-practice-modal-heading b { color: var(--navy); font-size: 20px; }
.writing-practice-modal-heading small { color: #627d93; font-size: 12px; }
.writing-practice-close { min-height: 42px; padding: 0 12px; border-radius: 11px; background: #e4f3ff; }
.writing-practice-modal #writing-pad { width: min(100%, 380px, calc(100dvh - 280px)); border: 2px solid #c4c6cf; border-radius: 16px; background-color: white; background-image: linear-gradient(rgba(3,31,65,.18) 1px, transparent 1px), linear-gradient(90deg,rgba(3,31,65,.18) 1px,transparent 1px); background-size: 50% 50%; }
.writing-practice-modal .writing-status { min-height: 20px; }
.writing-practice-modal-actions { display: grid; width: 100%; grid-template-columns: auto minmax(0,1fr); gap: 10px; }
.writing-practice-modal-actions .primary-button, .writing-practice-modal-actions .secondary-button { min-height: 52px; }
.writing-practice-modal .writing-reveal-button:disabled { opacity: .48; cursor: not-allowed; }
@media (max-width: 760px) {
  .hint-panel { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
  .write-practice-launch { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .write-practice-open { width: 100%; }
  .write-practice-saved { grid-column: auto; }
  .writing-practice-backdrop { align-items: end; padding: 0; }
  .writing-practice-modal { width: 100%; max-height: min(94dvh, 820px); gap: 9px; padding: 16px 15px calc(16px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border-bottom: 0; }
  .writing-practice-modal-heading b { font-size: 17px; }
  .writing-practice-modal-heading small { font-size: 11px; }
  .writing-practice-modal #writing-pad { width: min(100%, 360px, calc(100dvh - 260px)); }
  .writing-practice-modal-actions { grid-template-columns: 1fr; }
}
.effort-bar, .history-bar { background: #d6dade; }
.effort-bar > div, .history-bar-fill { background: linear-gradient(90deg,#0ea5e9,#10b981); }
.result-main-card, .result-stats-card, .history-summary, .history-list, .settings-card { border: 2px solid #dfe3e7; border-radius: 19px; box-shadow: 0 5px 0 #c4c6cf; }
.result-building-stage { background: linear-gradient(180deg,#c5eaff,#e4f3ff 60%,#d9f0e4); }
.result-building-stage::before { background: #98cdb5; }
.result-main-copy .complete-check { background: #10b981; }
.history-summary b { color: #006591; }
.settings-icon { color: #004666; background: #c9e6ff; }
.bottom-nav { position: fixed; z-index: 9; right: 50%; bottom: max(8px, env(safe-area-inset-bottom)); display: flex; width: min(850px, calc(100% - 24px)); justify-content: space-around; gap: 4px; padding: 7px; border: 2px solid #1d3557; border-radius: 20px; background: var(--navy); box-shadow: 0 6px 0 #001b3c, 0 10px 24px rgba(3,31,65,.2); transform: translateX(50%); }
.bottom-nav-item { display: grid; min-width: 55px; min-height: 58px; flex: 1; align-content: center; justify-items: center; gap: 2px; border: 0; border-radius: 13px; color: #d7e5f7; background: transparent; }
.bottom-nav-item span { font-size: 20px; font-weight: 900; line-height: 1; }
.bottom-nav-item small { font-size: 9px; font-weight: 800; }
.bottom-nav-item.is-active { color: var(--navy); background: #c9e6ff; box-shadow: inset 0 -3px 0 #39b8fd; }
.bottom-nav-item:active { transform: translateY(2px); }
.feature-launchers { padding: 2px 0 30px; }
.feature-launcher-grid, .option-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.feature-launcher, .option-card { display: grid; min-height: 118px; align-content: center; justify-items: center; gap: 6px; padding: 14px 10px; border: 2px solid #dfe3e7; border-radius: 18px; color: var(--navy); background: white; box-shadow: 0 5px 0 #c4c6cf; text-align: center; transition: transform .16s ease, box-shadow .16s ease; }
.feature-launcher:hover, .option-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #94a3b8; }
.feature-launcher:active, .option-card:active { transform: translateY(3px); box-shadow: 0 2px 0 #94a3b8; }
.feature-launcher > span, .option-card > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #e4f3ff; font-size: 24px; }
.feature-launcher b, .option-card b { font-size: 13px; }
.feature-launcher small, .option-card small { color: #59636f; font-size: 10px; line-height: 1.4; }
.sentence-launcher { border-color: #f59e0b; background: #fff7df; }
.sentence-launcher > span { background: #ffebad; }
.boss-launcher { border-color: #f97316; background: #fff0e6; }
.bottom-nav ~ .notice { bottom: 95px; }
.notice { bottom: max(88px, calc(env(safe-area-inset-bottom) + 80px)); }
.stampbook-badge-link { display: flex; justify-content: center; margin: -5px 0 17px; }
.stampbook-badge-link .secondary-button { min-height: 52px; padding: 0 25px; font-size: 15px; }
.collection-grid { display: grid; gap: 17px; }
.collection-grade-card, .calendar-card, .calendar-summary, .dictionary-detail, .rescue-hero, .rescue-row, .town-preview-card, .buddy-room-card, .treasure-summary, .achievement-card, .boss-card { border: 2px solid #dfe3e7; border-radius: 20px; background: white; box-shadow: 0 5px 0 #c4c6cf; }
.collection-grade-card { padding: 19px; }
.collection-count { color: #006591; font-size: 14px; }
.collection-grade-card .stamp-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 9px; }
.collection-grade-card .stamp-slot { max-width: 76px; justify-self: center; width: 100%; }
.calendar-summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 15px; padding: 16px 19px; }
.year-adventure-card { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; align-items: center; margin-bottom: 14px; padding: 15px 18px; }
.year-adventure-card > div:first-child { display: grid; gap: 4px; }
.year-adventure-card > div:first-child b { color: var(--navy); font-size: 17px; }
.year-adventure-card > div:first-child small { color: #627d93; font-size: 11px; }
.year-adventure-mark { display: grid; width: 52px; height: 52px; place-items: center; border: 3px solid #f59e0b; border-radius: 50%; color: #783200; background: #fff7df; font-size: 12px; font-weight: 900; }
.year-adventure-track { position: relative; overflow: visible; grid-column: 1 / -1; height: 12px; border: 2px solid var(--navy); border-radius: 999px; background: #dfe3e7; }
.year-adventure-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#0ea5e9,#10b981); }
.year-adventure-track > i { position: absolute; top: 50%; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px #783200; transform: translate(-50%,-50%); }
.calendar-summary > div:first-child { display: grid; gap: 3px; }
.calendar-summary > div:first-child b { color: #006591; font-size: 27px; }
.calendar-summary > div:first-child small { color: #59636f; font-size: 11px; }
.calendar-sparkle { grid-column: 2; grid-row: 1; color: #f59e0b; font-size: 27px; }
.calendar-month-switch { display: flex; grid-column: 1 / -1; grid-row: 2; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #dfe3e7; }
.calendar-month-switch .quiet-button { min-width: 46px; }
.calendar-card { padding: 14px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }
.calendar-weekdays { margin-bottom: 8px; color: #59636f; text-align: center; }
.calendar-weekdays span { padding: 5px 0; font-size: 11px; font-weight: 800; }
.calendar-day { position: relative; display: grid; min-height: 54px; align-content: center; justify-items: center; border: 1px solid #dfe3e7; border-radius: 13px; color: #59636f; background: #f6fafe; }
.calendar-day b { font-size: 13px; }
.calendar-day small { position: absolute; top: 1px; right: 5px; color: #f59e0b; font-size: 12px; }
.calendar-day.is-studied { border-color: #10b981; color: #047857; background: #e8fff4; }
.calendar-day.is-today { outline: 2px solid #0ea5e9; outline-offset: 1px; }
.calendar-day.is-empty { border-color: transparent; background: transparent; }
.calendar-footnote, .shop-note, .local-setting-note { color: #627d93; font-size: 11px; line-height: 1.7; }
.dictionary-search { display: flex; gap: 9px; align-items: center; margin-bottom: 13px; padding: 8px; }
.dictionary-search > span { padding-left: 8px; color: #006591; font-size: 24px; }
.dictionary-search input { min-width: 0; min-height: 48px; flex: 1; border: 0; outline: none; background: transparent; }
.dictionary-search .secondary-button { min-height: 44px; padding: 0 13px; }
.dictionary-filters, .goal-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.filter-chip { min-height: 43px; padding: 0 15px; border: 2px solid #c4c6cf; border-radius: 999px; color: #526578; background: white; font-size: 12px; font-weight: 800; }
.filter-chip.is-active { border-color: #006591; color: white; background: #006591; box-shadow: 0 3px 0 #004666; }
.dictionary-list, .rescue-list, .achievement-list { display: grid; gap: 10px; }
.dictionary-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); align-items: stretch; }
.dictionary-entry { display: grid; min-width: 0; gap: 10px; }
.dictionary-entry.is-expanded { grid-column: 1 / -1; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); align-items: stretch; }
.dictionary-entry.is-expanded .dictionary-detail { min-width: 0; margin: 0; }
.dictionary-kanji-card, .rescue-row { display: flex; width: 100%; min-width: 0; min-height: 78px; align-items: center; gap: 12px; padding: 10px 14px; border: 2px solid #dfe3e7; border-radius: 17px; color: var(--navy); background: white; box-shadow: 0 4px 0 #c4c6cf; text-align: left; }
.dictionary-kanji-card.is-selected { border-color: #0ea5e9; background: #e4f3ff; }
.dictionary-kanji { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; border-radius: 15px; color: var(--navy); background: #e4f3ff; font-size: 29px; font-weight: 800; }
.dictionary-kanji-info, .rescue-row > div { display: grid; min-width: 0; flex: 1; gap: 4px; }
.dictionary-kanji-info small, .rescue-row small { color: #627d93; font-size: 11px; }
.dictionary-status, .rescue-mark { padding: 6px 9px; border-radius: 999px; color: #59636f; background: #eaeef2; font-size: 10px; font-weight: 800; white-space: nowrap; }
.dictionary-status.is-mastered { color: #047857; background: #d5f4e7; }
.dictionary-detail { position: relative; margin: 14px 0; padding: 19px; }
.dictionary-close { position: absolute; top: 10px; right: 10px; }
.dictionary-detail-title { display: flex; align-items: center; gap: 15px; margin: 10px 0; }
.dictionary-detail-title > strong { color: #006591; font-size: 58px; line-height: 1; }
.dictionary-detail-title > div { display: grid; gap: 4px; }
.dictionary-detail-title > div b { font-size: 19px; }
.dictionary-detail-title > div small { color: #627d93; }
.dictionary-detail > p { color: #59636f; font-size: 13px; line-height: 1.7; }
.dictionary-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.rescue-hero { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 13px; align-items: center; margin-bottom: 22px; padding: 20px; background: linear-gradient(135deg,#e4f3ff,#fff); }
.rescue-hero h2 { margin: 5px 0; font-size: 21px; }
.rescue-hero p { margin: 0; color: #59636f; font-size: 12px; }
.rescue-hero > button { grid-column: 1 / -1; }
.rescue-crystal { grid-column: 2; grid-row: 1; font-size: 48px; }
.rescue-row { box-shadow: 0 3px 0 #c4c6cf; }
.rescue-list-section { margin-top: 28px; }
.town-preview-card { overflow: hidden; padding: 12px; }
.town-preview-card .town-scene { height: clamp(210px,38vw,360px); }
.town-preview-meta { display: flex; justify-content: space-between; padding: 12px 6px 3px; color: #006591; }
.town-preview-meta small { color: #59636f; }
.town-options { margin-top: 26px; }
.option-card.is-selected { border-color: #0ea5e9; background: #e4f3ff; box-shadow: 0 5px 0 #006591; }
.option-card > span { color: #004666; }
.buddy-room-card { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; padding: 18px; background: linear-gradient(135deg,#e4f3ff,#fff); }
.buddy-room-stage { position: relative; display: grid; min-height: 185px; place-items: center; border-radius: 18px; background: #c9e6ff; }
.buddy-room-stage .buddy-svg { width: 142px; height: 142px; }
.buddy-room-accessory { position: absolute; top: 14px; left: 50%; right: auto; transform: translateX(18px) rotate(10deg); font-size: 27px; }
.buddy-room-copy h2 { margin: 5px 0; font-size: 23px; }
.buddy-room-copy p { color: #59636f; font-size: 11px; line-height: 1.6; }
.coin-badge { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border: 2px solid #d97706; border-radius: 999px; color: #783200; background: #fef3c7; font-size: 13px; font-weight: 900; }
.treasure-summary { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: linear-gradient(135deg,#fff7df,#fff); }
.treasure-stamp-link { display: flex; justify-content: flex-start; margin: -5px 0 17px; }
.treasure-grade-summary { margin: 0 0 19px; }
.treasure-grade-summary > .section-heading { margin: 0 0 10px; }
.treasure-grade-summary > .section-heading h2 { margin: 2px 0; }
.treasure-grade-summary > .section-heading p { margin: 3px 0 0; color: #627d93; font-size: 12px; }
.treasure-grade-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.treasure-grade-progress { display: grid; min-width: 0; gap: 9px; padding: 15px; border: 2px solid #dfe3e7; border-radius: 18px; color: var(--navy); background: white; box-shadow: 0 4px 0 #c4c6cf; text-align: left; }
.treasure-grade-progress.is-current { border-color: #e9c96f; background: linear-gradient(135deg,#fff7df,#fff); }
.treasure-grade-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 14px; font-weight: 850; }
.treasure-grade-label small { color: #98752c; font-size: 9px; white-space: nowrap; }
.treasure-grade-progress > strong { color: #006591; font-size: 25px; line-height: 1; }
.treasure-grade-progress > strong small { color: #627d93; font-size: 12px; }
.treasure-grade-track { overflow: hidden; height: 9px; border-radius: 999px; background: #e7edf1; }
.treasure-grade-track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#0ea5e9,#10b981); }
.treasure-grade-link { color: #006591; font-size: 10px; font-weight: 850; }
.treasure-summary h2 { margin: 5px 0; }
.treasure-summary b { display: block; color: #006591; font-size: 29px; }
.treasure-summary small { color: #627d93; }
.treasure-medal { font-size: 66px; filter: drop-shadow(0 5px 0 rgba(3,31,65,.14)); }
.badge-collection-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 18px 22px; background: linear-gradient(120deg,#fff7df,#fff); }
.badge-collection-summary h2 { margin: 4px 0; font-size: 21px; }
.badge-collection-summary p { margin: 0; color: #627d93; font-size: 12px; }
.badge-collection-summary > b { display: flex; align-items: baseline; gap: 4px; color: #496777; font-size: 16px; white-space: nowrap; }
.badge-collection-summary > b strong { color: #006591; font-size: 36px; }
.badge-collection-summary > b small { color: #627d93; font-size: 11px; }
.achievement-section { margin-top: 27px; }
.achievement-group-count { color: #006591; font-size: 13px; }
.achievement-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.achievement-card { display: flex; min-width: 0; min-height: 184px; flex-direction: column; align-items: stretch; gap: 8px; padding: 13px; box-shadow: 0 3px 0 #c4c6cf; }
.achievement-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.achievement-card .badge-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: #eaeef2; font-size: 25px; filter: grayscale(1); }
.achievement-card .badge-status { color: #718395; font-size: 10px; white-space: nowrap; }
.achievement-title { color: var(--navy); font-size: 14px; line-height: 1.35; }
.achievement-description { min-height: 30px; color: #627d93; font-size: 10px; line-height: 1.5; }
.badge-progress { overflow: hidden; height: 9px; margin-top: auto; border-radius: 999px; background: #e7edf1; }
.badge-progress > span { display: block; height: 100%; border-radius: inherit; background: #b9c6d1; }
.badge-progress-copy { color: #718395; font-size: 10px; font-weight: 800; text-align: right; }
.achievement-card.is-earned { border-color: #f59e0b; background: #fffaf0; }
.achievement-card.is-earned .badge-icon { background: #ffebad; filter: none; }
.achievement-card.is-earned .badge-status { color: #c2410c; }
.achievement-card.is-earned .badge-progress > span { background: linear-gradient(90deg,#f59e0b,#f97316); }
.boss-config-card { margin-bottom: 18px; padding: 20px; background: linear-gradient(145deg,#fff,#f5faff); }
.boss-config-group { display: grid; gap: 11px; }
.boss-config-group + .boss-config-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid #dfe8ef; }
.boss-config-group h2 { margin: 3px 0 0; color: var(--navy); font-size: 18px; }
.boss-grade-options { display: flex; flex-wrap: wrap; gap: 9px; }
.boss-mode-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.boss-mode-option { display: grid; grid-template-columns: 38px minmax(0,1fr); grid-template-rows: auto auto; gap: 4px 10px; align-items: center; min-height: 82px; padding: 12px; border: 2px solid #dfe3e7; border-radius: 15px; color: var(--navy); background: white; text-align: left; box-shadow: 0 3px 0 #c4c6cf; }
.boss-mode-option > span { grid-row: 1 / 3; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: var(--sky-pale); font-size: 21px; }
.boss-mode-option > b { font-size: 14px; }
.boss-mode-option > small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.boss-mode-option.is-selected { border-color: var(--coral); background: #fff4e9; box-shadow: 0 4px 0 var(--coral-strong); }
.boss-mode-option:disabled { cursor: not-allowed; opacity: .78; }
.boss-settings-note { display: block; color: #687b87; font-size: 11px; line-height: 1.6; }
.boss-card { display: grid; grid-template-columns: 150px 1fr; gap: 12px 20px; align-items: center; padding: 20px; background: linear-gradient(135deg,#fff0e6,#fff); }
.boss-art { position: relative; display: grid; min-height: 155px; place-items: center; border-radius: 20px; background: #ffe0c7; font-size: 74px; }
.boss-art span { position: absolute; right: 7px; bottom: 6px; font-size: 35px; }
.boss-copy h2 { margin: 6px 0; font-size: 22px; }
.boss-copy p, .boss-copy small { color: #59636f; font-size: 11px; line-height: 1.6; }
.boss-hp { overflow: hidden; height: 13px; margin: 12px 0 5px; border: 2px solid var(--navy); border-radius: 99px; background: white; }
.boss-hp span { display: block; width: 72%; height: 100%; background: linear-gradient(90deg,#f97316,#f59e0b); }
.boss-card > button { grid-column: 1 / -1; }
.boss-result-report { margin-top: 16px; padding: 20px; border: 1px solid #c9e0ef; border-radius: 19px; background: linear-gradient(140deg,#f1f9ff,#fff 68%); }
.boss-result-report-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.boss-result-report-heading h2 { margin: 4px 0 0; font-size: 20px; }
.boss-exam-mode-chip { padding: 8px 11px; border-radius: 99px; color: #315d79; background: #e6f3fc; font-size: 11px; font-weight: 800; }
.boss-exam-score-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.boss-exam-total, .boss-exam-writing-summary { display: grid; gap: 4px; padding: 14px; border-radius: 15px; background: white; }
.boss-exam-total { border: 2px solid #9fdcc2; }
.boss-exam-writing-summary { border: 2px solid #f2d18a; }
.boss-exam-total > span, .boss-exam-writing-summary > span { color: #637a82; font-size: 11px; font-weight: 800; }
.boss-exam-total > b { color: #087b5c; font-size: 31px; line-height: 1.1; }
.boss-exam-writing-summary > b { color: #946214; font-size: 17px; }
.boss-exam-total > b small, .boss-exam-writing-summary > b small { font-size: 12px; }
.boss-exam-total > small, .boss-exam-writing-summary > small { color: #82918c; font-size: 10px; line-height: 1.5; }
.boss-exam-categories { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.boss-exam-category { display: grid; align-content: start; gap: 6px; min-height: 66px; padding: 10px; border: 1px solid #e1e9e6; border-radius: 13px; background: #fff; }
.boss-exam-category > span { color: #71827e; font-size: 10px; font-weight: 800; }
.boss-exam-category > b { color: #1d4259; font-size: 13px; }
.boss-exam-category > small { color: #786843; font-size: 9px; line-height: 1.45; }
.boss-exam-writing { border-color: #f0d9a5; background: #fffaf0; }
.boss-result-report > p { margin: 12px 0 0; color: #73847e; font-size: 10px; line-height: 1.65; }
.goal-settings-card { border-color: #39b8fd; background: #f5fbff; }
.local-setting-note { display: block; }
.daily-advice-card { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 13px; align-items: center; margin: 0 0 22px; padding: 17px 20px; border: 1px solid #e8d9a6; border-radius: 20px; background: linear-gradient(110deg,#fff9df,#fffdf5 64%,#eef6e7); box-shadow: 0 5px 0 rgba(206,185,125,.22); }
.advice-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 15px; color: #8c6b2c; background: #f6e8b7; font-size: 24px; }
.daily-advice-card .eyebrow { color: #8b8061; }
.daily-advice-card p { margin: 4px 0 0; color: #395650; font-size: 14px; font-weight: 750; line-height: 1.7; }
.calendar-advice { margin: -3px 0 16px; }
.stampbook-link { display: block; margin: 8px 0 0 auto; padding: 5px 0; border: 0; color: var(--teal-dark); background: transparent; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.curriculum-warning { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0 0 16px; padding: 14px 17px; border: 1px solid #eac77d; border-radius: 16px; color: #644e27; background: #fff7df; }
.curriculum-warning p { margin: 3px 0 0; font-size: 11px; line-height: 1.6; }
.curriculum-warning .secondary-button { flex: 0 0 auto; }
@media (max-width: 520px) {
  .paused-session-card { align-items: stretch; flex-direction: column; }
  .paused-session-actions { display: grid; grid-template-columns: minmax(0, 1fr) 70px; }
  .paused-session-card .secondary-button { width: 100%; }
  .start-session-actions { grid-template-columns: minmax(0, 1fr) 65px; gap: 7px; }
  .start-session-actions .start-button { padding: 0 13px; }
  .start-session-actions .start-button b { font-size: 14px; }
  .start-session-actions .start-button small { font-size: 10px; }
  .start-session-actions .session-delete-button { padding: 0 5px; }
  .daily-advice-card { grid-template-columns: 36px minmax(0,1fr); gap: 10px; margin-bottom: 16px; padding: 13px; border-radius: 16px; }
  .advice-icon { width: 34px; height: 34px; border-radius: 12px; font-size: 20px; }
  .daily-advice-card p { font-size: 12px; }
  .curriculum-warning { align-items: stretch; flex-direction: column; gap: 9px; padding: 12px; }
  .curriculum-warning .secondary-button { min-height: 42px; }
}
@media (max-width: 1100px) {
  .achievement-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .dictionary-entry.is-expanded { grid-template-columns: minmax(0, 1fr); }
  #app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav { gap: 1px; padding: 5px; }
  .bottom-nav-item { min-width: 0; min-height: 55px; }
  .bottom-nav-item small { font-size: 8px; }
  .feature-launcher-grid, .option-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .achievement-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .achievement-card { min-height: 178px; padding: 11px; }
  .badge-collection-summary { padding: 14px; }
  .badge-collection-summary h2 { font-size: 18px; }
  .badge-collection-summary > b strong { font-size: 29px; }
  .collection-grade-card .stamp-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .boss-exam-categories { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .boss-exam-score-grid { grid-template-columns: 1fr; }
  .boss-result-report { padding: 15px; }
  .boss-config-card { padding: 15px; }
  .boss-card { grid-template-columns: 95px 1fr; gap: 10px; padding: 14px; }
  .boss-art { min-height: 120px; font-size: 54px; }
  .buddy-room-card { grid-template-columns: 1fr; }
  .buddy-room-stage { min-height: 170px; }
  .quiz-mode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  .quiz-mode-card { min-height: 220px; padding: 19px 12px 38px; }
}
@media (max-width: 520px) {
  .bottom-nav { width: calc(100% - 12px); bottom: max(5px, env(safe-area-inset-bottom)); border-radius: 17px; }
  .bottom-nav-item span { font-size: 18px; }
  .bottom-nav-item small { font-size: 7px; }
  .topbar-coins { min-height: 29px; padding: 0 6px; font-size: 9px; }
  .feature-launcher-grid, .option-grid { gap: 8px; }
  .feature-launcher, .option-card { min-height: 106px; padding: 11px 6px; }
  .feature-launcher b, .option-card b { font-size: 11px; }
  .dictionary-search { flex-wrap: wrap; }
  .dictionary-search input { flex-basis: 65%; }
  .dictionary-search .secondary-button { margin-left: auto; }
  .calendar-day { min-height: 44px; border-radius: 10px; }
  .calendar-weekdays, .calendar-grid { gap: 4px; }
  .calendar-card { padding: 8px; }
  .dictionary-detail-actions > button { flex: 1; }
  .boss-mode-grid { grid-template-columns: minmax(0,1fr); }
  .boss-mode-option { min-height: 74px; }
  .rescue-row { gap: 8px; padding: 8px; }
  .rescue-row .dictionary-kanji { width: 44px; height: 44px; font-size: 25px; }
  .rescue-mark { padding: 5px; font-size: 8px; }
  .collection-grade-card .stamp-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .treasure-grade-grid { grid-template-columns: minmax(0,1fr); }
  .treasure-grade-progress { grid-template-columns: 1fr auto; align-items: center; }
  .treasure-grade-progress > strong { grid-column: 2; grid-row: 1; }
  .treasure-grade-track, .treasure-grade-link { grid-column: 1 / -1; }
  .quiz-mode-grid { grid-template-columns: 1fr; gap: 10px; margin: 16px auto; }
  .quiz-mode-card { min-height: 150px; grid-template-columns: 78px minmax(0,1fr); grid-template-rows: auto auto; justify-items: start; column-gap: 13px; row-gap: 5px; padding: 17px 18px 34px; border-radius: 19px; text-align: left; }
  .quiz-mode-sample { grid-column: 1; grid-row: 1 / 3; align-self: center; justify-self: center; font-size: 38px; }
  .quiz-mode-card > b { align-self: end; font-size: 17px; }
  .quiz-mode-card > small { align-self: start; font-size: 11px; }
  .quiz-mode-count { right: 12px; bottom: 9px; left: auto; font-size: 10px; }
  .dictionary-readings > div { grid-template-columns: 76px minmax(0,1fr); }
}

.reading-choice.is-choice-wrong { border-color: #dfa58d; color: #a35f49; background: #fff0e8; }
