/* ==========================================================================
   CROSSFIGHT — TECHNICAL PROGRAM
   Same brand system as crossfight.academy (palette sampled from the badge),
   retuned for a working tool: denser spacing, more surface, same hard edges.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=Barlow:wght@300;400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  --paper:        #F6F4F0;
  --paper-2:      #EDEAE4;
  --ink:          #1A1919;
  --deep:         #0C0C0C;
  --red:          #B43933;
  --red-dark:     #8E2B26;
  --red-on-dark:  #E2564C;
  --steel:        #939490;

  --bg:            var(--paper);
  --fg:            var(--ink);
  --fg-muted:      #5C5A57;
  --surface:       #FFFFFF;
  --surface-alt:   var(--paper-2);
  --border:        #D9D5CD;
  --border-strong: #BEB8AD;
  --accent:        var(--red);
  --on-accent:     #FFFFFF;
  --ring:          var(--red);

  --dark-bg:     var(--ink);
  --dark-fg:     #F6F4F0;
  --dark-muted:  #A8A6A1;
  --dark-border: #343231;

  /* Status */
  --ok:      #2E6B4F;
  --ok-bg:   #E4EFE9;
  --warn:    #8A6516;
  --warn-bg: #F6EEDC;

  --space-3xs: 4px; --space-2xs: 8px; --space-xs: 12px;
  --space-sm: 16px; --space-md: 24px; --space-lg: 40px;
  --space-xl: 64px; --space-2xl: 96px;

  --step--2: 0.75rem;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(0.95rem, 0.93rem + 0.12vw, 1rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 1.9vw, 3rem);
  --step-4:  clamp(2.6rem, 1.8rem + 3.6vw, 4.6rem);

  --font-display: 'Barlow Condensed', 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 2px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(12,12,12,.06), 0 4px 12px rgba(12,12,12,.05);
  --shadow-md: 0 2px 4px rgba(12,12,12,.07), 0 16px 40px rgba(12,12,12,.09);

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: 180ms;
  --container: 1320px;
  --bar-h: 60px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
