:root {
  --blue: #206ea7;
  --blue-dark: #185780;
  --blue-soft: #eaf3fa;
  --page: #f2f4f7;
  --border: #dce0e5;
  --ink: #263441;
  --muted: #5c6975;
  --radius: 6px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 8px 16px; background: white; border: 2px solid var(--blue); border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
.site-header { background: white; border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1440px; min-height: 76px; margin: auto; padding: 12px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 18px; letter-spacing: .02em; white-space: nowrap; }
.brand strong { color: var(--blue); font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; margin-right: 4px; border-radius: var(--radius); background: var(--blue); color: white; font-size: 20px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 24px; }
.header-label { color: var(--muted); font-size: 13px; }
.language-switch { display: flex; align-items: center; gap: 3px; font-size: 14px; }
.language-switch > span { color: #b5bdc6; }
.language-switch button { min-height: 44px; min-width: 44px; background: none; border: 0; border-radius: var(--radius); color: var(--muted); padding: 8px; }
.language-switch button[aria-pressed="true"] { color: var(--blue); font-weight: 700; }
.language-switch button:hover { background: var(--blue-soft); }
.page { max-width: 1440px; margin: auto; padding: 42px 40px 56px; }
.hero { margin-bottom: 28px; max-width: 850px; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 650; letter-spacing: .09em; margin: 0 0 9px; }
h1 { margin: 0 0 12px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; font-weight: 700; }
.intro { margin: 0; font-size: 16px; color: var(--muted); }
.hero-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); margin-top: 16px; font-size: 13px; }
.meta-label { background: white; border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--radius); }
.meta-dot { color: #a5aeb7; }
.training-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.watch-column { min-width: 0; }
.card { background: white; border: 1px solid var(--border); border-radius: var(--radius); }
.video-frame { background: #11181f; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.video-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #11181f; }
video { display: block; width: 100%; height: 100%; object-fit: contain; }
.caption-overlay { position: absolute; bottom: 64px; left: 4%; right: 4%; text-align: center; pointer-events: none; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.4; color: white; text-shadow: 0 1px 2px black; }
.caption-line { display: table; max-width: 100%; margin: 3px auto 0; border-radius: 3px; padding: 3px 9px; background: rgb(0 0 0 / 82%); white-space: pre-wrap; overflow-wrap: anywhere; }
.player-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; background: white; color: var(--ink); }
.caption-control { display: flex; align-items: center; gap: 10px; min-width: 0; }
.caption-control label { font-size: 13px; color: var(--muted); }
.caption-control select { appearance: none; -webkit-appearance: none; min-height: 40px; max-width: 210px; padding: 6px 40px 6px 10px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%235c6975' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px; color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.fullscreen-button { min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: white; color: var(--blue); padding: 6px 12px; font-size: 14px; }
.fullscreen-button > span:first-child { font-size: 20px; line-height: 1; vertical-align: -1px; margin-right: 4px; }
.fullscreen-button:hover { background: var(--blue-soft); border-color: var(--blue); }
.watch-details { padding: 17px 0 0; }
.current-chapter { margin: 0 0 5px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.helper { margin: 0; font-size: 12px; color: var(--muted); }
.status { margin: 8px 0 0; font-size: 13px; color: var(--muted); min-height: 1.6em; }
.status[data-error="true"] { color: #96352b; }
.notice { display: flex; gap: 12px; padding: 16px 18px; margin-top: 18px; }
.notice p { margin: 0; font-size: 13px; color: var(--muted); }
.notice-icon { flex: 0 0 19px; width: 19px; height: 19px; margin-top: 2px; display: grid; place-items: center; border: 1px solid var(--blue); color: var(--blue); border-radius: 50%; font: 600 12px Georgia, serif; }
.downloads { margin-top: 16px; padding: 18px; }
h2 { margin: 0; font-size: 16px; font-weight: 650; }
.download-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 10px 0; }
.download-links a { font-size: 13px; padding: 7px 0; overflow-wrap: anywhere; }
.chapter-panel { position: sticky; top: 24px; padding: 22px 0 0; overflow: hidden; }
.chapter-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 22px; }
.chapter-count { display: grid; min-width: 26px; height: 26px; place-items: center; padding: 0 7px; background: var(--page); color: var(--muted); font-size: 12px; border-radius: var(--radius); }
.chapter-help { margin: 6px 22px 18px; font-size: 12px; color: var(--muted); }
.chapter-list { list-style: none; padding: 0; margin: 0; max-height: 590px; overflow-y: auto; scrollbar-width: thin; }
.chapter-item { border-top: 1px solid #e9ecf0; }
.chapter-button { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 16px 20px; text-align: left; color: var(--ink); background: white; border: 0; border-left: 3px solid transparent; }
.chapter-button:hover { background: #f7f9fb; }
.chapter-button[aria-current="true"] { border-left-color: var(--blue); background: var(--blue-soft); }
.chapter-button:focus-visible { outline-offset: -4px; }
.chapter-number { color: var(--muted); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.chapter-button[aria-current="true"] .chapter-number { color: var(--blue); font-weight: 700; }
.chapter-title { display: block; font-size: 14px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
.chapter-description { display: block; margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.chapter-time { padding-top: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chapter-footnote { margin: 0; padding: 16px 22px; background: #fafbfc; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; gap: 16px; max-width: 1360px; margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.no-script { padding: 18px; }
.video-frame:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; display: flex; flex-direction: column; background: black; }
.video-frame:fullscreen .video-stage { flex: 1; min-height: 0; aspect-ratio: auto; }
.video-frame:fullscreen .caption-overlay { font-size: clamp(26px, 3vw, 42px); bottom: 70px; }
.video-frame:fullscreen .player-toolbar { flex-shrink: 0; background: #18212b; color: white; }
.video-frame:fullscreen .caption-control label { color: #dce0e5; }
@media (min-width: 1600px) { .chapter-list { max-height: 680px; } }
@media (max-width: 1100px) {
  .training-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
  .page { padding: 32px 24px 40px; }
  .header-inner { padding-inline: 24px; }
  .site-footer { margin-inline: 24px; }
  .chapter-button { padding-inline: 14px; gap: 8px; grid-template-columns: 22px minmax(0, 1fr) auto; }
}
@media (max-width: 820px) {
  .training-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .chapter-panel { position: static; }
  .chapter-list { max-height: none; }
  .hero { margin-bottom: 22px; }
  .caption-overlay { font-size: clamp(18px, 3.5vw, 26px); }
}
@media (max-width: 480px) {
  .header-inner { min-height: 66px; padding: 10px 16px; }
  .header-label { display: none; }
  .brand { font-size: 15px; gap: 5px; }
  .brand strong { font-size: 11px; }
  .brand-mark { width: 27px; height: 27px; font-size: 17px; margin-right: 2px; }
  .page { padding: 28px 16px 32px; }
  .intro { font-size: 14px; }
  .player-toolbar { padding: 8px 10px; gap: 8px; }
  .caption-control { gap: 6px; }
  .caption-control select { font-size: 13px; max-width: 155px; }
  .fullscreen-button { padding-inline: 8px; font-size: 13px; }
  .caption-overlay { bottom: 55px; }
  .site-footer { margin-inline: 16px; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .15s, color .15s; } }
/* Keep larger bilingual captions readable on narrow phones without clipping. */
@media (max-width: 360px) {
  .video-frame:not(:fullscreen) .video-stage { aspect-ratio: auto; }
  .video-frame:not(:fullscreen) video { height: auto; aspect-ratio: 16 / 9; }
  .video-frame:not(:fullscreen) .caption-overlay { position: static; padding: 8px 4%; background: #11181f; }
}

/* BookStack owns the page; this document supplies only the interactive player. */
html[data-embedded="true"] { background: transparent; }
html[data-embedded="true"] :is(.site-header, .hero, .site-footer, .notice, .downloads, .chapter-help, .chapter-footnote) { display: none; }
html[data-embedded="true"] .page { max-width: none; padding: 0; }
html[data-embedded="true"] .training-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
html[data-embedded="true"] .watch-details { padding-top: 10px; }
html[data-embedded="true"] .status:not([data-error="true"]) { display: none; }
html[data-embedded="true"] .chapter-panel { position: static; padding-top: 14px; }
html[data-embedded="true"] .chapter-heading { padding: 0 14px 12px; }
html[data-embedded="true"] .chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
html[data-embedded="true"] .chapter-description { display: none; }
html[data-embedded="true"] .chapter-button { height: 100%; padding: 12px 10px; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 7px; }
html[data-embedded="true"] .chapter-title { font-size: 13px; }
@media (max-width: 520px) {
  html[data-embedded="true"] .chapter-list { grid-template-columns: minmax(0, 1fr); }
}
