/* ==========================================================================
   Training Portal — styles
   Brand: Bebas Neue (labels, headers, callouts) + Open Sans Semi Bold (body)
   ========================================================================== */

@font-face {
  font-family: "Bebas Neue";
  src: local("Bebas Neue"), local("BebasNeue-Regular"),
       url("../fonts/BebasNeue-Regular.b2b293064f55.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Regular.94d168f74b7d.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-SemiBold.ebebb4b54355.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Bold.6bbd5cf43b71.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Brand palette */
  --black: #000000;
  --white: #ffffff;
  --navy: #1F4E8C;
  --sky: #5E9FBF;
  --green: #679967;
  --red: #D41920;

  /* Derived UI tokens */
  --ink: #111418;
  --ink-2: #4a525c;
  --ink-3: #7a838e;
  --line: #dde3ea;
  --surface: #ffffff;
  --page: #f3f5f8;
  --navy-deep: #163a69;

  --font-display: "Bebas Neue", "BebasNeue", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --font-body: "Open Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Transcript panel (Spotify-lyrics look) */
  --t-grad-top: #3a3a3a;
  --t-grad-bottom: #1c1c1c;
  --cue-size: 24px;
  --cue-gutter: 52px;
  --active-pos: 0.38; /* active cue sits at 38% of panel height */

  --radius: 14px;
  --header-h: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--navy); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- header */

.site-header {
  height: var(--header-h);
  background: var(--white);
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px 6px;
  position: relative;
  z-index: 1;
}
.site-header::after { /* the logo's four-color brand bar, full width */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg,
    var(--navy) 0 25%, var(--sky) 25% 50%, var(--green) 50% 75%, var(--red) 75%);
}
.brand {
  display: flex; align-items: center; gap: 18px;
  color: inherit; text-decoration: none; min-width: 0;
}
.brand-logo { height: 52px; width: auto; }
.brand-name { font-size: 30px; white-space: nowrap; }
.brand-divider { width: 2px; height: 34px; background: var(--line); }
.brand-series {
  font-size: 26px; color: var(--navy); white-space: nowrap; padding-top: 3px;
  overflow: hidden; text-overflow: ellipsis;
}
.header-spacer { flex: 1; }
.header-link {
  color: var(--navy); text-decoration: none; font-size: 22px; padding-top: 3px;
  display: inline-flex; align-items: center; gap: 8px;
}
.header-link:hover { color: var(--sky); }

/* ---------------------------------------------------------------- library */

.library { max-width: 1480px; margin: 0 auto; padding: 36px 32px 80px; }

.hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 36px;
}
.hero-title { font-size: clamp(44px, 5vw, 68px); color: var(--navy); margin: 0; }
.hero-sub { margin: 6px 0 0; color: var(--ink-2); font-weight: 400; font-size: 17px; }

.search {
  position: relative; flex: 1 1 420px; max-width: 620px;
}
.search input {
  width: 100%; height: 56px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface);
  padding: 0 56px 0 54px; font-size: 18px; font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--ink-3); font-weight: 400; }
.search input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(94, 159, 191, 0.2); }
.search .search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; color: var(--ink-3); pointer-events: none;
}
.search .kbd {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 8px; background: var(--page);
}
.search .clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--page); color: var(--ink-2); display: grid; place-items: center;
}

.section { margin-bottom: 48px; }
.section-head {
  display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px;
}
.section-title {
  font-size: 34px; color: var(--navy); margin: 0; position: relative; padding-bottom: 6px;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 4px; background: var(--red);
}
.section-count { font-family: var(--font-display); font-size: 20px; color: var(--ink-3); }

.grid {
  display: grid; gap: 28px 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.continue-row { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06), 0 4px 16px rgba(17, 20, 24, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(17, 20, 24, 0.08), 0 12px 28px rgba(17, 20, 24, 0.1); }
.card-media { position: relative; aspect-ratio: 16 / 9; background: var(--navy-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .play-hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(31, 78, 140, 0.35); opacity: 0; transition: opacity 0.18s;
}
.card:hover .play-hint { opacity: 1; }
.play-hint span {
  width: 64px; height: 64px; border-radius: 50%; background: var(--white);
  display: grid; place-items: center; color: var(--navy);
}
.badge {
  position: absolute; right: 10px; bottom: 12px;
  font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.78); color: var(--white); padding: 3px 8px 1px; border-radius: 6px;
}
.badge-watched {
  left: 10px; right: auto; background: var(--green); display: inline-flex; align-items: center; gap: 4px;
}
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, 0.35); }
.card-progress > i { display: block; height: 100%; background: var(--sky); }
.card-progress.is-watched > i { background: var(--green); }
.card-body { padding: 16px 18px 20px; }
.card-order { font-family: var(--font-display); color: var(--sky); font-size: 18px; letter-spacing: 0.04em; }
.card-title { margin: 2px 0 6px; font-size: 18px; line-height: 1.3; }
.card-desc {
  margin: 0; font-weight: 400; color: var(--ink-2); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-resume { margin-top: 10px; font-size: 14px; color: var(--navy); }

.empty {
  background: var(--surface); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--ink-2);
}
.empty code { background: var(--page); padding: 2px 6px; border-radius: 4px; }

