:root {
  color-scheme:light;
  --bg:#f4f5f1; --text:#26383d; --muted:#52676b; --line:#ccd9d2; --accent:#326b68;
  font-family:"Hiragino Sans","Yu Gothic UI","Noto Sans JP",system-ui,sans-serif;
  font-synthesis:none; font-size:16px;
}
* { box-sizing:border-box; }
html { min-height:100%; scroll-padding-top:18px; }
body { margin:0; background:var(--bg); color:var(--text); }
a { color:inherit; text-decoration:none; }
button,input,select,textarea { font:inherit; color:inherit; }
button,select,summary { cursor:pointer; }
button { touch-action:manipulation; }
button:disabled { opacity:.5; cursor:not-allowed; }
button,a,input,textarea,select,summary { outline-offset:4px; }
:focus-visible { outline:3px solid #20778b; }
[hidden] { display:none!important; }
h1,h2,h3,p { overflow-wrap:anywhere; }
h1,h2,h3 { line-height:1.4; }
h1 { font-size:clamp(1.6rem,2.7vw,2.2rem); }
h2 { font-size:1.3rem; }
h3 { font-size:1rem; }
p { line-height:1.75; }
input[type="checkbox"] { width:20px; height:20px; accent-color:var(--accent); flex:0 0 auto; }
input[type="search"],textarea,select { background:#fff; border:1px solid #adc1bb; border-radius:7px; padding:10px 12px; }
input:disabled,textarea:disabled { background:#e9eeeb; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:fixed; z-index:100; top:-100px; left:12px; background:#fff1c7; color:#182d37; padding:12px 18px; border-radius:6px; }
.skip-link:focus { top:12px; }
.topbar { position:relative; z-index:20; display:flex; gap:16px; align-items:center; min-height:56px; padding:4px 20px; background:#182f38; color:#f9efda; }
.brand { display:flex; align-items:center; gap:9px; min-height:44px; }
.brand-mark { width:27px; height:31px; display:grid; place-items:center; color:#f6d897; border:1px solid #d1b77c; border-radius:50% 50% 4px 4px; font-size:21px; flex-shrink:0; }
.brand-text { display:grid; gap:2px; }
.brand-text strong { font-size:.82rem; }
.brand-text small { color:#bfd5cd; font-size:.65rem; letter-spacing:.08em; }
.topnav { display:flex; gap:4px; }
.topnav a { display:flex; align-items:center; min-height:44px; padding:10px 12px; border-radius:5px; white-space:nowrap; font-size:.85rem; color:#d2e2da; }
.topnav a:hover,.topnav a[aria-current] { color:#ffe2ac; background:#2c484c; }
.topbar :focus-visible { outline-color:#ffe2ac; }
.topmeta { margin-left:auto; display:flex; gap:8px; align-items:center; min-width:0; }
.topmeta select { width:182px; min-height:44px; font-size:.8rem; background:#233e46; color:#f4eedc; border-color:#668b83; }
#status { max-width:165px; font-size:.75rem; color:#d0dfd5; }
.topbar .btn { background:#2c484c; color:#fff1d0; border-color:#6e8b82; }
.view { min-height:65vh; }
.view:focus { outline:none; }
.btn { display:inline-flex; min-height:44px; align-items:center; justify-content:center; gap:7px; padding:10px 14px; border:1px solid #b6cbc2; border-radius:7px; background:#fff; color:#294d50; font-size:.9rem; line-height:1.4; }
.btn:hover:not(:disabled) { border-color:#477b76; background:#ecf4ee; }
.btn.primary { background:#326b68; color:#fff; border-color:#326b68; }
.btn.primary:hover { background:#245653; }
.text-link { color:#285f66; text-decoration:underline; text-underline-offset:4px; }
.badge { display:inline-flex; padding:6px 10px; border-radius:5px; background:#f1f5ef; border:1px solid #cad7cc; color:#3e5c4c; font-size:.8rem; }
.eyebrow { font-size:.72rem; font-weight:700; letter-spacing:.16em; color:#52766e; }
.muted { color:var(--muted); font-size:.9rem; }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
.loading { padding:22vh 24px; text-align:center; color:var(--muted); }
.warning { padding:12px 16px; border-left:3px solid #ac7939; background:#fff4df; color:#69491f; font-size:.9rem; }

/* Cinematic rendering is confined to this route; learning pages never inherit it. */
.town-page { background:#152c36; color:#f6ecd5; }
.town-heading { position:relative; z-index:25; display:flex; gap:22px; align-items:center; padding:6px 20px; min-height:62px; }
.town-heading .eyebrow { margin:0; color:#d4c295; font-size:.6rem; }
.town-heading h1 { margin:0; font-size:1.35rem; letter-spacing:.06em; }
.town-tagline { color:#c9dacf; font-size:.8rem; margin:0; }
.map-primary { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-left:auto; }
.map-primary button,.map-primary summary { min-height:44px; min-width:44px; padding:10px; border:1px solid #7e9c8d; border-radius:5px; background:#294750; color:#f6ecd5; font-size:.8rem; }
.map-primary summary { display:list-item; list-style-position:inside; white-space:nowrap; }
.map-primary .btn { background:#e9d4a8; color:#233e46; border-color:#e9d4a8; font-size:.8rem; }
.map-primary button:hover:not(:disabled),.map-primary summary:hover { background:#3b5b61; }
.map-primary button[aria-pressed="true"] { background:#ead3a2; color:#213c43; border-color:#ead3a2; }
.town-page :focus-visible { outline-color:#ffe2aa; }
/* Fallback anchor is the full heading, not the narrow summary.
   JS additionally clamps the panel to the live viewport on open/resize/scroll. */
.map-settings { position:static; }
.settings-panel {
  position:absolute; top:calc(100% + 8px); right:14px; width:min(370px,calc(100vw - 28px));
  max-height:65dvh; overflow:auto; overscroll-behavior:contain;
  padding:16px; border:1px solid #adbd9f; border-radius:8px; background:#1b3642;
  box-shadow:0 10px 35px #0b1b2988; color:#e4e6d5; z-index:50;
}
.settings-panel p { font-size:.8rem; margin:10px 0 0; }
.town-quality,.map-actions { display:flex; gap:6px; flex-wrap:wrap; }
#effective-quality { color:#ffe3ae; }
#town-fps { color:#cbdccf; font-variant-numeric:tabular-nums; }
.town-stage { position:relative; isolation:isolate; height:max(520px,calc(100svh - 160px)); overflow:hidden; background:#829ba9; border-block:1px solid #c5b78955; }
#town-canvas { width:100%; height:100%; display:block; cursor:grab; touch-action:pan-y pinch-zoom; image-rendering:pixelated; }
.map-interacting #town-canvas { touch-action:none; }
#town-canvas:focus-visible { outline:2px solid #f6dfa9; outline-offset:-3px; }
.town-stage[data-quality="low"]::after { content:""; position:absolute; inset:0; pointer-events:none; z-index:1; background:radial-gradient(ellipse at 50% 48%,transparent 48%,#0d27333b 100%); }
.town-loading { position:absolute; inset:0; display:grid; place-items:center; padding:24px; text-align:center; background:#18343ce8; color:#f4dfb4; z-index:4; font-size:.95rem; pointer-events:none; }
.town-label-layer { position:absolute; inset:0; z-index:3; pointer-events:none; overflow:hidden; }
.town-leaders { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.town-leaders path { fill:none; stroke:#ffedc2; stroke-width:1.2; opacity:.65; }
.town-leaders path.hot { stroke:#fff0b8; stroke-width:2; opacity:1; }
.exam-pin { position:absolute; top:0; left:0; pointer-events:auto; width:86px; height:44px; padding:5px 6px; display:grid; justify-items:center; align-content:center; gap:2px; border:1px solid #dfcda1; border-top:3px solid var(--c); border-radius:3px; background:#1c3541f5; color:#fff4d9; box-shadow:0 2px 5px #10232e77; text-shadow:0 1px #102d35; touch-action:pan-y pinch-zoom; }
.exam-pin strong { font-size:17px; line-height:1; letter-spacing:.04em; }
.exam-pin>span { font-size:11px; line-height:1.25; white-space:nowrap; color:#efdcb3; }
.exam-pin.grand { border-color:#e8c885; border-top-color:var(--c); border-radius:8px 8px 3px 3px; }
.exam-pin.hot,.exam-pin:hover,.exam-pin:focus-visible { background:#f5e3b8; color:#1d414b; text-shadow:none; z-index:9; }
.exam-pin.hot>span,.exam-pin:hover>span,.exam-pin:focus-visible>span { color:#355b61; }
.exam-pin:focus-visible { outline:2px solid #ffe8b4; outline-offset:3px; box-shadow:0 0 0 4px #183844; }
.exam-pin:focus { visibility:visible!important; opacity:1!important; z-index:10; }
.labels-hidden .exam-pin { opacity:0; pointer-events:none; }
.labels-hidden .exam-pin:focus { pointer-events:auto; }
.labels-hidden .town-leaders { visibility:hidden; }
.entering .exam-pin:not(:focus):not(.entering-pin) { opacity:.25; }
.entering .entering-pin { opacity:1; color:#fff7dc; background:#755029; border-color:#ffe0a3; }
.entering .entering-pin>span { color:#fff0c7; }
.town-inspector { display:flex; align-items:baseline; flex-wrap:wrap; gap:3px 16px; min-height:40px; padding:8px 20px; background:#203a45; color:#d1e0d4; font-size:.8rem; }
.town-inspector strong { color:#ffe7b8; font-size:.95rem; }
.town-notice { margin:0; padding:7px 20px; color:#e4d3b1; font-size:.8rem; }
.town-directory { max-width:1280px; margin:auto; padding:24px 24px 45px; }
.town-directory h2 { margin:0; }
.town-directory>p { font-size:.9rem; color:#d0ded3; }
.town-directory .directory-card { background:#213b47; color:#f2e7cd; border-color:#819d8b; }
.town-directory .directory-card:hover { background:#2e4b58; border-color:#e9d7a9; }
.world-fallback { position:absolute; inset:0; z-index:5; display:flex; flex-wrap:wrap; align-content:center; justify-content:center; gap:12px; padding:28px; text-align:center; background:linear-gradient(135deg,#244957,#182f38); }
.world-fallback p { flex-basis:100%; }

/* Ordinary, full-size web pages. No transforms, canvas scaling or filters. */
.list-page,.exam-page { width:100%; max-width:1280px; margin:auto; padding:30px 28px 70px; }
.list-page>h1 { margin:8px 0; }
.list-page>p { color:var(--muted); }
.directory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:24px 0; }
.directory-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:20px; border:1px solid var(--line); border-top:3px solid var(--c,#7eafa5); border-radius:8px; background:#fff; min-width:0; overflow-wrap:anywhere; }
.directory-card:hover { border-color:#708f82; background:#fafdf9; }
.directory-card strong { font-size:1rem; }
.directory-card>span:not(.directory-code) { font-size:.85rem; color:var(--muted); line-height:1.65; }
.directory-card [data-exam-description]:empty { display:none; }
.directory-code { font-size:1.7rem; font-weight:800; letter-spacing:.05em; color:#365e66; }
.directory-code small { font-size:.8rem; letter-spacing:0; font-weight:600; color:var(--muted); }
.town-directory .directory-code { color:var(--c,#d6ddc2); }
.town-directory .directory-code small,.town-directory .directory-card>span:not(.directory-code) { color:#d0ded3; }
.exam-hero { padding:24px 28px; border:1px solid #d2dbd5; border-left:5px solid var(--c); border-radius:9px; background:linear-gradient(115deg,#fff9eb,#edf3ee); margin-bottom:20px; }
.exam-hero-top { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.exam-hero .eyebrow { margin-top:24px; }
.exam-hero h1 { margin:5px 0; }
.exam-hero>p:not(.eyebrow) { font-size:.95rem; color:var(--muted); }
.progress-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.progress-row progress { width:200px; max-width:100%; height:10px; accent-color:#528678; }
#progress-text { font-size:.85rem; color:#405d51; }
.day-dock-wrap { position:relative; display:flex; gap:6px; margin:0 0 26px; min-width:0; width:100%; }
.day-dock { position:relative; display:flex; flex:1 1 auto; min-width:0; gap:7px; overflow-x:auto; padding:5px 5px 12px; scrollbar-width:thin; scrollbar-color:#91aaa0 transparent; }
.day-dock-button { flex:0 0 94px; display:grid; justify-items:center; gap:5px; padding:12px; border:1px solid #b9cbc1; border-radius:7px; background:#fff; font-size:.95rem; white-space:nowrap; }
.day-dock-button span { font-size:.8rem; color:var(--muted); }
.day-dock-button[aria-current] { background:#e2eee7; border-color:#4f8175; box-shadow:inset 0 -2px #4f8175; }
.day-dock-button:hover { border-color:#4f8175; }
.dock-arrow { flex:0 0 44px; align-self:center; height:48px; margin-bottom:8px; border:1px solid #b9cbc1; background:#fff; border-radius:6px; color:#3b6660; font-size:28px; }
.exam-toolbar { margin:14px 0 22px; }
.exam-toolbar h2 { margin-bottom:4px; }
.exam-toolbar>p { margin-top:5px; }
.filters { display:flex; flex-wrap:wrap; gap:7px; margin:18px 0 14px; }
.chip { min-height:44px; padding:8px 15px; border:1px solid #aebfb5; border-radius:999px; background:#fff; color:#365b4e; font-size:.9rem; }
.chip[aria-pressed="true"],.chip:hover { background:#365e58; color:#fff; border-color:#365e58; }
.search-row { display:flex; align-items:center; flex-wrap:wrap; gap:16px; }
.search-row>label:first-child { display:flex; align-items:center; gap:10px; font-size:.95rem; }
.search-row input[type="search"] { width:min(300px,55vw); font-size:1rem; }
.video-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr)); gap:18px; }
.video-card { min-width:0; overflow:hidden; background:#fff; border:1px solid #c8d6cc; border-radius:9px; box-shadow:0 4px 12px #29433706; }
.video-card:hover { border-color:#82a091; }
.video-link { display:block; }
.video-link:focus-visible { outline-offset:-4px; }
.thumb { position:relative; aspect-ratio:16/9; overflow:hidden; isolation:isolate; background:linear-gradient(145deg,#d4e0d5,#b7c9c3); }
.thumb-placeholder { position:absolute; inset:0; display:grid; place-items:center; color:#496b60; font-size:1.5rem; letter-spacing:.15em; font-weight:800; }
.thumb img { position:relative; width:100%; height:100%; display:block; object-fit:cover; }
.type-badge,.duration { position:absolute; z-index:1; border-radius:4px; padding:4px 7px; background:#213c40ed; color:#fff3d6; font-size:.8rem; }
.type-badge { top:9px; left:9px; max-width:calc(100% - 18px); overflow-wrap:anywhere; }
.duration { right:9px; bottom:9px; }
.duration:empty { display:none; }
.video-card h3 { margin:0; padding:15px 16px 8px; font-size:1rem; line-height:1.65; }
.watch-check { display:inline-flex; align-items:center; gap:8px; font-size:.95rem; cursor:pointer; min-height:44px; }
.video-card>.watch-check { margin:3px 16px 15px; color:#415d4e; }
.lesson-state { margin:6px 16px 18px; font-size:.9rem; color:#765f38; }
.empty { padding:30px 20px; text-align:center; border:1px dashed #a9c0b0; border-radius:8px; color:#405d4e; }
.coming-card { padding:45px 24px; text-align:center; border:1px dashed #a8c0b0; border-radius:10px; background:#fff; }
.coming-card p:not(.eyebrow) { color:var(--muted); max-width:660px; margin:12px auto 25px; }
.coming-card .btn { margin:5px; }
.error-page { min-height:55vh; }
.error-page [role="alert"] { padding:18px; border-left:4px solid #a65036; background:#fff0e9; color:#703a2c; }
.watch-layout { display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:26px; align-items:start; }
.watch-main { min-width:0; }
.watch-main>.text-link { display:inline-block; padding-block:10px; font-size:.95rem; }
.watch-main h2 { margin:15px 0; }
#player { display:block; width:100%; aspect-ratio:16/9; max-height:65dvh; background:#14242d; border-radius:8px; }
#player[data-state="playbackError"] { outline:2px solid #a66f41; outline-offset:2px; }
.player-feedback { margin:12px 0; }
.player-feedback p { margin:0 0 10px; }
.media-access { color:var(--muted); font-size:.9rem; }
.media-access a { display:inline-block; padding:8px 4px; }
.queue { display:grid; gap:7px; }
.queue a { padding:14px 15px; background:#fff; border:1px solid #c8d6cc; border-radius:6px; font-size:.95rem; overflow-wrap:anywhere; }
.queue a[aria-current],.queue a:hover { background:#e7f0e9; border-color:#759b89; }
.course-chat { margin-top:32px; }
.course-chat>summary { padding:14px; border:1px solid var(--line); background:#fff; border-radius:7px; font-weight:700; min-height:48px; }
.course-chat .chat-pane { margin-top:12px; max-width:760px; }
.chat-pane { min-width:0; border:1px solid #c8d6cc; border-radius:9px; background:#fff; padding:18px; }
.chat-head h2 { margin:4px 0 8px; font-size:1.15rem; }
.chat-head .eyebrow { margin:0 0 4px; }
.chat-head .muted { font-size:.85rem; }
.chat-log { display:flex; flex-direction:column; gap:12px; min-height:160px; max-height:430px; overflow:auto; padding:8px 2px 20px; scrollbar-width:thin; }
.bubble { max-width:97%; padding:12px 13px; border-radius:8px; font-size:.95rem; overflow-wrap:anywhere; }
.bubble strong { font-size:.8rem; }
.bubble p { margin:5px 0 0; white-space:pre-wrap; }
.bubble.user { align-self:flex-end; background:#e0eee8; }
.bubble.assistant { align-self:flex-start; background:#f1f4ef; border:1px solid #d6e0d4; }
.bubble.system { background:#faf5e7; color:#695735; border:1px solid #e6dbbd; }
.chat-form { display:grid; gap:8px; }
.chat-form>label { font-size:.95rem; font-weight:700; }
.chat-form textarea { width:100%; min-width:0; min-height:96px; resize:vertical; max-height:250px; font-size:1rem; }
.chat-actions { display:flex; align-items:center; gap:8px; justify-content:space-between; flex-wrap:wrap; }
.chat-actions .muted { font-size:.8rem; flex:1; }
.chat-form>small { font-size:.8rem; color:var(--muted); }
.site-footer { padding:20px 24px; border-top:1px solid #d8dfd7; color:#58685e; font-size:.8rem; text-align:center; }
.site-footer p { margin:3px; }

@media(max-width:1100px) {
  #status { display:none; }
  .town-tagline { display:none; }
  .watch-layout { grid-template-columns:minmax(0,1fr) 320px; gap:20px; }
}
@media(max-width:850px) {
  .topbar { flex-wrap:wrap; gap:5px 12px; }
  .topmeta select { width:156px; }
  .watch-layout { grid-template-columns:1fr; }
  .directory-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .town-heading,.town-inspector,.town-notice,.town-directory { padding-inline:14px; }
}
@media(max-width:600px) {
  .topbar { padding:4px 10px; }
  .brand { flex:1 1 100%; }
  .brand-mark { width:22px; height:25px; font-size:17px; }
  .brand-text small { display:none; }
  .topnav { gap:0; }
  .topnav a { font-size:.8rem; padding:10px 8px; }
  .topmeta { gap:5px; flex-wrap:wrap; }
  .topmeta select { width:138px; max-width:100%; font-size:.8rem; padding:8px 5px; }
  .topmeta .btn { font-size:.8rem; padding-inline:8px; }
  .town-heading { flex-wrap:wrap; gap:6px; padding-block:7px; }
  .town-heading h1 { font-size:1.2rem; }
  .map-primary { width:100%; gap:5px; margin-left:0; }
  .map-primary button,.map-primary summary { padding:10px 8px; }
  .map-primary .btn { padding-inline:9px; margin-left:auto; }
  .town-stage { height:max(510px,calc(100svh - 250px)); }
  .exam-pin { width:72px; height:44px; padding:4px; }
  .exam-pin strong { font-size:15px; }
  .town-inspector { min-height:48px; }
  .list-page,.exam-page { padding:20px 15px 45px; }
  .exam-hero { padding:19px 17px; }
  .directory-grid { gap:10px; }
  .directory-card { padding:16px 12px; }
  .directory-card strong { font-size:.95rem; }
  .directory-code { font-size:1.5rem; }
  .day-dock-button { flex-basis:84px; }
  .search-row { gap:10px; }
  .search-row>label:first-child { width:100%; flex-wrap:wrap; }
  .search-row input[type="search"] { flex:1; min-width:140px; max-width:100%; width:auto; }
  .coming-card { padding:30px 18px; }
}
@media(max-width:420px) {
  .directory-grid { grid-template-columns:1fr; }
  .topmeta { margin-left:0; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
}
@media(forced-colors:active) {
  .btn,.exam-pin,.directory-card,.video-card,.day-dock-button,.chip,.badge,.map-primary button,.map-primary summary { border:1px solid CanvasText; }
  .exam-pin,.settings-panel { background:Canvas; color:CanvasText; }
  .exam-pin>span,.directory-code { color:CanvasText; }
  .town-leaders path { stroke:CanvasText; }
  .day-dock-button[aria-current],.chip[aria-pressed="true"],.exam-pin.entering-pin { outline:2px solid Highlight; }
}
.viewing-history { list-style:none; display:grid; gap:10px; margin:24px 0; padding:0; }
.viewing-history a { display:grid; gap:4px; min-height:44px; padding:12px 16px; border:1px solid #4a6969; border-radius:6px; overflow-wrap:anywhere; }
.viewing-history a:hover { background:#2c484c; }
.viewing-history span { font-size:.88rem; }

.study-home { max-width:1080px; margin:auto; padding:clamp(16px,4vw,48px); }
.study-banner { overflow:hidden; border-radius:16px; color:#fff; background:linear-gradient(100deg,#153b42 10%,#18464bec 52%,#18464b25),url('/assets/town/home-sky.webp') center 55%/cover; padding:clamp(24px,5vw,54px); }
.study-banner h1 { margin:0; font-size:clamp(2rem,5vw,3.2rem); letter-spacing:.04em; }
.study-banner p { margin:.6rem 0 0; color:#e4f0e9; }
.study-content { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); align-items:start; gap:20px; margin-top:20px; }
.resume-panel,.study-journal { background:#fff; border:1px solid #d0ddd6; border-radius:14px; padding:clamp(17px,3vw,30px); }
.resume-panel { border-top:4px solid #bb843b; }
.resume-panel h2,.journal-title h2 { margin:0 0 8px; }
.resume-panel .text-link { display:inline-flex; align-items:center; min-height:44px; margin:0 8px; }
.study-label,.lesson-code { color:#36685d; font-size:.82rem; font-weight:700; }
.journal-title { display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:space-between; }
.journal-title label,.study-journal small,.lesson-note small { color:#536a66; font-size:.82rem; }
.viewing-history a { border-color:#d1ded7; background:#f7faf7; }
.viewing-history a:hover { background:#e8f2ea; }
.history-empty { padding:20px 12px; border-block:1px solid #dbe4de; color:#52665f; }
.file-pick,.lesson-note { display:grid; gap:10px; margin:18px 0; padding:18px; background:#eef5ef; border-radius:10px; font-weight:600; }
.file-pick input,.file-pick small,.lesson-note textarea { max-width:100%; min-width:0; overflow-wrap:anywhere; }
@media(max-width:740px) { .study-content { grid-template-columns:minmax(0,1fr); gap:12px; } }

.study-transfer { margin-top:18px; border-top:1px solid #dbe4de; font-size:.9rem; }
.study-transfer summary { padding:14px 0; color:#285f66; font-weight:600; }
.study-transfer label.btn { cursor:pointer; }
.study-transfer label:focus-within { outline:3px solid #20778b; }
.study-transfer p { margin:0 0 10px; }
.study-review,.study-courses { margin:28px 0; }
#review-notes { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(245px,100%),1fr)); gap:12px; }
#review-notes article,.next-lesson { padding:16px 20px; background:#fff; border:1px solid #cfdbd5; border-radius:12px; }
#review-notes article p,#review-notes article h3 { margin:0 0 8px; }
#review-notes summary,#review-notes .text-link { display:inline-flex; align-items:center; min-height:44px; }
.saved-note { white-space:pre-wrap; }
.next-lesson { display:grid; gap:5px; border-left:4px solid #36746b; }
.next-lesson small { color:#4d665e; }

/* Illustrated study notebook */
:root { --bg:#fbf8f1; --text:#172f4b; --muted:#5b6271; --line:#dcd9ce; --accent:#244fa1; }
body { background-color:var(--bg); }
.topbar { background:#fffdf7; border-bottom:2px solid #28394e; color:#1e3450; padding:7px max(20px,calc((100vw - 1190px)/2)); gap:24px; }
.brand { gap:11px; }
.brand-text strong { color:#112d4d; font-size:1.04rem; font-weight:850; white-space:nowrap; }
.brand-mark { display:grid; place-items:center; height:34px; width:33px; color:white; background:#e56543; border:2px solid #24354c; border-radius:7px 9px 7px 5px; box-shadow:-3px 3px 0 #edb74c; transform:rotate(-6deg); }
.topnav { gap:5px; }
.topnav a { color:#3f4958; font-weight:700; }
.topnav a[aria-current],.topnav a:hover { color:#1b3651; background:#ffedb4; }
.topmeta select,.topbar .btn { background:white; border-color:#ccc7b9; color:#273d55; }
#status { color:#596171; }
.topbar :focus-visible { outline-color:#1752aa; }
.study-home,.list-page,.exam-page { max-width:1240px; padding:clamp(14px,2.5vw,34px) clamp(15px,3vw,40px) 60px; }
.study-banner,.catalog-cover { background:#ffc958 url('/assets/study/reading.webp') center/cover no-repeat; color:#142f4c; border:2px solid #273749; border-radius:20px; box-shadow:0 5px 0 #e8d8b7; display:flex; flex-direction:column; justify-content:center; min-height:clamp(205px,24vw,314px); padding:clamp(22px,4vw,52px); }
.study-banner h1,.catalog-cover h1 { font-size:clamp(2.2rem,4.6vw,4rem); line-height:1.15; margin:0; color:#112d4c; letter-spacing:-.045em; font-weight:900; }
.study-banner>div,.catalog-cover>h1,.catalog-cover>p { max-width:42%; }
.study-banner p,.catalog-cover p { margin:12px 0 0; color:#273853; font-size:clamp(.94rem,1.4vw,1.12rem); font-weight:650; line-height:1.7; text-wrap:pretty; }
.catalog-cover { margin-bottom:25px; }
.study-content { margin-top:24px; grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); }
.resume-panel,.study-journal,#review-notes article,.video-card,.directory-card { border:1.5px solid #c7c4b8; border-radius:15px; box-shadow:0 4px 0 #ded9ca; }
.resume-panel { background:#fff2cd; border-color:#c9aa66; }
.study-journal { background:#fffefa; }
.study-home h2,.exam-toolbar h2,.watch-main h2 { color:#1e354c; font-weight:850; letter-spacing:-.035em; }
.study-review>h2,.study-courses>h2,.journal-title>h2 { display:flex; align-items:center; gap:10px; }
.study-review>h2::before,.study-courses>h2::before,.journal-title>h2::before { content:''; width:10px; height:22px; border-radius:5px; background:#b7a1dd; transform:rotate(8deg); }
.study-courses>h2::before { background:#ed9364; }
.journal-title>h2::before { background:#6cb9c4; }
.study-review { padding:18px 22px; background:#f2ecf9; border-radius:15px; border:1px solid #d7cbe3; }
.study-review>h2 { margin:0; }
.study-review .muted { margin-bottom:0; }
.btn.primary,.chip[aria-pressed="true"] { background:#214f96; border-color:#214f96; color:#fff; }
.btn.primary { border-radius:10px; font-weight:750; }
.btn.primary:hover,.chip[aria-pressed="true"]:hover { background:#173e7a; }
.text-link { color:#264e8d; }
.directory-grid { grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr)); gap:18px; }
.directory-card { --pad:18px; position:relative; overflow:hidden; padding:0 var(--pad) var(--pad); gap:6px; background:#fffefa; }
.course-cover { display:block; margin:0 calc(-1 * var(--pad)) 3px; width:calc(100% + 2 * var(--pad)); height:clamp(94px,10vw,133px); object-fit:cover; }
.directory-code { font-size:1.45rem; color:#1b3f6a; }
.directory-code small { font-weight:700; }
.directory-card:hover,.video-card:hover { border-color:#6b829a; box-shadow:0 5px 0 #c7d3da; }
.exam-hero { margin-bottom:23px; border:2px solid #273749; border-radius:18px; background:#ffedcc; box-shadow:0 5px 0 #e5d6bb; padding:0; display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); overflow:hidden; }
.course-heading { padding:clamp(18px,3.4vw,42px); align-self:center; }
.exam-art { display:block; width:100%; height:100%; max-height:340px; min-height:235px; object-fit:cover; }
.exam-hero .eyebrow { color:#80471d; margin:20px 0 7px; font-size:.8rem; }
.exam-hero h1 { font-size:clamp(1.65rem,3.25vw,3.05rem); font-weight:900; letter-spacing:-.04em; line-height:1.25; }
.exam-hero-top .btn { min-height:32px; padding:5px 11px; border-radius:100px; background:#fff9e9; border-color:#cab994; }
.course-heading>p:not(.eyebrow) { margin:7px 0 15px; color:#414958; }
.day-dock-button { border-color:#d5cbbb; border-radius:12px; background:#fffdf7; }
.day-dock-button[aria-current] { color:#1f3750; background:#ffd572; border-color:#a67b35; box-shadow:inset 0 -3px #ddaa4a; }
.day-dock-button[aria-current] span { color:#504125; }
.exam-toolbar { padding:18px clamp(16px,2vw,26px); border:1px solid #dfd9c9; background:#fffdf7; border-radius:15px; }
.exam-toolbar h2 { margin-top:0; }
.thumb-placeholder { background-position:center; background-size:cover; }
.type-badge { background:#fff9e9; color:#273851; font-weight:800; border:1px solid #26394f; border-radius:6px; }
.duration { background:#1d334bed; color:white; border-radius:6px; }
.lesson-note { background:#fff0c5; border:1px solid #d5b36c; }
.file-pick { background:#e6f2f3; border:1px solid #a0c7c8; }
.next-lesson { border-color:#9dbacb; border-left-color:#3578aa; }
@media(max-width:740px) {
 .topbar { padding:7px 12px; gap:4px 10px; }
 .study-content { grid-template-columns:minmax(0,1fr); margin-top:17px; }
 .study-banner,.catalog-cover { min-height:190px; padding:18px; background-size:auto 100%; background-position:58% center; justify-content:flex-end; }
 .study-banner>div,.catalog-cover>h1,.catalog-cover>p { max-width:62%; }
 .study-banner>div,.catalog-cover h1,.catalog-cover p { background:#fff1cdeF; padding:9px 12px; border-radius:8px; }
 .study-banner h1,.catalog-cover h1 { font-size:clamp(1.6rem,5vw,2.4rem); }
 .study-banner p,.catalog-cover p { font-size:.86rem; margin-top:5px; }
 .directory-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
 .directory-card { --pad:12px; }
 .course-cover { height:90px; }
 .exam-hero { grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr); }
 .exam-art { min-height:0; max-height:none; }
 .course-heading { padding:16px; }
 .exam-hero .eyebrow { margin-top:14px; }
 .progress-row progress { width:100%; }
}
@media(max-width:450px) {
 .topmeta { margin-left:0; flex:1; justify-content:flex-end; }
 .topmeta select { width:112px; }
 .exam-hero { grid-template-columns:minmax(0,1fr) 28%; }
 .course-heading { padding:15px; }
 .exam-hero h1 { font-size:1.52rem; }
 .course-heading>p:not(.eyebrow) { font-size:.83rem; line-height:1.5; }
 .study-banner>div { max-width:64%; }
 .study-review { padding:16px; }
}
@media(prefers-reduced-motion:no-preference) {
 .video-card,.directory-card,.btn.primary { transition:transform .15s ease,box-shadow .15s ease; }
 @media(hover:hover) { .video-card:hover,.directory-card:hover { transform:translateY(-2px); } }
}
