@font-face {
  font-family: Manrope;
  src: url("../assets/web/manrope-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("../assets/web/manrope-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17363b;
  --muted: #4a5e60;
  --teal: #126473;
  --deep: #18454d;
  --paper: #f7f3e9;
  --sand: #e9e1d1;
  --line: #bcb2a0;
  --gold: #d6b67c;
  --focus: #0a6e80;
  --edge: clamp(1rem, 3vw, 2.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 1rem/1.55 Manrope, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 85% 0%, #d0d8d0 0, transparent 56%),
    radial-gradient(ellipse at 5% 38%, #f0e8d9 0, transparent 64%),
    #e4ded3;
}
button, select, input { font: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
h1, h2, p { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: absolute;
  z-index: 8;
  inset: .75rem auto auto .75rem;
  background: var(--paper);
  color: var(--ink);
  padding: .8rem 1rem;
}
.frame { width: min(100%, 94rem); margin-inline: auto; padding-inline: var(--edge); }
.brandbar {
  background: #f6f1e7;
  box-shadow: 0 1px 0 #bcb2a08c;
}
.brandbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .9rem;
  align-items: center;
  min-height: 4.65rem;
}
.brand-mark { justify-self: start; display: block; padding-block: .3rem; }
.brand-mark img { width: clamp(3.3rem, 8vw, 6.25rem); height: auto; max-height: 2.9rem; object-fit: contain; }
.motto {
  font: italic 800 clamp(.8rem, 2.3vw, 1.65rem)/1 "Century Gothic", Manrope, sans-serif;
  letter-spacing: -.035em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-right { display: flex; gap: clamp(.45rem, 2vw, 1.25rem); justify-self: end; align-items: center; min-width: 0; }
.district-mark {
  display: block;
  position: relative;
  overflow: hidden;
  flex: none;
  width: clamp(4rem, 10vw, 8.6rem);
  aspect-ratio: 715 / 302;
}
.district-mark img { position: absolute; width: 262.24%; height: auto; left: -147.69%; top: -126.82%; }
.language-nav {
  display: flex;
  gap: .2rem;
  background: var(--sand);
  border: 1px solid #c5baaa;
  padding: .13rem;
  border-radius: .6rem;
}
.language-nav a {
  display: grid;
  place-items: center;
  min-width: 2.45rem;
  min-height: 2.4rem;
  text-decoration: none;
  border-radius: .45rem;
  font-size: .81rem;
  font-weight: 800;
}
.language-nav a[aria-current] { background: var(--deep); color: #fff; }
.language-nav a:hover { text-decoration: underline; text-underline-offset: .18em; }
.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  padding-block: .9rem .55rem;
}
.page-actions { display: flex; gap: .6rem .95rem; flex-wrap: wrap; align-items: center; }
.text-link {
  color: var(--deep);
  font-weight: 800;
  text-underline-offset: .2em;
}
.back-link { display: inline-flex; min-height: 2.75rem; align-items: center; gap: .55rem; }
.edition {
  background: #e9ede3;
  border: 1px solid #a9b4a8;
  color: #294747;
  padding: .32rem .72rem;
  border-radius: .5rem;
  font-weight: 800;
  font-size: .84rem;
}
.page-heading { padding-block: .5rem clamp(1.05rem, 2vw, 1.65rem); }
.page-heading h1 {
  font-size: clamp(1.9rem, 4.3vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: 1.08;
  margin-block-end: .65rem;
}
.page-heading p { max-width: 44rem; color: var(--muted); font-size: clamp(.96rem, 1.65vw, 1.12rem); }
.state-panel { padding: 1.3rem; margin-block-end: 1.5rem; border: 1px solid var(--line); background: var(--paper); border-radius: 1rem; }
.state-panel button { margin-block-start: .8rem; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0,1.48fr) minmax(0,1fr);
  gap: clamp(1rem, 2.6vw, 2rem);
  align-items: start;
}
.surface { min-width: 0; padding: clamp(.75rem, 1.7vw, 1.3rem); border-radius: 1rem; }
.slide-panel {
  border: 1px solid #c9bdab;
  background: var(--paper);
  box-shadow: 0 4px 0 #a89f8e, 0 15px 36px #1d39351a;
}
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: .75rem; margin-block-end: .85rem; }
.panel-heading h2 { font-size: clamp(1.02rem, 2.1vw, 1.54rem); line-height: 1.25; letter-spacing: -.04em; overflow-wrap: anywhere; }
.slide-number { color: var(--teal); font-weight: 800; font-size: .8rem; margin-block-end: .18rem; font-variant-numeric: tabular-nums; }
.slide-section { font-size: .79rem; color: var(--muted); margin-block-start: .22rem; }
.slide-stage {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: .4rem;
  border-radius: .72rem;
  border: 1px solid #0f353e;
  background: #17363b;
  color: #fff;
  text-align: start;
  box-shadow: 0 4px 0 #0d2b31;
  gap: .15rem;
  touch-action: manipulation;
}
.slide-stage:active { transform: translateY(2px); box-shadow: 0 2px 0 #0d2b31; }
.slide-stage img, .slide-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: .34rem;
}
.slide-stage img { height: auto; object-fit: contain; }
.slide-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .5rem;
  padding: clamp(.6rem, 2.7vw, 2.5rem);
  background: linear-gradient(145deg, #f3eee0, #dfd8cb);
  color: var(--ink);
  overflow: hidden;
  overflow-wrap: anywhere;
}
.slide-placeholder strong { font-size: clamp(.95rem, 3vw, 1.85rem); line-height: 1.2; }
#preview-summary { white-space: pre-line; font-size: clamp(.77rem, 1.55vw, 1.02rem); line-height: 1.38; overflow: auto; }
#preview-error { font-size: .85rem; }
.stage-action {
  padding: .35rem .7rem;
  align-self: end;
  justify-self: end;
  color: #fbe8c2;
  font-weight: 800;
  font-size: .84rem;
}
.slide-stage:hover .stage-action { color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.slide-navigation {
  display: grid;
  grid-template-columns: 1fr minmax(0,1fr) 1fr;
  gap: .55rem;
  align-items: start;
  margin-top: 1rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  text-decoration: none;
  text-align: center;
  padding: .42rem .7rem;
  border: 1px solid #a89c85;
  border-radius: .62rem;
  background: linear-gradient(#f9f5eb, #e8e1d1);
  box-shadow: 0 3px 0 #a99f8d;
  color: var(--ink);
  font-weight: 800;
  font-size: .89rem;
  transition: background .14s, box-shadow .14s, transform .14s;
  touch-action: manipulation;
}
.button:not(:disabled):hover { background: #fff9ed; }
.button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #a99f8d; }
.button:disabled { opacity: .55; cursor: default; }
.button-icon { min-width: 2.75rem; padding: .42rem; flex: none; }
.button-primary {
  background: linear-gradient(#ebd29e, #cfaf72);
  border-color: #efdcb7;
  box-shadow: 0 3px 0 #ad864a;
  color: #222d2c;
}
.button-primary:not(:disabled):hover { background: #f6dbab; }
.button-primary:not(:disabled):active { box-shadow: 0 1px 0 #ad864a; }
.top-download { min-height: 2.75rem; }
.slide-menu { min-width: 0; position: relative; z-index: 2; }
.slide-menu-trigger { width: 100%; list-style: none; }
.slide-menu-trigger::-webkit-details-marker { display: none; }
.slide-menu[open] .slide-menu-trigger { border-color: #438089; background: #edf1e8; }
.slide-menu-body {
  position: absolute;
  top: calc(100% + .55rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(29rem, calc(100vw - 2 * var(--edge) - 1.7rem));
  background: var(--paper);
  border: 1px solid #a9a08e;
  border-radius: .75rem;
  padding: .7rem;
  box-shadow: 0 8px 24px #1b383745;
}
.slide-menu-body label { display: block; font-weight: 800; font-size: .83rem; margin-block-end: .3rem; }
.slide-menu-body input {
  width: 100%;
  min-height: 2.7rem;
  margin-block-end: .55rem;
  padding: .4rem .65rem;
  color: var(--ink);
  background: #fffcf7;
  border: 1px solid #9caa9e;
  border-radius: .44rem;
}
.slide-menu-body ol { list-style: none; margin: 0; padding: .15rem; max-height: min(16rem, 40vh); overflow-y: auto; }
.slide-menu-body li + li { margin-block-start: .14rem; }
.slide-menu-body li button {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .45rem;
  width: 100%;
  min-height: 2.75rem;
  text-align: start;
  align-items: center;
  border: 1px solid transparent;
  border-radius: .42rem;
  color: var(--ink);
  background: transparent;
  padding: .32rem .4rem;
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.slide-menu-body li button > span:first-child { font-weight: 800; font-variant-numeric: tabular-nums; }
.slide-menu-body li button:hover, .slide-menu-body li button[aria-current] { border-color: #9aab9d; background: #e3ece1; }
.slide-menu-body li button[aria-current] { font-weight: 800; }

.narration-panel {
  background: radial-gradient(ellipse at 100% 0, #2b5456, transparent 61%), #19383d;
  color: #f8f4e9;
  border: 1px solid #12363e;
  box-shadow: 0 4px 0 #102c32, 0 15px 34px #17313622;
}
.narration-heading { align-items: center; padding-block-end: .65rem; border-block-end: 1px solid #abc0b452; }
.narration-panel :focus-visible { outline-color: #f5d991; }
.pace { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.pace label { font-size: .84rem; font-weight: 800; color: #e8e2d1; }
.pace select {
  min-height: 2.6rem;
  padding: .3rem .42rem;
  min-width: 0;
  color: var(--ink);
  background: #f0e9da;
  border: 1px solid #d6cdb9;
  border-radius: .48rem;
  font-size: .82rem;
}
.narration-scroll {
  min-height: clamp(10rem, 29vh, 18rem);
  max-height: min(42vh, 25rem);
  overflow-y: auto;
  scrollbar-color: #719192 #213b40;
  scrollbar-gutter: stable;
  padding: .65rem .65rem .75rem .2rem;
}
.speech-hint { margin-top: .4rem; color: #dce3d6; font-size: .94rem; }
#narration-content { white-space: pre-line; font-size: clamp(1rem, 1.6vw, 1.17rem); line-height: 1.7; overflow-wrap: anywhere; }
#narration-content p + p { margin-top: .85em; }
.reading-progress { display: grid; gap: .25rem; padding-block: .65rem .75rem; }
.reading-progress progress { width: 100%; height: .48rem; border: 0; border-radius: 1rem; background: #668a8e; accent-color: var(--gold); }
.reading-progress progress::-webkit-progress-bar { border-radius: 1rem; background: #668a8e; }
.reading-progress progress::-webkit-progress-value { border-radius: 1rem; background: var(--gold); }
.reading-progress progress::-moz-progress-bar { border-radius: 1rem; background: var(--gold); }
.reading-progress p { color: #dedccc; font-size: .76rem; font-variant-numeric: tabular-nums; }
.reading-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: stretch; gap: .5rem; margin-block-end: .55rem; }
.reading-controls .button { min-width: 0; overflow-wrap: anywhere; }
.reading-controls .button-icon { min-width: 2.75rem; }
.source-notice { margin-top: .75rem; color: #dedccc; font-size: .79rem; }
.trainer-cues { margin-top: .9rem; border-block-start: 1px solid #abc0b452; }
.trainer-cues summary { padding: .75rem .15rem .1rem; color: #fbe8c2; font-size: .87rem; font-weight: 800; }
.trainer-cues ul { margin: .55rem 0 .25rem; padding-inline-start: 1.35rem; font-size: .89rem; }
.trainer-cues li { white-space: pre-line; overflow-wrap: anywhere; }
.trainer-cues li + li { margin-top: .55rem; }
.workspace-footer {
  display: flex;
  justify-content: flex-end;
  margin-block: 1.55rem 1.1rem;
  color: var(--muted);
  font-size: .84rem;
}

@media (max-width: 55rem) {
  .workspace-grid { grid-template-columns: minmax(0,1fr); }
  .narration-scroll { min-height: 9rem; max-height: max(15rem, 43vh); }
}
@media (max-width: 36rem) {
  .brandbar-inner { grid-template-columns: auto 1fr auto; gap: .4rem; min-height: 3.55rem; padding-inline: .6rem; }
  .motto { text-align: center; }
  .brand-right { gap: .16rem; }
  .district-mark { width: clamp(3rem, 11vw, 4.45rem); }
  .language-nav { gap: .08rem; padding: .08rem; }
  .language-nav a { min-width: 1.87rem; min-height: 2.48rem; font-size: .72rem; }
  .page-top { align-items: flex-start; padding-block-start: .6rem; }
  .page-heading { padding-block-start: .3rem; }
  .page-actions { justify-content: flex-start; }
  .page-heading h1 { line-height: 1.08; }
  .button-nav, .slide-menu-trigger { font-size: .78rem; padding-inline: .27rem; gap: .25rem; }
  .reading-controls .button { font-size: .77rem; padding-inline: .28rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