/* ------------------------------------------------------- global search results */

.results-summary { color: var(--ink-2); margin: -8px 0 24px; font-weight: 400; }
.result-group {
  background: var(--surface); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06);
}
.result-head {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.result-head img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--navy-deep); }
.result-head h3 { margin: 0; font-size: 18px; }
.result-head .meta { font-family: var(--font-display); color: var(--sky); font-size: 17px; letter-spacing: 0.04em; }
.hit {
  display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 14px 20px;
  text-decoration: none; color: inherit; border-bottom: 1px solid var(--line);
}
.hit:last-child { border-bottom: 0; }
.hit:hover { background: #f5f9fc; }
.hit-time {
  font-family: var(--font-display); font-size: 20px; color: var(--white); background: var(--navy);
  border-radius: 6px; text-align: center; padding: 4px 0 2px; align-self: start; letter-spacing: 0.04em;
}
.hit-chapter .hit-time { background: var(--green); }
.hit-ctx { margin: 0; font-weight: 400; color: var(--ink-3); font-size: 15px; }
.hit-main { margin: 2px 0; font-size: 17px; }
.hit-label { font-family: var(--font-display); color: var(--green); font-size: 16px; letter-spacing: 0.04em; margin-right: 6px; }
mark { background: rgba(94, 159, 191, 0.3); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ================================================================ player page */

.player-page { padding-bottom: 60px; }

.stage-band { background: #0d0f12; padding: 24px 32px; }

.stage {
  --pad-x: 32px;
  --gap: 16px;
  --rail-w: 0px;
  --rail-gap: 0px;
  --panel-min: 340px;
  --chrome-h: 216px;
  --avail-w: calc(100vw - 2 * var(--pad-x) - var(--rail-w) - var(--rail-gap) - var(--gap));
  --avail-h: calc(100vh - var(--chrome-h));
  --h: max(280px, min(calc(var(--avail-w) / 2.3403), calc((var(--avail-w) - var(--panel-min)) * 0.5625), var(--avail-h)));
  --video-w: calc(var(--h) * 16 / 9);
  --panel-w: max(calc(var(--h) * 0.5625), var(--panel-min));

  display: grid;
  justify-content: center;
  gap: var(--gap) var(--gap);
  grid-template-columns: var(--video-w) var(--panel-w);
  grid-template-rows: var(--h);
  grid-template-areas: "video panel";
  color: var(--white);
}
.stage.panel-left { grid-template-columns: var(--panel-w) var(--video-w); grid-template-areas: "panel video"; }
/* Chapter rail sits under the stage until there's room beside it (≥1440px) */
.stage.has-chapters { grid-template-rows: var(--h) auto; grid-template-areas: "video panel" "rail rail"; }
.stage.has-chapters.panel-left { grid-template-areas: "panel video" "rail rail"; }

.video-wrap { grid-area: video; }
.transcript { grid-area: panel; }
.rail { grid-area: rail; }

@media (min-width: 1440px) {
  .stage.has-chapters { --rail-w: 240px; --rail-gap: var(--gap); }
  .stage.has-chapters {
    grid-template-columns: var(--rail-w) var(--video-w) var(--panel-w);
    grid-template-rows: var(--h);
    grid-template-areas: "rail video panel";
  }
  .stage.has-chapters.panel-left { grid-template-columns: var(--rail-w) var(--panel-w) var(--video-w); grid-template-areas: "rail panel video"; }
}

@media (max-width: 1199.98px) {
  .stage-band { padding: 16px; }
  .stage, .stage.panel-left, .stage.has-chapters {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 40vh auto;
    grid-template-areas: "video" "panel" "rail";
  }
  .video-wrap { width: 100%; aspect-ratio: 16 / 9; }
}

/* Fullscreen: whole stage, video + transcript */
.stage:fullscreen { background: #0d0f12; padding: 16px 24px; align-content: center; --pad-x: 24px; --chrome-h: 32px; }
.stage:-webkit-full-screen { background: #0d0f12; padding: 16px 24px; align-content: center; --pad-x: 24px; --chrome-h: 32px; }
.stage:fullscreen .rail { max-height: var(--h); }

/* ---------------------------------------------------------------- video */

.video-wrap {
  position: relative; background: var(--black); border-radius: var(--radius); overflow: hidden;
}
.video-wrap video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.video-wrap video::cue {
  font-family: var(--font-body); font-weight: 600; font-size: 0.9em;
  background: rgba(0, 0, 0, 0.75); color: #fff;
}
.video-wrap.is-idle.is-playing { cursor: none; }

.big-play {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%;
  border: 0; background: var(--navy); color: var(--white); display: grid; place-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); transition: transform 0.15s, background 0.15s;
}
.big-play:hover { transform: scale(1.06); background: var(--sky); }
.big-play svg { width: 40px; height: 40px; margin-left: 6px; }

.toast {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72); color: #fff; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.is-on { opacity: 1; }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  transition: opacity 0.25s;
}
.video-wrap.is-idle.is-playing .controls { opacity: 0; }

.scrubber {
  position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.scrub-track { position: relative; width: 100%; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); transition: height 0.12s; }
.scrubber:hover .scrub-track, .scrubber.is-dragging .scrub-track { height: 8px; }
.scrub-buffer, .scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.scrub-buffer { background: rgba(255, 255, 255, 0.35); }
.scrub-fill { background: var(--sky); }
.scrub-thumb {
  position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transform: scale(0); transition: transform 0.12s;
}
.scrubber:hover .scrub-thumb, .scrubber.is-dragging .scrub-thumb, .scrubber:focus-visible .scrub-thumb { transform: scale(1); }
.tick { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--white); border-radius: 2px; opacity: 0.85; }
.scrub-tip {
  position: absolute; bottom: 26px; transform: translateX(-50%); white-space: nowrap;
  background: rgba(0, 0, 0, 0.88); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 6px;
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
.scrub-tip b { font-family: var(--font-display); font-weight: 400; font-size: 16px; letter-spacing: 0.04em; margin-right: 6px; color: var(--sky); }
.scrubber:hover .scrub-tip, .scrubber.is-dragging .scrub-tip { opacity: 1; }

.control-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cbtn {
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--white);
  border-radius: 8px; display: grid; place-items: center; opacity: 0.92;
}
.cbtn:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.cbtn svg { width: 24px; height: 24px; }
.cbtn.is-on { color: var(--sky); }
.time { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; margin: 0 8px; white-space: nowrap; padding-top: 3px; }
.time .sep { opacity: 0.5; margin: 0 4px; }
.control-row .grow { flex: 1; }
.volume { display: flex; align-items: center; }
.volume input { width: 0; opacity: 0; transition: width 0.2s, opacity 0.2s; accent-color: var(--sky); }
.volume:hover input, .volume input:focus-visible { width: 90px; opacity: 1; margin-right: 6px; }
.speed {
  height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.45); color: var(--white); padding: 0 10px; cursor: pointer;
  font-family: var(--font-display); font-size: 19px; letter-spacing: 0.04em; padding-top: 2px;
}
.speed:hover { border-color: var(--white); }
.speed.is-on { border-color: var(--sky); color: var(--sky); }  /* not 1× — make it obvious */
.speed option { color: var(--ink); }

/* ---------------------------------------------------------------- transcript */

.transcript {
  position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--t-grad-top), var(--t-grad-bottom));
}
.t-head { display: flex; align-items: center; gap: 4px; padding: 12px 12px 6px 20px; flex-wrap: wrap; }
.t-title { font-size: 24px; color: var(--white); margin-right: auto; padding-top: 3px; }
.tbtn {
  min-width: 34px; height: 34px; padding: 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: rgba(255, 255, 255, 0.72);
  display: inline-grid; place-items: center; font-size: 14px; font-weight: 700;
}
.tbtn:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.tbtn.is-on { color: var(--sky); }
.tbtn svg { width: 20px; height: 20px; }
.tbtn:disabled { opacity: 0.3; cursor: default; background: transparent; }