button { font: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700; line-height: .98;
  letter-spacing: -0.005em; text-transform: uppercase;
  margin: 0 0 var(--space-sm); text-wrap: balance;
}
h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); letter-spacing: .04em; }
p { margin: 0 0 var(--space-sm); max-width: 70ch; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: var(--radius); }
.on-dark :focus-visible { outline-color: var(--red-on-dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.skip-link {
  position: absolute; left: var(--space-sm); top: -100px;
  background: var(--ink); color: var(--paper); padding: 10px 18px; z-index: 200;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; text-decoration: none;
}
.skip-link:focus { top: var(--space-2xs); }

.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ==========================================================================
   App bar
   ========================================================================== */
.appbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--deep); color: var(--dark-fg);
  border-bottom: 1px solid #000;
}
.appbar__in {
  width: min(100% - 2 * var(--space-md), var(--container));
  margin-inline: auto; min-height: var(--bar-h);
  display: flex; align-items: center; gap: var(--space-md);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__badge { width: 34px; height: 34px; border-radius: var(--radius-pill); }
.brand__txt { display: flex; flex-direction: column; line-height: 1; }
.brand__txt b {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .02em;
}
.brand__txt i {
  font-style: normal; font-family: var(--font-display); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em; color: var(--red-on-dark); margin-top: 3px;
}

.appnav { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; scrollbar-width: thin; }
.appnav__a {
  font-family: var(--font-display); font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; white-space: nowrap;
  color: var(--dark-muted); text-decoration: none;
  padding: 8px 12px; border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.appnav__a:hover { color: var(--dark-fg); }
.appnav__a.is-on { color: var(--dark-fg); border-bottom-color: var(--red-on-dark); }

.appbar__end { margin-left: auto; flex: none; }

.menu { position: relative; }
.menu__btn {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  padding: 6px 8px; color: var(--dark-fg);
}
.menu__btn::-webkit-details-marker { display: none; }
.avatar {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--red); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
}
.menu__name { font-size: var(--step--1); }
.menu__pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; padding: 6px; z-index: 70;
}
.menu__meta {
  font-size: var(--step--2); color: var(--fg-muted); padding: 8px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all;
}
.menu__pop a, .menu__pop button {
  text-align: left; padding: 9px 10px; text-decoration: none; font-size: var(--step--1);
  background: none; border: 0; color: inherit; width: 100%;
}
.menu__pop a:hover, .menu__pop button:hover { background: var(--surface-alt); }
.menu__pop form { margin: 0; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

@media (max-width: 900px) {
  .menu__name { display: none; }
  .brand__txt i { display: none; }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.main {
  flex: 1 0 auto;
  width: min(100% - 2 * var(--space-md), 1040px);
  margin-inline: auto; padding-block: var(--space-lg) var(--space-xl);
}
.main--wide { width: min(100% - 2 * var(--space-md), var(--container)); }
body.is-bare .main { width: 100%; padding: 0; }

.appfoot {
  flex: none; border-top: 1px solid var(--border); background: var(--surface-alt);
  padding-block: var(--space-md); font-size: var(--step--1); color: var(--fg-muted);
}
.appfoot__in {
  width: min(100% - 2 * var(--space-md), var(--container)); margin-inline: auto;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.appfoot__dot { opacity: .5; }

.flash { background: var(--ok-bg); border-bottom: 2px solid var(--ok); }
.flash--err { background: #F7E6E5; border-bottom-color: var(--red); }
.flash__in {
  width: min(100% - 2 * var(--space-md), var(--container)); margin-inline: auto;
  padding-block: 10px; font-size: var(--step--1); font-weight: 500;
}

/* ---------- Page head ---------- */
.phead { display: flex; align-items: flex-end; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.phead__t { flex: 1 1 320px; min-width: 0; }
.phead h1 { margin-bottom: 6px; }
.phead__sub { color: var(--fg-muted); font-size: var(--step--1); margin: 0; }
.phead__act { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }

/* ---------- Breadcrumb ---------- */
.crumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); margin-bottom: var(--space-sm);
}
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--red); }
.crumb span[aria-hidden] { opacity: .45; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  background: var(--red); color: var(--on-accent); border: 1px solid var(--red);
  font-family: var(--font-display); font-size: .92rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; text-decoration: none;
  border-radius: var(--radius); transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-alt); color: var(--fg); border-color: var(--fg); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #000; border-color: #000; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: .78rem; letter-spacing: .08em; }
.btn--danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.linkbtn {
  background: none; border: 0; padding: 4px 2px; color: var(--red);
  font-size: var(--step--1); font-weight: 600; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--red) 40%, transparent);
}
.linkbtn:hover { color: var(--red-dark); }
.linkbtn--quiet { color: var(--fg-muted); text-decoration-color: var(--border-strong); }
.linkbtn--quiet:hover { color: var(--red); }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: var(--space-sm); }
.field > label, .lbl {
  display: block; font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--fg-muted); margin-bottom: 6px;
}
.inp, input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font: inherit; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.inp:hover, input:hover, select:hover, textarea:hover { border-color: var(--fg-muted); }
.inp:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent);
}
.inp--lg { min-height: 52px; font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; text-transform: uppercase; }
.hint { font-size: var(--step--2); color: var(--fg-muted); margin: 5px 0 0; }
.row { display: grid; gap: var(--space-sm); }
@media (min-width: 720px) {
  .row--2 { grid-template-columns: 1fr 1fr; }
  .row--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Cards & panels
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-md);
}
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.panel__hd {
  display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap;
  padding: 12px var(--space-md); border-bottom: 1px solid var(--border); background: var(--surface-alt);
}
.panel__hd h2, .panel__hd h3 { margin: 0; }
.panel__bd { padding: var(--space-md); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  font-family: var(--font-display); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); background: var(--surface);
  white-space: nowrap;
}
.chip--red { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: #FBF1F0; }
.chip--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-bg); }
.chip--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-bg); }
.chip--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.dot { width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--border-strong); flex: none; }
.dot--planned { background: var(--border-strong); }
.dot--ready { background: var(--ok); }
.dot--filmed { background: var(--red); }

