:root {
  font-family: system-ui, -apple-system, sans-serif;
  color-scheme: dark;
  --ink: #fcf4e8;
  --muted: #c5cbdf;
  --accent: #ffda83;
  --page: #10182b;
  --surface: #1a2540;
  --raised: #222f4c;
  --border: #455372;
  --serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 1rem; line-height: 1.55; }
body.student { background: radial-gradient(ellipse 80% 40% at 45% 0,#2a2549 0,transparent 100%), var(--page); }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }
p { margin: 0 0 .85rem; }
h1, h2, h3, h4 { line-height: 1.13; margin: 0 0 .55rem; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
h2 { font-size: clamp(1.55rem, 3vw, 2.12rem); }
h3 { font-size: 1.12rem; }
small { font-size: .88rem; }
.wrap { width: min(1200px, calc(100% - 3.25rem)); margin-inline: auto; }
.skip { position: absolute; z-index: 10; inset: .55rem auto auto 1rem; transform: translateY(-150%); padding: .6rem 1rem; background: var(--page); }
.skip:focus { transform: none; }
.top { border-bottom: 1px solid #8396c22c; background: #10182bd9; }
.top-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 1.15rem; }
.brand { color: var(--ink); display: inline-flex; gap: .75rem; align-items: center; font-weight: 760; line-height: 1.2; text-decoration: none; }
.brand small { display: block; color: var(--muted); font-weight: 500; margin-top: .15rem; }
.brand-icon, .medallion { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--accent); background: #ffd77d18; border: 1px solid #ffd77d4b; font-size: 1.3rem; flex: 0 0 auto; }
nav { display: flex; align-items: center; gap: .25rem; }
nav a { padding: .45rem .9rem; border-radius: 99rem; text-decoration: none; color: var(--muted); font-weight: 650; }
nav a[aria-current] { color: var(--ink); background: #d6c2ff20; }
.top-controls { display: flex; align-items: center; gap: .3rem; }
.button { text-decoration: none; min-height: 44px; color: inherit; border: 1px solid transparent; background: none; border-radius: .7rem; padding: .57rem .95rem; font-weight: 730; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; line-height: 1.3; }
.button.small { min-height: 39px; padding: .4rem .7rem; font-size: .9rem; }
.button.gold { background: linear-gradient(120deg,#ffdf8d,#f3b963); border-color: #ffe3b2; color: #30200f; box-shadow: 0 .22rem 1rem #17132437; }
.button.gold:hover { background: #ffe6a7; }
.button.outline { border-color: var(--border); background: #ffffff0a; }
.button.outline:hover, .button.quiet:hover { background: #ffffff18; }
.button.quiet { color: var(--accent); }
.button:disabled { opacity: .47; box-shadow: none; }
.eyebrow { color: var(--accent); font-weight: 760; letter-spacing: .065em; text-transform: uppercase; font-size: .84rem; line-height: 1.35; display: block; margin-bottom: .55rem; }
.hero { margin-top: 1.8rem; border-radius: 1.4rem; border: 1px solid #b49cc067; overflow: hidden; position: relative; background: linear-gradient(90deg, #18182ff5 0%, #201b35eb 23%, #25203d96 49%, #2924430b 78%), url('/assets/bethlehem.webp') center 57% / cover no-repeat; display: flex; align-items: center; min-height: 425px; }
.hero-copy { padding: clamp(1.45rem, 5.3vw, 4.5rem); max-width: 730px; }
.hero h1 { font-size: clamp(3.15rem, 7.6vw, 5.25rem); line-height: .97; letter-spacing: -.055em; margin: .92rem 0 1.1rem; }
.hero h1 em { color: var(--accent); font-weight: inherit; }
.hero-copy > p { max-width: 35ch; font-size: 1.12rem; color: #f7eadd; margin-bottom: 1.35rem; }
.trail-status { margin-top: 1.15rem; border: 1px solid var(--border); border-radius: 1.05rem; background: #202b48; padding: .9rem 1.25rem; display: grid; grid-template-columns: minmax(155px, .9fr) minmax(100px, 1fr) auto; gap: 1rem 1.65rem; align-items: center; }
.trail-person, .tallies { display: flex; align-items: center; gap: .85rem; }
.trail-person strong { overflow-wrap: anywhere; }
.trail-person p { color: var(--muted); margin: .08rem 0 0; font-size: .88rem; }
.progress-block label { color: var(--muted); font-size: .91rem; display: block; margin-bottom: .25rem; }
progress { display: block; width: 100%; height: .53rem; appearance: none; border: 0; border-radius: 100px; accent-color: #fbd782; }
progress::-webkit-progress-bar { background: #131e34; border-radius: inherit; }
progress::-webkit-progress-value { background: linear-gradient(90deg,#ab87e7,#ffd68a); border-radius: inherit; }
progress::-moz-progress-bar { background: #ffd68a; border-radius: inherit; }
.tallies > span { white-space: nowrap; padding: .36rem .65rem; border: 1px solid #eac07355; border-radius: .65rem; color: var(--muted); font-size: .91rem; }
.tallies strong { color: var(--accent); }
.adventure-grid { margin-top: 1.45rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, .38fr); gap: 1.25rem; align-items: start; }
.next-panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid #8875bc; border-radius: 1rem; padding: 1.15rem 1.28rem; background: linear-gradient(110deg,#342b58,#232e50 76%); margin-bottom: 1.2rem; }
.next-panel p { color: var(--muted); margin: .25rem 0 0; }
.next-panel h2 { font-size: clamp(1.4rem,3vw,1.8rem); }
.next-panel .button { flex: 0 0 auto; }
.map-panel, .panel { border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); padding: 1.2rem 1.25rem; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: .9rem; }
.section-title p, .panel > p, .muted { color: var(--muted); }
.week { --week: #c3adff; padding: .8rem 0 .9rem; border-top: 1px solid #8e9cbb33; }
.week h3 { color: var(--week); margin: 0; display: flex; align-items: center; gap: .45rem; }
.week-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .75rem; }
.week-head small { color: var(--muted); font-size: .85rem; }
.week.peace { --week: #8de1e2; }
.week.joy { --week: #ffafc9; }
.week.love { --week: #f4d08a; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .38rem; }
.stop { background: #121d32; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 69px; width: 100%; border: 1px solid #435170; border-radius: .62rem; padding: .25rem .13rem; }
.stop small { color: var(--muted); font-size: .79rem; white-space: nowrap; }
.stop span { color: var(--muted); font-size: 1.12rem; }
.stop.is-current { background: #4d3b70; border-color: var(--week); }
.stop.is-done { background: #223c43; border-color: #5fa590; }
.stop.is-current span, .stop.is-done span { color: var(--accent); }
.stop:enabled:hover { border-color: var(--accent); }
.extras { display: grid; gap: 1rem; }
.chest-card { border: 1px solid #a48356; border-radius: 1rem; background: #27243c; overflow: hidden; }
.chest-card img { width: 100%; height: auto; aspect-ratio: 2.2; object-fit: cover; }
.chest-card > div { padding: 1rem 1.15rem 1.2rem; }
.chest-card h2 { font-size: 1.7rem; }
.chest-card p { color: var(--muted); }
.extra-links { display: grid; gap: .5rem; }
.extra-links button { width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: .8rem; padding: .7rem .85rem; }
.extra-links button:hover { background: var(--raised); }
.extra-links small { color: var(--muted); display: block; }
.extra-icon { flex: 0 0 37px; display: grid; place-items: center; height: 37px; background: #d0a5ee20; border-radius: .58rem; color: #e8c9ff; font-size: 1.2rem; }
.footer { padding-block: 1.4rem 1.75rem; margin-top: 1.15rem; display: flex; justify-content: space-between; color: var(--muted); gap: 1rem; font-size: .92rem; border-top: 1px solid var(--border); }
.footer p { margin: 0; }
dialog { max-height: min(90dvh,850px); width: min(680px, calc(100% - 1.4rem)); border: 1px solid #8076a9; border-radius: 1.15rem; color: var(--ink); background: #172239; padding: 0; overscroll-behavior: contain; box-shadow: 0 25px 100px #060914ba; }
dialog::backdrop { background: #0a1022ba; backdrop-filter: blur(4px); }
.dialog-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: start; gap: 1rem; z-index: 1; background: #172239; border-bottom: 1px solid var(--border); padding: 1.12rem 1.4rem .8rem; }
.dialog-header h2 { margin: 0; }
.dialog-header .eyebrow:empty { display: none; }
.close { line-height: 1; min-width: 44px; padding: 0; font-size: 1.8rem; }
#dialog-content { padding: 1.2rem 1.4rem 1.4rem; }
.quest-card, .callout { border: 1px solid var(--border); border-radius: .78rem; background: var(--surface); padding: 1rem; margin-bottom: .8rem; }
.quest-card > p:last-child, .callout > p:last-child { margin-bottom: 0; }
.callout { color: var(--ink); background: var(--raised); }
.callout.highlight { color: var(--accent); border-color: #aa8c50; }
.callout p { overflow-wrap: anywhere; }
.form, .field { display: grid; gap: .72rem; }
.field { gap: .27rem; font-weight: 650; }
.form + .form, .form + details { margin-top: 1rem; }
label small { font-weight: 400; }
input:not([type=checkbox]), select, textarea { width: 100%; border-radius: .58rem; padding: .58rem .65rem; min-height: 43px; border: 1px solid var(--border); color: var(--ink); background: var(--page); }
textarea { resize: vertical; min-height: 78px; }
::placeholder { color: var(--muted); opacity: .85; }
.check { display: flex; gap: .5rem; align-items: start; min-height: 32px; font-weight: 620; }
input[type=checkbox] { margin: .24rem .1rem 0 0; width: 1.1rem; height: 1.1rem; accent-color: #b68fea; flex-shrink: 0; }
.details { margin: .7rem 0; }
summary { cursor: pointer; font-weight: 680; color: var(--accent); }
details > p:first-of-type { margin-top: .5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.row > form { margin: 0; }
.field-grid, .question-options { display: grid; gap: .45rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.question-options .button { text-align: left; justify-content: start; font-weight: 580; }
.answers-status:empty { display: none; }
.answers-status { color: var(--accent); margin-top: .6rem; }
.beads { display: flex; gap: .27rem; margin: .55rem 0; flex-wrap: wrap; }
.bead { border-radius: 50%; display: grid; place-items: center; height: 27px; width: 27px; background: var(--page); border: 1px solid var(--border); font-size: .8rem; }
.bead.current { border-color: var(--accent); }
.bead.done { background: #6b5294; border-color: #c8afe7; }
.form-error { color: #ffd49d; margin: 0; min-height: 1.1em; }
.key-box { padding: .8rem; font-family: monospace; color: var(--accent); background: var(--page); border: 1px dashed var(--border); border-radius: .65rem; overflow-wrap: anywhere; user-select: all; }
.gift { padding: 1.4rem; background: radial-gradient(ellipse at top,#634080,#2c2b4f 52%,#1a2540); border: 1px solid #b698d1; border-radius: 1rem; text-align: center; margin-bottom: .9rem; }
.gift h3 { font: 700 clamp(1.5rem,5vw,2.1rem) var(--serif); }
.gift-icon { display: inline-grid; width: 75px; aspect-ratio: 1; place-items: center; font-size: 2.7rem; background: #ffcd682a; color: #ffdc88; border: 1px solid #e9be7173; border-radius: 50%; margin-bottom: .6rem; }
.gift.animate .gift-icon { animation: reveal .68s ease-out both; }
@keyframes reveal { from { transform: translateY(16px) scale(.4) rotate(-18deg); opacity: 0; } 62% { transform: translateY(-6px) scale(1.15) rotate(10deg); } to { transform: none; opacity: 1; } }
.collectibles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; margin-bottom: .7rem; }
.collectible { text-align: left; background: var(--surface); border-radius: .8rem; border: 1px solid var(--border); padding: .8rem; }
.collectible:hover { background: var(--raised); border-color: var(--accent); }
.collectible span { color: var(--accent); margin-right: .3rem; }
.collectible small { display: block; color: var(--muted); }
.words { display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: 1rem; }
.word { display: flex; gap: .22rem; }
.letter { display: grid; place-items: center; width: 30px; height: 36px; background: var(--page); border: 1px solid var(--border); border-radius: .34rem; }
.letter.found { background: #674b21; border-color: #c8a360; color: #ffe09a; font-weight: bold; }
.scrapbook-photos { display: grid; gap: .7rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.scrapbook-photos figure { margin: 0; padding: .5rem; border-radius: .68rem; background: var(--surface); overflow-wrap: anywhere; }
.scrapbook-photos img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: .42rem; }
.scrapbook-photos figcaption { margin-top: .4rem; }
#toast { position: fixed; z-index: 4; inset: auto 1rem 1rem auto; padding: .75rem 1rem; max-width: min(420px,calc(100vw - 2rem)); border-radius: .65rem; background: var(--raised); border: 1px solid var(--border); color: var(--ink); box-shadow: 0 .25rem 1rem #0005; }
#toast:empty { display: none; }
.teacher {
  color-scheme: light;
  --ink: #192e2c;
  --muted: #4f635d;
  --accent: #285b50;
  --page: #f5f5f0;
  --surface: #ffffff;
  --raised: #e6f0e8;
  --border: #ccd7ce;
}
.teacher .top { background: #fff; border-color: var(--border); }
.teacher .brand-icon { color: #315d51; background: #e0ece5; border-color: #c1d3c7; }
.teacher nav a[aria-current] { background: #e0eee6; }
.teacher .button.gold { color: #fff; background: #295a4e; border-color: #295a4e; box-shadow: none; }
.teacher .button.gold:hover { background: #21483f; }
.teacher .button.outline:hover, .teacher .button.quiet:hover { background: #e6f0e8; }
.teacher .form-error { color: #8e331d; }
.teacher .check input { accent-color: #315e52; }
.teacher input, .teacher textarea, .teacher select { background: #fff; }
.teacher-main { min-height: 65vh; }
.teacher-hero { margin: 1.8rem 0 1.25rem; border-radius: .9rem; overflow: hidden; background: #203e3c; color: #fff9ec; display: grid; grid-template-columns: 1fr 25%; align-items: stretch; }
.teacher-hero > div:first-child { padding: 1.8rem 2rem; }
.teacher-hero h1 { font-size: clamp(2rem,5vw,3.6rem); letter-spacing: -.03em; }
.teacher-hero p { margin: 0; color: #dceee4; }
.teacher-hero .eyebrow { color: #ead49c; margin-bottom: .7rem; }
.teacher-hero-art { background: linear-gradient(90deg,#203e3c,#203e3c25),url('/assets/bethlehem.webp') 70% center / cover; }
.teacher-grid { display: grid; grid-template-columns: minmax(210px,.37fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.teacher-grid > aside, .teacher-grid > section { display: grid; gap: .85rem; }
.teacher-tabs { display: flex; flex-wrap: wrap; gap: .45rem; padding-bottom: .75rem; }
.teacher-tabs [aria-pressed="true"] { background: var(--raised); border-color: #83a99a; }
.class-list { display: grid; gap: .5rem; }
.class-list .button { display: flex; justify-content: space-between; text-align: left; gap: .5rem; overflow-wrap: anywhere; }
.class-list .button[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }
.class-list small { flex: none; }
.class-meta { margin: .75rem 0; padding: .62rem .72rem; background: var(--raised); border: 1px solid var(--border); border-radius: .55rem; align-items: center; }
.class-meta code { color: var(--ink); font-size: .93rem; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; margin: .7rem 0; }
.stats div { padding: .65rem; background: #eef3ef; border-radius: .6rem; display: grid; line-height: 1.27; }
.stats strong { font: 700 1.7rem var(--serif); color: var(--accent); }
.stats span { font-size: .87rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: .45rem; }
th, td { text-align: left; padding: .52rem .7rem .52rem 0; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .85rem; }
td:first-child { overflow-wrap: anywhere; }
.print-label { display: none; }
.lesson { border: 1px solid var(--border); border-radius: .7rem; padding: .82rem; margin-top: .55rem; }
.lesson summary { color: var(--ink); }
.lesson dl { display: grid; grid-template-columns: minmax(100px,158px) 1fr; gap: .55rem; }
dt { font-weight: 680; }
dd { margin: 0; }
.review-list { display: grid; gap: .55rem; }
.review-item { padding: .76rem; border: 1px solid var(--border); border-radius: .65rem; overflow-wrap: anywhere; }
.review-item summary { color: var(--ink); }
.review-item form { margin-top: .65rem; }
.review-item .muted { display: block; }
.teacher .footer { color: var(--muted); }
@media (max-width: 860px) {
  .wrap { width: calc(100% - 2rem); }
  .adventure-grid { grid-template-columns: minmax(0,1fr) minmax(210px,.43fr); gap: .85rem; }
  .map-panel { padding: 1rem .8rem; }
  .next-panel { align-items: start; flex-direction: column; gap: .65rem; }
  .hero { min-height: 390px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 1.25rem); }
  .top-inner { flex-wrap: wrap; justify-content: space-between; gap: .42rem .5rem; padding-block: .55rem; }
  .top-inner nav { order: 3; width: 100%; justify-content: center; }
  .brand { font-size: .92rem; gap: .42rem; }
  .brand-icon { width: 32px; height: 32px; }
  .top-controls .button.small { min-height: 38px; padding-inline: .37rem; font-size: .87rem; }
  .hero { margin-top: .8rem; min-height: 335px; background-position: 59% center; }
  .hero-copy { padding: 1.15rem; }
  .hero h1 { font-size: clamp(2.8rem,10vw,4.1rem); }
  .hero-copy > p { font-size: 1rem; }
  .trail-status { grid-template-columns: minmax(0,1fr) auto; padding: .7rem; gap: .75rem .35rem; }
  .progress-block { grid-column: 1 / -1; grid-row: 2; }
  .tallies { gap: .2rem; }
  .tallies > span { padding: .23rem .34rem; font-size: .79rem; }
  .trail-person { gap: .45rem; }
  .trail-person .medallion { width: 30px; height: 30px; font-size: 1rem; }
  .adventure-grid, .teacher-grid { grid-template-columns: minmax(0,1fr); }
  .next-panel { flex-direction: row; align-items: center; padding: .9rem; }
  .next-panel .button { flex-shrink: 1; }
  .days { gap: .22rem; }
  .stop { min-height: 58px; }
  .stop small { font-size: .71rem; }
  .footer { flex-direction: column; gap: .3rem; }
  .dialog-header, #dialog-content { padding-inline: .85rem; }
  .teacher-hero { margin: .8rem 0 1rem; grid-template-columns: 1fr 15%; }
  .teacher-hero > div:first-child { padding: 1.15rem; }
  .stats div { padding: .5rem; }
}
@media (max-width: 365px) {
  .quest-card { padding: .72rem; }
  .next-panel { flex-direction: column; align-items: start; }
  .stop small { white-space: normal; text-align: center; }
  .lesson dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
@media print {
  .teacher .top, .teacher .footer, .teacher-hero, .teacher-tabs, .resources-controls, #toast { display: none !important; }
  .teacher { background: #fff; }
  .teacher-main, .wrap { width: 100%; }
  .lesson { break-inside: avoid; }
  .print-label { display: block; }
}
:root,body.teacher{color-scheme:light;--page:#fffafa;--surface:#fff;--raised:#fbe9eb;--ink:#321922;--muted:#69545b;--border:#dcc4c8;--accent:#a01634}
body.student{background:#fffafa}.top,.teacher .top,.trail-status,.map-panel,.chest-card,dialog,.dialog-header,.next-panel{background:white;border-color:var(--border)}
.hero,.teacher-hero{background:radial-gradient(ellipse at 85% 30%,#a91e38,transparent 55%),linear-gradient(120deg,#530a1c,#951431);color:white}.hero:after{content:'✦';position:absolute;right:10%;top:10%;font-size:clamp(5rem,18vw,14rem);color:#fff3;pointer-events:none}.hero-copy{position:relative;z-index:1}.hero .eyebrow,.hero h1 em,.hero-copy>p,.teacher-hero p{color:#fff5f6}.hero h1 em{font-style:italic}.button.gold,.teacher .button.gold{background:#a01634;color:white;border-color:#961530}.button.gold:hover,.teacher .button.gold:hover{background:#790f28}.hero .button.gold{background:white;color:#86152c;border-color:white}
.week,.week.peace,.week.joy,.week.love{--week:#921b36}.stop,.stats div{background:#fff8f8;border-color:var(--border)}.stop.is-current,.stop.is-done,.extra-icon,.teacher nav a[aria-current],nav a[aria-current]{background:#f9e2e6;border-color:#ae3954;color:#911832}.chest-art{display:grid;place-items:center;aspect-ratio:2.2;background:radial-gradient(ellipse at center,#ba3651,#780d29);color:white;font-size:3.5rem}.teacher-hero-art{background:none}.letter.found,.gift{background:#fbe9eb;color:#8d1331;border-color:#cfa3ad}progress::-webkit-progress-value{background:#ab1b3b}progress::-webkit-progress-bar{background:#f4e1e5}progress::-moz-progress-bar{background:#ab1b3b}.brand-icon,.teacher .brand-icon{color:white;background:#991d39;border-color:#991d39}.top-inner{flex-wrap:wrap}.top-controls{margin-left:auto}.memory{white-space:pre-wrap;overflow-wrap:anywhere}.quest-date{color:#855465}.form-error{color:#911832}