.t-search {
  display: flex; align-items: center; gap: 4px; margin: 0 12px 6px; padding: 0 4px 0 12px;
  background: rgba(255, 255, 255, 0.1); border-radius: 10px; height: 40px;
}
.t-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--white); outline: none; font-size: 15px;
}
.t-search input::placeholder { color: rgba(255, 255, 255, 0.45); font-weight: 400; }
.t-count { font-size: 13px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; margin-right: 2px; }

.t-scroller {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%);
  --sh: 400px;
  position: relative;
}
.t-scroller::-webkit-scrollbar { width: 6px; }
.t-scroller::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }

.cues {
  list-style: none; margin: 0;
  padding: calc(var(--sh) * var(--active-pos)) 24px calc(var(--sh) * 0.62) var(--cue-gutter);
}
.cue {
  position: relative; margin: 0 0 0.7em; cursor: pointer;
  font-size: var(--cue-size); font-weight: 700; line-height: 1.32; letter-spacing: -0.005em;
  color: var(--white); opacity: 0.55;
  transform-origin: 0 50%;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cue.is-past { opacity: 0.3; }
.cue.is-active { opacity: 1; transform: scale(1.02); }
.cue:hover { opacity: 0.85; }
.cue.is-active:hover { opacity: 1; }
.cue .ts {
  position: absolute; right: calc(100% + 12px); top: 0.35em;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; line-height: 1;
  color: rgba(255, 255, 255, 0.5); opacity: 0; transition: opacity 0.15s; font-variant-numeric: tabular-nums;
}
.cue:hover .ts, .transcript.show-ts .cue .ts { opacity: 1; }
.cue mark { background: rgba(94, 159, 191, 0.45); color: inherit; border-radius: 4px; padding: 0 2px; }
.cue mark.is-current { background: var(--sky); box-shadow: 0 0 0 2px var(--white); }
.cue.flash { animation: flash 1.6s ease-out; }
@keyframes flash {
  0%, 30% { text-shadow: 0 0 18px rgba(94, 159, 191, 0.9); }
  100% { text-shadow: none; }
}
.t-empty { color: rgba(255, 255, 255, 0.55); font-weight: 400; font-size: 16px; padding: 24px; }

.back-pill {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 12px);
  border: 0; border-radius: 999px; padding: 10px 18px;
  background: var(--white); color: var(--ink); font-size: 14px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.back-pill.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.back-pill:hover { background: #e9f2f8; }

/* ---------------------------------------------------------------- chapter rail */

.rail {
  background: #1a1d22; border-radius: var(--radius); padding: 16px 10px; overflow-y: auto; min-height: 0;
}
.rail-title { font-size: 22px; color: var(--white); margin: 0 10px 10px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; width: 100%;
  text-align: left; border: 0; background: transparent; color: rgba(255, 255, 255, 0.72);
  padding: 10px; border-radius: 10px; font-size: 15px; line-height: 1.35;
}
.step:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
.step-num {
  font-family: var(--font-display); font-size: 18px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); padding-top: 2px;
}
.step-time { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.45); margin-top: 2px; font-weight: 400; }
.step.is-done .step-num { background: var(--green); color: var(--white); }
.step.is-current { background: rgba(94, 159, 191, 0.18); color: var(--white); }
.step.is-current .step-num { background: var(--sky); color: var(--white); }