/* ---------- Meter ---------- */
.meter { height: 6px; background: var(--paper-2); border: 1px solid var(--border); overflow: hidden; }
.meter__f { height: 100%; background: var(--red); transition: width var(--dur) var(--ease); }
.meter--dark { background: #262423; border-color: var(--dark-border); }
.meter--dark .meter__f { background: var(--red-on-dark); }

/* ---------- Stats row ---------- */
.stats { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.stat { min-width: 76px; }
.stat__n {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; line-height: 1; display: block;
}
.stat__l {
  font-family: var(--font-display); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; color: var(--fg-muted); margin-top: 4px; display: block;
}
.on-dark .stat__l { color: var(--dark-muted); }

/* ==========================================================================
   Course cards (index)
   ========================================================================== */
.courses { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.ccard {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ccard:hover { border-color: var(--fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ccard__top { background: var(--ink); color: var(--dark-fg); padding: var(--space-md); }
.ccard__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ccard__top .chip { background: transparent; color: var(--dark-muted); border-color: var(--dark-border); }
.ccard__top .chip--red { color: var(--red-on-dark); border-color: color-mix(in srgb, var(--red-on-dark) 45%, transparent); }
.ccard h2 { font-size: var(--step-1); margin: 0; color: var(--dark-fg); }
.ccard__bd { padding: var(--space-md); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.ccard__sum { font-size: var(--step--1); color: var(--fg-muted); margin: 0; }
.ccard__meta { display: flex; gap: var(--space-md); font-size: var(--step--1); color: var(--fg-muted); margin-top: auto; }
.ccard__meta b { font-family: var(--font-display); font-size: 1.1rem; color: var(--fg); display: block; line-height: 1; }

/* ==========================================================================
   Course hero
   ========================================================================== */
.chero { background: var(--deep); color: var(--dark-fg); margin-bottom: var(--space-lg); }
.chero__in {
  width: min(100% - 2 * var(--space-md), var(--container)); margin-inline: auto;
  padding-block: var(--space-lg);
  display: flex; gap: var(--space-lg); align-items: flex-end; flex-wrap: wrap;
}
.chero__t { flex: 1 1 380px; min-width: 0; }
.chero h1 { color: var(--dark-fg); margin-bottom: 10px; }
.chero .eyebrow { color: var(--red-on-dark); }
.chero .eyebrow::after { background: var(--dark-border); }
.chero__sum { color: var(--dark-muted); margin: 0; font-size: var(--step--1); }
.chero__side { flex: 0 1 300px; }
.chero__act { display: flex; gap: var(--space-2xs); flex-wrap: wrap; margin-top: var(--space-md); }
.chero .btn--ghost { color: var(--dark-fg); border-color: var(--dark-border); }
.chero .btn--ghost:hover { background: #221F1F; border-color: var(--dark-muted); color: var(--dark-fg); }
.chero .chip { background: transparent; color: var(--dark-muted); border-color: var(--dark-border); }

/* ==========================================================================
   Week blocks & class cards
   ========================================================================== */
.week { margin-bottom: var(--space-lg); }
.week__hd {
  display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: var(--space-sm); border-bottom: 2px solid var(--ink);
}
.week__n {
  font-family: var(--font-display); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em;
  background: var(--ink); color: var(--paper); padding: 5px 10px; flex: none;
}
.week__title { flex: 1 1 220px; min-width: 0; }
.week__focus { flex: 2 1 300px; min-width: 0; }

.classes { display: grid; gap: var(--space-sm); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.klass {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius); text-decoration: none; color: inherit; overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.klass:hover { border-color: var(--fg); border-left-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.klass--ready { border-left-color: var(--ok); }
.klass--filmed { border-left-color: var(--red); }
.klass--empty { background: var(--paper-2); border-style: dashed; }
.klass--empty .klass__topic { color: var(--fg-muted); font-style: italic; text-transform: none; letter-spacing: 0; font-family: var(--font-text); font-weight: 400; font-size: var(--step--1); }

.klass__hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; }
.klass__n {
  font-family: var(--font-display); font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted);
}
.klass__icons { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--fg-muted); }
.klass__bd { padding: 6px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.klass__topic {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 700;
  text-transform: uppercase; line-height: 1.05; margin: 0;
}
.klass__techs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.klass__techs li {
  font-size: var(--step--1); color: var(--fg-muted);
  padding-left: 14px; position: relative;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.klass__techs li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 6px; height: 1px; background: var(--red);
}
.klass__foot { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; align-items: center; }

.icon { width: 15px; height: 15px; flex: none; }
.icon--on { color: var(--red); }

/* ==========================================================================
   Class editor
   ========================================================================== */
.editor { display: grid; gap: var(--space-md); align-items: start; }
@media (min-width: 1040px) { .editor { grid-template-columns: minmax(0, 1fr) 310px; } }

.side { position: sticky; top: calc(var(--bar-h) + var(--space-sm)); display: flex; flex-direction: column; gap: var(--space-sm); }
@media (max-width: 1039px) { .side { position: static; } }

.pager { display: flex; gap: var(--space-2xs); }
.pager a, .pager span {
  flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 9px 12px; background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; font-size: var(--step--2); color: var(--fg-muted);
  transition: border-color var(--dur) var(--ease);
}
.pager a:hover { border-color: var(--fg); color: var(--fg); }
.pager span { opacity: .45; }
.pager b {
  font-family: var(--font-display); font-size: .84rem; font-weight: 700; color: var(--fg);
  text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pager .pager__next { text-align: right; align-items: flex-end; }

/* ---------- Technique blocks ---------- */
.techs { display: flex; flex-direction: column; gap: var(--space-md); }

.tech {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  border-top: 3px solid var(--ink);
}
.tech__hd {
  display: flex; align-items: center; gap: var(--space-2xs);
  padding: 10px var(--space-sm); border-bottom: 1px solid var(--border); background: var(--surface-alt);
}
.tech__badge {
  font-family: var(--font-display); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--fg-muted);
}
.tech__tools { margin-left: auto; display: flex; gap: 4px; }
.iconbtn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--fg-muted); border-radius: var(--radius);
}
.iconbtn:hover { background: var(--surface); border-color: var(--border-strong); color: var(--fg); }
.iconbtn:hover.iconbtn--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.tech__bd { padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-sm); }

.details { display: flex; flex-direction: column; gap: 8px; }
.detail { display: flex; align-items: flex-start; gap: 10px; }
.detail__n {
  flex: none; width: 26px; height: 26px; margin-top: 9px;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-size: .78rem; font-weight: 700;
}
.detail--extra .detail__n { background: transparent; color: var(--red); border: 1px dashed color-mix(in srgb, var(--red) 55%, transparent); }
.detail .inp { flex: 1; min-width: 0; }
.detail__rm { margin-top: 5px; }

.subhd {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--fg-muted); margin-bottom: 8px;
}
.subhd::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.subhd .count { font-size: .68rem; letter-spacing: .08em; opacity: .8; }

.addrow { display: flex; gap: var(--space-2xs); flex-wrap: wrap; margin-top: 4px; }

/* Sticky save bar */
.savebar {
  position: sticky; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border-strong);
  padding: 10px 0; margin-top: var(--space-md);
  display: flex; gap: var(--space-2xs); align-items: center; flex-wrap: wrap;
}
.savebar__msg { font-size: var(--step--1); color: var(--fg-muted); margin-left: auto; }

/* ==========================================================================
   Mat view — read-only, big type, dark, for a phone or tablet on the mat
   ========================================================================== */
.mat { background: var(--deep); color: var(--dark-fg); min-height: 100vh; }
.mat__in { width: min(100% - 2 * var(--space-md), 900px); margin-inline: auto; padding-block: var(--space-md) var(--space-2xl); }
.mat__bar { display: flex; align-items: center; gap: var(--space-sm); padding-block: var(--space-sm); flex-wrap: wrap; }
.mat__bar .btn--ghost { color: var(--dark-fg); border-color: var(--dark-border); }
.mat__bar .btn--ghost:hover { background: #201E1E; color: var(--dark-fg); }
.mat h1 { color: var(--dark-fg); font-size: var(--step-3); margin-bottom: var(--space-2xs); }
.mat__eyebrow { color: var(--red-on-dark); font-family: var(--font-display); font-size: .8rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.mat__obj { color: var(--dark-muted); font-size: var(--step-1); max-width: 60ch; }

.mtech { border-top: 1px solid var(--dark-border); padding-top: var(--space-md); margin-top: var(--space-lg); }
.mtech h2 { color: var(--dark-fg); font-size: var(--step-2); margin-bottom: 6px; }
.mtech__cat { color: var(--red-on-dark); font-family: var(--font-display); font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin-bottom: var(--space-sm); display: block; }

.keys { list-style: none; margin: 0 0 var(--space-md); padding: 0; counter-reset: k; display: flex; flex-direction: column; gap: 12px; }
.keys li {
  counter-increment: k; position: relative; padding-left: 46px;
  font-size: var(--step-1); line-height: 1.4;
}
.keys li::before {
  content: counter(k); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-pill);
  background: var(--red); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1rem;
}
.extras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.extras li {
  position: relative; padding-left: 46px; color: var(--dark-muted); font-size: var(--step-0); line-height: 1.5;
}
.extras li::before {
  content: '+'; position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-pill);
  border: 1px dashed color-mix(in srgb, var(--red-on-dark) 55%, transparent);
  color: var(--red-on-dark); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}

.vwrap { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--dark-border); margin-bottom: var(--space-md); }
.vwrap iframe, .vwrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vnone {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  aspect-ratio: 16 / 9; background: #131111; border: 1px dashed var(--dark-border);
  color: var(--dark-muted); font-family: var(--font-display); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .16em; margin-bottom: var(--space-md);
}

/* ---------- Login ---------- */
.loginwrap { min-height: 100vh; display: grid; place-items: center; background: var(--deep); padding: var(--space-md); }
.loginbox { width: min(100%, 400px); }
.loginbox__brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: var(--space-lg); text-align: center; }
.loginbox__brand img { width: 74px; height: 74px; border-radius: var(--radius-pill); }
.loginbox__brand b { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; text-transform: uppercase; color: var(--dark-fg); letter-spacing: .02em; }
.loginbox__brand i { font-style: normal; font-family: var(--font-display); font-size: .72rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--red-on-dark); }
.loginbox .card { border-color: var(--dark-border); background: #161414; }
.loginbox .field > label { color: var(--dark-muted); }
.loginbox input { background: #0E0D0D; border-color: var(--dark-border); color: var(--dark-fg); }
.loginbox input:focus { border-color: var(--red-on-dark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-on-dark) 22%, transparent); }
.loginbox .err { color: #F0918A; font-size: var(--step--1); margin: 0 0 var(--space-sm); }

/* ---------- Empty state ---------- */
.empty {
  border: 1px dashed var(--border-strong); background: var(--surface-alt);
  padding: var(--space-xl) var(--space-md); text-align: center; border-radius: var(--radius);
}
.empty h2 { margin-bottom: 8px; }
.empty p { margin-inline: auto; color: var(--fg-muted); }

/* ---------- Tables ---------- */
.tbl { background: var(--surface); border: 1px solid var(--border); }
.tbl th, .tbl td { padding: 11px var(--space-sm); text-align: left; border-bottom: 1px solid var(--border); font-size: var(--step--1); }
.tbl th {
  font-family: var(--font-display); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--fg-muted); background: var(--surface-alt);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl__wrap { overflow-x: auto; }

/* ---------- Disclosure (danger zone etc.) ---------- */
.disclose { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.disclose > summary {
  padding: 12px var(--space-md); cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--fg-muted);
  display: flex; align-items: center; gap: 8px;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before { content: '＋'; color: var(--red); font-size: 1rem; }
.disclose[open] > summary::before { content: '－'; }
.disclose__bd { padding: 0 var(--space-md) var(--space-md); }

/* ==========================================================================
   Print — the whole course as a coach's handout
   ========================================================================== */
@media print {
  :root { --bg: #fff; }
  .appbar, .appfoot, .savebar, .phead__act, .chero__act, .skip-link, .flash, .noprint { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .main, .main--wide { width: 100%; padding: 0; }
  .chero { background: #fff; color: #000; border-bottom: 3px solid #000; margin-bottom: 18pt; }
  .chero h1, .chero__sum { color: #000; }
  .chero .eyebrow { color: #000; }
  .card, .panel, .klass, .tech { border-color: #999; box-shadow: none; break-inside: avoid; }
  .week { break-inside: avoid; }
  .pklass { break-inside: avoid; page-break-inside: avoid; }
  a { text-decoration: none; color: #000; }
}

/* Print sheet blocks (print.php) */
.pweek { margin-bottom: 22px; border-top: 2px solid var(--ink); padding-top: 10px; }
.pklass { border: 1px solid var(--border); padding: var(--space-sm); margin-bottom: var(--space-sm); background: var(--surface); }
.pklass__hd { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.pklass h3 { margin: 0; }
.pkeys { margin: 4px 0 6px; padding-left: 20px; }
.pkeys li { margin-bottom: 3px; }
.pextras { margin: 0 0 4px; padding-left: 20px; list-style: '+ '; color: var(--fg-muted); }