@media (max-width: 1439.98px) {
  .rail { padding: 12px; }
  .steps { display: flex; gap: 8px; overflow-x: auto; }
  .steps li { flex: 0 0 auto; }
  .step { width: auto; max-width: 280px; }
}

/* ---------------------------------------------------------------- details */

.details {
  max-width: 1480px; margin: 0 auto; padding: 28px 32px 0;
  display: grid; grid-template-columns: 1fr auto; gap: 16px 40px; align-items: start;
}
.details-module { font-family: var(--font-display); color: var(--sky); font-size: 22px; letter-spacing: 0.04em; }
.details-title { font-size: clamp(36px, 3.2vw, 52px); color: var(--navy); margin: 4px 0 10px; }
.details-desc { margin: 0; font-weight: 400; color: var(--ink-2); font-size: 17px; max-width: 70ch; }
.details-nav { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.nav-btn {
  display: inline-flex; flex-direction: column; gap: 2px; min-width: 200px; max-width: 280px;
  padding: 12px 18px; border-radius: 12px; text-decoration: none;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
.nav-btn:hover { border-color: var(--sky); }
.nav-btn .label { font-family: var(--font-display); color: var(--sky); font-size: 17px; letter-spacing: 0.04em; }
.nav-btn .t { font-size: 15px; line-height: 1.3; }
.nav-btn.next { text-align: right; background: var(--navy); border-color: var(--navy); color: var(--white); }
.nav-btn.next .label { color: #cfe2ee; }
.nav-btn.next:hover { background: var(--navy-deep); }
.shortcuts {
  grid-column: 1 / -1; color: var(--ink-3); font-size: 14px; font-weight: 400; margin-top: 8px;
}
.shortcuts kbd {
  font-family: var(--font-body); font-weight: 600; font-size: 12px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 5px; padding: 1px 6px; color: var(--ink-2);
}

@media (max-width: 899px) {
  .details { grid-template-columns: 1fr; }
  .details-nav { justify-content: flex-start; }
  .site-header { padding: 0 16px 6px; }
  .brand-logo { height: 40px; }
  .brand-series, .brand-divider { display: none; }
  .library { padding: 24px 16px 60px; }
}

.error-box { max-width: 640px; margin: 80px auto; background: var(--surface); padding: 32px; border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- glossary */

abbr.gl { text-decoration: underline dotted rgba(255, 255, 255, 0.45); text-underline-offset: 0.18em; cursor: help; }
.header-link + .header-link { margin-left: 8px; }

.glossary-page { max-width: 1100px; margin: 0 auto; padding: 36px 32px 80px; }
.glossary-page .search { max-width: 460px; margin: 0 0 28px; }
.gl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gl-item {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 16px 22px;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06);
}
.gl-term { font-family: var(--font-display); font-size: 30px; color: var(--navy); letter-spacing: 0.03em; line-height: 1; padding-top: 3px; }
.gl-term.is-name { font-size: 22px; }
.gl-meaning { margin: 0; font-size: 17px; }
.gl-count { font-weight: 400; color: var(--ink-3); font-size: 14px; display: block; margin-top: 2px; }
.gl-find {
  font-family: var(--font-display); font-size: 17px; letter-spacing: 0.04em; text-decoration: none;
  color: var(--navy); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px 4px; white-space: nowrap;
}
.gl-find:hover { border-color: var(--sky); }
@media (max-width: 700px) {
  .gl-item { grid-template-columns: 1fr; gap: 6px; }
  .glossary-page { padding: 24px 16px 60px; }
}

/* Search fields have their own clear/close buttons; hide the browser's built-in one. */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

.hit-video .hit-time { background: var(--sky); }
.hit-video .hit-label { color: var(--navy); }

/* ---------------------------------------------------------------- contents (all trainings) */

.toc details { background: var(--surface); border-radius: var(--radius); padding: 18px 22px 10px;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06); }
.toc summary { list-style: none; cursor: pointer; margin: 0 0 10px; }
.toc summary::-webkit-details-marker { display: none; }
.toc-toggle { margin-left: auto; width: 12px; height: 12px; border-right: 3px solid var(--ink-3);
  border-bottom: 3px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s; margin-top: -6px; }
.toc details:not([open]) .toc-toggle { transform: rotate(-45deg); }
.toc details:not([open]) summary { margin-bottom: 4px; }
.toc-list { list-style: none; margin: 0; padding: 0; columns: 2 420px; column-gap: 32px; }
.toc-item { break-inside: avoid; border-bottom: 1px solid var(--line); }
.toc-item > a, .toc-item.is-soon { display: flex; align-items: baseline; gap: 12px; padding: 9px 4px;
  text-decoration: none; color: var(--ink); }
.toc-item > a:hover { background: #f5f9fc; }
.toc-item > a:hover .toc-title { color: var(--navy); text-decoration: underline; }
.toc-num { font-family: var(--font-display); font-size: 19px; color: var(--sky); min-width: 40px; letter-spacing: 0.03em; }
.toc-title { flex: 1; font-size: 15px; line-height: 1.35; }
.toc-dur { font-size: 13px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.toc-tag { font-size: 12px; font-weight: 700; white-space: nowrap; border-radius: 999px; padding: 2px 9px;
  background: var(--page); color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.toc-tag.is-done { background: var(--green); color: var(--white); }
.toc-tag.is-progress { background: rgba(94, 159, 191, 0.18); color: var(--navy); }
.toc-item.is-soon .toc-title { color: var(--ink-3); }
.toc-item.is-soon .toc-num { color: var(--ink-3); }
