/* Budo2go v2 — stylesheet
 * Palette continued from v1: charcoal + gold + serif.
 * Signature: Ten Chi Jin as a real visual spine on lesson pages.
 */

:root {
  color-scheme: dark;
  /* Fixed warm grey-green theme. Mid-dark: readable in daylight, gentle at night.
     Applied on every device — do NOT add a prefers-color-scheme override below;
     that override is what made the theme turn grey in daylight on light-mode devices. */
  --bg:          #3f463a;
  --bg2:         #4b5242;
  --bg3:         #58604c;
  --bg4:         #676f58;
  --surface:     #4b5242;
  --surface2:    #58604c;
  --border:      #646c54;
  --border2:     #767e64;
  --ink:         #f6f7ef;
  --ink2:        #e2e5d5;
  --ink3:        #bcc1a8;
  --ink4:        #8b9179;
  --gold:        #ecc25c;
  --gold2:       #d0a338;
  --gold3:       #dcb04a;
  --gold-dim:    #8a6018;
  --gold-ink:    #faf6ec;
  --line:        #646c54;

  /* Provenance / status — pitched to read on the lighter grey-green surface */
  --status-canon:   #4a7e42;
  --status-source:  #4a5c96;
  --status-common:  #a86e2a;
  --status-instr:   #9a6420;
  --status-open:    #b45044;
  --status-draft:   #646c54;

  /* Progress */
  --state-intro:    #646c54;
  --state-practiced:#9a6420;
  --state-reviewed: #d0a338;
  --state-reflected:#ecc25c;

  /* Safety */
  --safety-info:    #646c54;
  --safety-advisory:#a86e2a;
  --safety-warn:    #b45044;

  /* Ten Chi Jin bands — separated so gold, Chi and Jin are discernible:
     Ten = blue, Chi = rust/earth, Jin = ochre; gold accent stays yellow. */
  --ten:  #5f9bc4;
  --chi:  #c56a3a;
  --jin:  #caa04a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; background: var(--bg); }
body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  color: var(--ink);
  min-height: 100vh;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 999;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ── HEADER ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 20px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.nin-kanji {
  font-size: 42px;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
  font-weight: 400;
}
.site-title-block { flex: 1; min-width: 0; }
.site-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.site-sub {
  font-size: 11px;
  color: var(--ink4);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}
.disclaimer {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── NAV ── */
.main-nav {
  display: flex;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 12px 18px;
  font-size: 15px;
  color: var(--ink4);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.nav-link:hover { color: var(--gold); }
.nav-link.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* ── APP MAIN ── */
.app-main { padding: 0 0 60px; min-height: 60vh; }

.boot-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink3);
}
.boot-kanji {
  font-size: 64px;
  color: var(--gold);
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.boot-msg {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── EYEBROW / SECTION LABELS ── */
.eyebrow {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 8px;
}

/* ── HOME ── */
.home {
  padding: 20px;
}
.home-hero {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 20px;
  margin-bottom: 24px;
  background: var(--surface);
}
.home-hero h1 {
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--ink);
}
.home-hero p {
  color: var(--ink2);
  line-height: 1.6;
  margin-bottom: 12px;
}
.home-hero p:last-child { margin-bottom: 0; }

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.home-action {
  display: block;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s;
}
.home-action:hover { border-color: var(--gold2); }
.home-action-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.home-action-sub {
  font-size: 13px;
  color: var(--ink3);
  font-family: -apple-system, sans-serif;
}

.home-nextup {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
}
.home-nextup a {
  color: var(--gold);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}

/* ── TEN CHI JIN SPINE ── */
/* This is the signature element. Three vertical bands, each a level. */
/* Lessons render inside their band. On any lesson page, a spine indicator
 * shows the lesson's position in the whole. */

.spine {
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg2);
}
.spine-level {
  border-bottom: 1px solid var(--border);
  padding: 20px;
  position: relative;
}
.spine-level:last-child { border-bottom: none; }

.spine-level[data-level="spine.ten"] { border-left: 3px solid var(--ten); }
.spine-level[data-level="spine.chi"] { border-left: 3px solid var(--chi); }
.spine-level[data-level="spine.jin"] { border-left: 3px solid var(--jin); }

.spine-level-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.spine-kanji {
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
  font-weight: 400;
}
.spine-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.spine-gloss {
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  margin-left: auto;
}
.spine-role {
  color: var(--ink3);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.spine-modules { display: flex; flex-direction: column; gap: 8px; }
.spine-module {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.spine-module:hover { border-color: var(--gold2); }
.spine-module-name {
  font-size: 15px;
  font-weight: 600;
}
.spine-module-meta {
  font-size: 12px;
  color: var(--ink4);
  font-family: -apple-system, sans-serif;
}
.spine-module-empty {
  padding: 12px 14px;
  color: var(--ink4);
  font-size: 13px;
  font-style: italic;
}

/* ── LESSON PAGE ── */
.lesson {
  padding: 20px;
}
.lesson-header { margin-bottom: 20px; }
.lesson-crumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  margin-bottom: 12px;
}
.lesson-crumbs a { color: var(--ink3); text-decoration: none; }
.lesson-crumbs a:hover { color: var(--gold); }
.lesson-crumbs .sep { color: var(--ink4); }

.lesson-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.lesson-subtitle {
  font-size: 16px;
  color: var(--ink3);
  font-style: italic;
  margin-bottom: 14px;
}

.lesson-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

/* Spine indicator on lesson pages — the "you are here" dot. */
.lesson-spine-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--ink3);
  font-family: -apple-system, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.spine-dots {
  display: flex;
  gap: 4px;
}
.spine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg4);
}
.spine-dot.active { background: var(--gold); }
.spine-dot[data-level="spine.ten"].active { background: var(--gold); }

/* Outcome block */
.lesson-outcome {
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  background: var(--surface);
  margin-bottom: 20px;
}
.lesson-outcome .eyebrow { margin-bottom: 6px; }
.lesson-outcome-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

/* Section block (generic) */
.lb {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 16px;
}
.lb-title {
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 12px;
}
.lb-body { line-height: 1.65; color: var(--ink2); }
.lb-body p { margin-bottom: 10px; }
.lb-body p:last-child { margin-bottom: 0; }

/* Video */
.lb-video {
  padding: 0;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background: #000;
}
.lb-video-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.lb-video-frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.lb-video-credit {
  font-size: 12px;
  color: var(--ink4);
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-family: -apple-system, sans-serif;
}

/* Setup grid */
.setup-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.setup-key {
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  padding-top: 2px;
}
.setup-val { color: var(--ink2); }

/* Instruction phases */
.phase {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.phase:last-child { border-bottom: none; padding-bottom: 0; }
.phase:first-child { padding-top: 0; }
.phase-name {
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}
.phase-body { color: var(--ink2); line-height: 1.65; }

.errors-list { list-style: none; padding: 0; }
.errors-list li {
  padding: 8px 0 8px 20px;
  position: relative;
  color: var(--ink2);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.errors-list li:last-child { border-bottom: none; }
.errors-list li::before {
  content: "×";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--status-open);
  font-weight: 700;
}

/* Practice variants */
.variant {
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.variant:last-child { margin-bottom: 0; }
.variant-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.variant-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.variant-meta { font-size: 12px; color: var(--ink4); font-family: -apple-system, sans-serif; white-space: nowrap; }
.variant-desc { color: var(--ink2); line-height: 1.5; font-size: 14px; }

/* Insight card */
.insight-card {
  background: var(--bg2);
  border: 1px solid var(--gold-dim);
  border-left: 3px solid var(--gold);
  padding: 18px;
  margin-bottom: 16px;
}
.insight-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  line-height: 1.3;
}
.insight-opening {
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}
.insight-body { color: var(--ink2); line-height: 1.7; }
.insight-body p { margin-bottom: 12px; }
.insight-cue {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border-left: 3px solid var(--gold2);
}
.insight-cue-label {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 4px;
}
.insight-cue-body { color: var(--ink); font-size: 14px; line-height: 1.5; }

/* Connections */
.connections-list { display: flex; flex-direction: column; gap: 6px; }
.connection-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.connection-item:last-child { border-bottom: none; }
.connection-type {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
}
.connection-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
}
.connection-link:hover { text-decoration: underline; }

/* Cross-art analogue */
.analogue {
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-source);
  margin-bottom: 10px;
}
.analogue-head {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.analogue-strength {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink4);
  font-family: -apple-system, sans-serif;
  margin-bottom: 10px;
}
.analogue-label {
  display: inline-block;
  padding: 2px 8px;
  background: var(--status-source);
  color: var(--gold-ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  border-radius: 2px;
  margin-bottom: 8px;
}
.analogue-list { padding-left: 18px; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.analogue-list li { margin-bottom: 4px; }
.analogue h4 {
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

/* Reflection */
.reflection {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 16px;
}
.reflection-prompt {
  font-size: 16px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.4;
}
.reflection-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: 'Palatino Linotype', Georgia, serif;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  border-radius: 3px;
}
.reflection-textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}
.reflection-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.reflection-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.reflection-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.reflection-entry:last-child { border-bottom: none; }
.reflection-ts {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  margin-bottom: 4px;
}
.reflection-body { color: var(--ink2); line-height: 1.5; font-size: 14px; }

/* Log actions */
.log-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface2); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn.primary {
  background: var(--gold-dim);
  color: var(--gold-ink);
  border-color: var(--gold-dim);
}
.btn.primary:hover { background: var(--gold2); border-color: var(--gold2); }
.btn.subtle {
  background: transparent;
  color: var(--ink3);
  border-color: var(--border);
}
.btn.subtle:hover { color: var(--gold); border-color: var(--gold2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  border-radius: 2px;
  color: var(--gold-ink);
}
.badge.rank-9 { background: #2d6a2d; }
.badge.rank-8 { background: #2d3f7a; }
.badge.rank-7, .badge.rank-6 { background: #7a4f1a; }
.badge.difficulty-beginner { background: var(--status-canon); }

.badge.state-none { background: var(--state-intro); }
.badge.state-introduced { background: var(--state-intro); }
.badge.state-practiced { background: var(--state-practiced); }
.badge.state-reviewed { background: var(--state-reviewed); }
.badge.state-reflected { background: var(--state-reflected); color: #1a1a1a; }

.badge.status-curriculumCanon { background: var(--status-canon); }
.badge.status-documentedSource { background: var(--status-source); }
.badge.status-commonTeaching { background: var(--status-common); }
.badge.status-instructorInterpretation { background: var(--status-instr); }
.badge.status-comparativeAnalysis { background: var(--bg4); color: var(--ink); }
.badge.status-traditionalAccount { background: var(--status-common); }
.badge.status-openQuestion { background: var(--status-open); }
.badge.status-draft { background: var(--status-draft); color: var(--ink); }

.badge.safety-info { background: var(--safety-info); }
.badge.safety-advisory { background: var(--safety-advisory); }
.badge.safety-warning { background: var(--safety-warn); }

/* ── SAFETY BLOCK ── */
.safety-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 16px;
}
.safety-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.5;
}
.safety-item:last-child { border-bottom: none; }
.safety-item:first-child { padding-top: 0; }
.safety-adapt {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink3);
  font-style: italic;
}

/* ── TERM UNDERLINE (inline in prose) ── */
.term {
  color: var(--gold);
  border-bottom: 1px dotted var(--gold2);
  cursor: pointer;
  text-decoration: none;
  font-weight: inherit;
  padding: 0;
}
.term:hover { border-bottom-style: solid; }
.term:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── BOTTOM SHEET (term popover) ── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.term-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: 12px 12px 0 0;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-overflow-scrolling: touch;
}
.term-sheet.open { transform: translateY(0); }

.sheet-head {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.sheet-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: none;
  border: none;
  color: var(--ink3);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  line-height: 1;
  padding: 0;
}
.sheet-close:hover { color: var(--gold); }
.sheet-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-right: 40px;
}
.sheet-romaji {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.sheet-kanji {
  font-size: 20px;
  color: var(--gold);
}
.sheet-pron {
  font-size: 12px;
  color: var(--ink4);
  margin-top: 4px;
  font-family: -apple-system, sans-serif;
  padding-right: 40px;
}

.sheet-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 68px;
  z-index: 1;
}
.sheet-tab {
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--ink4);
  font-family: -apple-system, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.sheet-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.sheet-body { padding: 16px 20px 24px; }
.sheet-body h4 {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}
.sheet-body h4:first-child { margin-top: 0; }
.sheet-body p { color: var(--ink2); line-height: 1.6; font-size: 15px; margin-bottom: 10px; }
.sheet-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sheet-related-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
}
.sheet-related-chip:hover { border-color: var(--gold2); }

.sheet-prov {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ── TRAIN ── */
.train {
  padding: 20px;
}
.train-intro {
  color: var(--ink2);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 15px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}
.time-btn {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 14px 4px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s;
  font-family: inherit;
}
.time-btn:hover { background: var(--gold-dim); color: var(--gold-ink); border-color: var(--gold-dim); }
.time-btn.selected {
  background: var(--gold-dim);
  color: var(--gold-ink);
  border-color: var(--gold);
}
.time-btn-min {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.time-btn-label {
  display: block;
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  margin-top: 3px;
}
.time-btn.selected .time-btn-label { color: var(--gold-ink); opacity: 0.85; }

.train-restrictions {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.train-restrictions-title {
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 10px;
}
.restriction-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.restriction-toggle {
  padding: 6px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--ink2);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  font-family: -apple-system, sans-serif;
}
.restriction-toggle.on {
  background: var(--safety-warn);
  color: var(--gold-ink);
  border-color: var(--safety-warn);
}

.train-preview {
  padding: 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  margin-bottom: 20px;
}
.train-preview-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.train-preview-obj {
  color: var(--ink3);
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.5;
  font-style: italic;
}
.train-preview-blocks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.train-preview-block {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, sans-serif;
}
.train-preview-block:last-child { border-bottom: none; }
.tpb-time {
  color: var(--ink4);
  min-width: 44px;
  font-variant-numeric: tabular-nums;
}
.tpb-name { color: var(--ink); }
.tpb-type {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── SESSION OVERLAY (active training) ── */
.session-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
  display: none;
}
.session-overlay.active { display: block; }
.session-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 100px;
}
.session-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.session-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.session-obj {
  font-size: 14px;
  color: var(--ink3);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 20px;
}

.block-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 3px;
  transition: border-color 0.2s;
}
.block-card.active {
  border-color: var(--gold);
  border-left: 3px solid var(--gold);
}
.block-card.done { opacity: 0.55; }
.block-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.block-num {
  font-size: 22px;
  color: var(--gold);
  font-weight: 700;
  line-height: 1;
  min-width: 28px;
}
.block-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.block-time {
  font-size: 12px;
  color: var(--ink4);
  font-variant-numeric: tabular-nums;
  font-family: -apple-system, sans-serif;
}
.block-detail {
  color: var(--ink2);
  line-height: 1.55;
  font-size: 14px;
  margin-bottom: 12px;
}
.timer-bar {
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.timer-bar-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 1s linear;
}
.block-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.session-done {
  display: none;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  text-align: center;
  margin-top: 20px;
}
.session-done.show { display: block; }
.session-done h3 {
  color: var(--gold);
  font-size: 20px;
  margin-bottom: 10px;
}
.session-done p { color: var(--ink2); line-height: 1.6; margin-bottom: 16px; }

/* ── EXPLORE ── */
.explore { padding: 20px; }
.search-box {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  border-radius: 3px;
  margin-bottom: 20px;
}
.search-box:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
  border-color: var(--gold);
}
.explore-groups { display: flex; flex-direction: column; gap: 20px; }
.explore-group-title {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}
.explore-item {
  display: block;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 6px;
  cursor: pointer;
}
.explore-item:hover { border-color: var(--gold2); }
.explore-item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.explore-item-sub {
  font-size: 13px;
  color: var(--ink3);
  font-family: -apple-system, sans-serif;
}
.explore-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink4);
  font-style: italic;
}

/* ── PROGRESS ── */
.progress-page { padding: 20px; }
.progress-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.progress-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  text-align: center;
}
.progress-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.progress-stat-label {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  margin-top: 6px;
}

.progress-list-title {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 16px;
}
.progress-item {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.progress-item-title { flex: 1; color: var(--ink); font-size: 15px; font-weight: 500; }
.progress-item-ts {
  font-size: 11px;
  color: var(--ink4);
  font-family: -apple-system, sans-serif;
}
.progress-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink4);
  font-style: italic;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ── PROFILE ── */
.profile-page { padding: 20px; }
.profile-section {
  margin-bottom: 28px;
}
.profile-section h2 {
  font-size: 14px;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 12px;
}
.rank-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.rank-btn {
  padding: 12px 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  font-family: -apple-system, sans-serif;
}
.rank-btn.selected {
  background: var(--gold-dim);
  color: var(--gold-ink);
  border-color: var(--gold);
}
.instructor-questions .iq-item {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  margin-bottom: 8px;
}
.iq-question { color: var(--ink); line-height: 1.5; font-size: 14px; }
.iq-meta { font-size: 11px; color: var(--ink4); margin-top: 6px; font-family: -apple-system, sans-serif; }

/* ── TOAST ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold-dim);
  color: var(--gold-ink);
  padding: 10px 20px;
  border-radius: 3px;
  font-family: -apple-system, sans-serif;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── FOOTER ── */
.site-foot {
  padding: 24px 20px;
  font-size: 12px;
  color: var(--ink4);
  border-top: 1px solid var(--border);
  font-family: -apple-system, sans-serif;
  text-align: center;
}
.site-foot a { color: var(--gold); text-decoration: none; }
.foot-links { margin-top: 8px; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .boot-kanji { animation: none; }
}

/* ── NARROW PHONE ── */
@media (max-width: 380px) {
  .home-actions { grid-template-columns: 1fr; }
  .time-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .time-btn-min { font-size: 18px; }
  .rank-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── ADDITIONS FOR FULL CURRICULUM (56 lessons) ── */

.learn-note {
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.5;
  margin-top: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.learn-note a { color: var(--gold); text-decoration: none; }
.learn-note a:hover { text-decoration: underline; }

.spine-module-group + .spine-module-group { margin-top: 4px; }

.lesson-kind {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  color: var(--ink4);
  border: 1px solid var(--border);
  border-radius: 2px;
  vertical-align: middle;
}

/* Train lesson picker */
.train-picker {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.train-picker-label {
  display: block;
  font-size: 12px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}
.train-picker-select {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--ink);
  font-family: 'Palatino Linotype', Georgia, serif;
  font-size: 16px;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
                    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.train-picker-select:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}
.train-picker-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
  font-family: -apple-system, sans-serif;
}
.train-picker-link:hover { text-decoration: underline; }

/* Restriction toggles wrap to more rows now */
.restriction-toggles { gap: 6px; }

/* ── RESTORED v1 CURRICULUM SESSIONS ── */

.train-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
}
.mode-btn {
  flex: 1;
  padding: 11px 8px;
  background: var(--surface);
  border: none;
  color: var(--ink3);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--border2); }
.mode-btn.active { background: var(--gold-dim); color: var(--gold-ink); }
.mode-btn:not(.active):hover { background: var(--bg3); color: var(--gold); }

.curriculum-sessions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.curriculum-session {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.curriculum-session:hover { background: var(--bg3); border-left-color: var(--gold3); }
.cs-time {
  flex-shrink: 0;
  min-width: 54px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  padding-right: 14px;
}
.cs-min {
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.cs-unit {
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  margin-top: 3px;
}
.cs-body { flex: 1; min-width: 0; }
.cs-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
}
.cs-note {
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.5;
  margin-bottom: 6px;
}
.cs-meta {
  font-size: 11px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif;
}

/* Prereq review panel — restored from v1 */
.session-prereq {
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold2);
  border-radius: 4px;
}
.session-prereq h3 {
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
}
.prereq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink2);
  font-size: 14px;
}
.prereq-item:last-child { border-bottom: none; }
.prereq-item:hover:not(.is-static) { color: var(--gold); }
.prereq-item.is-static { cursor: default; color: var(--ink3); }
.prereq-badge {
  flex-shrink: 0;
  font-size: 11px;
  background: var(--bg3);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 3px;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  min-width: 62px;
  text-align: center;
}
.prereq-title { flex: 1; min-width: 0; line-height: 1.4; }
.prereq-go {
  flex-shrink: 0;
  color: var(--gold);
  font-size: 13px;
  font-family: -apple-system, sans-serif;
}

.block-subtitle {
  display: block;
  font-size: 12px;
  color: var(--ink4);
  font-weight: 400;
  margin-top: 2px;
  font-family: -apple-system, sans-serif;
}
.block-lesson-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  font-family: -apple-system, sans-serif;
}
.block-lesson-link:hover { text-decoration: underline; }

.adaptation-note {
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border-left: 3px solid var(--safety-advisory);
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.5;
}

/* ── DRAFT / VALIDATION STATUS ── */

.badge.status-draft {
  background: var(--status-open);
  color: var(--gold-ink);
}

.lesson-kind.is-draft {
  color: var(--status-open);
  border-color: var(--status-open);
}

.validation-notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--status-open);
  border-left: 3px solid var(--status-open);
  border-radius: 3px;
}
.validation-title {
  font-size: 11px;
  color: var(--status-open);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}
.validation-body {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.55;
}
.validation-src {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink4);
  font-style: italic;
  line-height: 1.5;
}

/* ── ORGANISATION NOTES (Bujinkan / Genbukan) ── */

.org-intro {
  font-size: 13px;
  color: var(--ink3);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.5;
}
.org-note {
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-source);
  margin-bottom: 8px;
  border-radius: 3px;
}
.org-note:last-child { margin-bottom: 0; }
.org-name {
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}
.org-body {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.6;
}
.org-body p { margin-bottom: 8px; }
.org-body p:last-child { margin-bottom: 0; }

/* ── PATH TO SHODAN ── */

.learn-view-toggle {
  display: flex;
  gap: 0;
  margin: 4px 0 18px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
}
.lv-btn {
  flex: 1;
  padding: 11px 8px;
  background: var(--surface);
  border: none;
  color: var(--ink3);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lv-btn + .lv-btn { border-left: 1px solid var(--border2); }
.lv-btn.active { background: var(--gold-dim); color: var(--gold-ink); }
.lv-btn:not(.active):hover { background: var(--bg3); color: var(--gold); }

.rank-path { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rank-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--bg4);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.rank-row:hover { background: var(--bg3); }
.rank-row.band-ten { border-left-color: var(--ten); }
.rank-row.band-chi { border-left-color: var(--chi); }
.rank-row.band-jin { border-left-color: var(--jin); }
.rank-row.band-orientation { border-left-color: var(--gold2); }
.rank-row-badge {
  flex-shrink: 0;
  min-width: 68px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.rank-row-body { flex: 1; min-width: 0; }
.rank-row-theme { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.rank-row-obj { font-size: 13px; color: var(--ink3); line-height: 1.45; margin-bottom: 5px; }
.rank-row-meta {
  font-size: 11px; color: var(--ink4); text-transform: uppercase;
  letter-spacing: 0.1em; font-family: -apple-system, sans-serif;
}
.rank-row-arrow { align-self: center; color: var(--ink4); font-size: 22px; flex-shrink: 0; }

.rank-objective {
  border-left: 3px solid var(--gold);
  padding: 12px 14px;
  background: var(--surface);
  margin-top: 12px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
}
.rank-objective .eyebrow { margin-bottom: 5px; }

.placements { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.placement {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.placement.is-controlled { border-left: 3px solid var(--status-open); }
.placement.is-placeholder { border-left: 3px solid var(--ink4); opacity: 0.85; }
.placement-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.placement-type {
  font-size: 10px; color: var(--ink4); text-transform: uppercase;
  letter-spacing: 0.12em; font-family: -apple-system, sans-serif; font-weight: 600;
}
.placement-name { font-size: 16px; font-weight: 600; color: var(--ink); display: block; }
.placement-name.is-link { color: var(--gold); text-decoration: none; }
.placement-name.is-link:hover { text-decoration: underline; }
.composite-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.composite-chip {
  font-size: 13px; padding: 4px 10px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 3px;
  color: var(--gold); text-decoration: none;
}
.composite-chip:hover { border-color: var(--gold2); }
.placement-note {
  margin-top: 8px; font-size: 12px; color: var(--ink3);
  font-style: italic; line-height: 1.5;
}

/* Developmental target state (I/D/C/G) — distinct from practice history */
.target-state {
  display: inline-flex; align-items: center; padding: 3px 9px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-family: -apple-system, sans-serif; font-weight: 600; border-radius: 2px;
  border: 1px solid;
}
.target-state.ts-introduced { color: var(--ink3); border-color: var(--border2); background: transparent; }
.target-state.ts-developing { color: var(--status-common); border-color: var(--status-common); background: transparent; }
.target-state.ts-competency { color: var(--gold); border-color: var(--gold2); background: transparent; }
.target-state.ts-integrated { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-dim); }

.val-badge {
  display: inline-block; margin-top: 8px; padding: 3px 9px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif; font-weight: 600; border-radius: 2px;
  background: var(--status-open); color: var(--gold-ink);
}
.val-badge.val-ishizukaChart { background: var(--status-common); }
.val-badge.val-draftNeedsSource { background: var(--ink4); color: var(--ink); }

.rank-nav {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 24px;
}

/* Path locator on the lesson page (dual hierarchy) */
.rp-locator {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; margin-bottom: 12px;
}
.rp-rank {
  display: flex; flex-direction: column; text-decoration: none;
  padding-right: 12px; border-right: 1px solid var(--border);
}
.rp-rank-label { font-size: 15px; font-weight: 700; color: var(--gold); }
.rp-rank-theme { font-size: 11px; color: var(--ink4); font-family: -apple-system, sans-serif; }
.rp-dev { display: flex; flex-direction: column; gap: 4px; }
.rp-dev-label {
  font-size: 10px; color: var(--ink4); text-transform: uppercase;
  letter-spacing: 0.1em; font-family: -apple-system, sans-serif; font-weight: 600;
}

/* ── MEDIA ASSETS ── */
.media-gallery { display: flex; flex-direction: column; gap: 12px; }
.media-asset { margin: 0; }
.media-asset img {
  width: 100%; border: 1px solid var(--border); border-radius: 3px; display: block;
}
.media-asset figcaption {
  margin-top: 6px; font-size: 13px; color: var(--ink3);
  font-family: -apple-system, sans-serif; line-height: 1.4;
}
.media-credit { color: var(--ink4); font-style: italic; }
.media-slots {
  padding: 12px 14px; background: var(--bg2);
  border: 1px dashed var(--border2); border-radius: 4px; margin-bottom: 12px;
}
.media-slots-title {
  font-size: 11px; color: var(--ink4); text-transform: uppercase;
  letter-spacing: 0.15em; font-family: -apple-system, sans-serif;
  font-weight: 600; margin-bottom: 8px;
}
.media-slots-list { display: flex; flex-wrap: wrap; gap: 6px; }
.media-slot {
  font-size: 12px; padding: 3px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 3px; color: var(--ink3);
  font-family: -apple-system, sans-serif;
}

/* ── v2.1 SOURCE-CONFIDENCE ── */
.status-badge {
  display: inline-block; margin-top: 8px; padding: 3px 9px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  font-family: -apple-system, sans-serif; font-weight: 600; border-radius: 2px;
}
.status-badge.status-NEEDS_SOURCE_VERIFICATION { background: var(--status-open); color: var(--gold-ink); }
.status-badge.status-SOURCE_INTERPRETATION { background: var(--status-common); color: var(--ink); }
.status-badge.status-BUDO2GO_AUTHORED { background: var(--status-source); color: var(--ink); }

.placement.is-interpretation { border-left: 3px solid var(--status-common); }
.placement-source {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--ink4); font-style: italic; line-height: 1.5;
}

.source-notice {
  padding: 14px 16px; margin-bottom: 20px; border-radius: 3px;
  background: var(--surface); border: 1px solid var(--border);
}
.source-notice.si { border-left: 3px solid var(--status-common); }
.source-notice.nv { border-left: 3px solid var(--status-open); }
.source-notice-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em;
  font-family: -apple-system, sans-serif; font-weight: 700; margin-bottom: 6px;
  color: var(--gold);
}
.source-notice-body { font-size: 14px; color: var(--ink2); line-height: 1.55; }

.lesson-kind.is-interp { color: var(--status-common); border-color: var(--status-common); }
.lesson-kind.is-pending { color: var(--status-open); border-color: var(--status-open); }

/* ── PRE-DEPLOY FIX: source-gap + recurring-placement UI ── */
.placement.is-source-gap { border-left: 3px solid var(--ink4); background: var(--bg2); }
.placement-gap-label {
  margin-top: 8px; font-size: 12px; color: var(--ink3);
  font-family: -apple-system, sans-serif; font-style: italic;
  display: flex; align-items: center; gap: 6px;
}
.placement-gap-label::before { content: "◔"; color: var(--ink4); font-style: normal; }

.rp-other {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: -6px 0 12px; padding: 0 2px;
}
.rp-other .rp-dev-label { margin-right: 2px; }
.rp-other-chip {
  font-size: 12px; padding: 3px 9px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 3px;
  color: var(--gold); text-decoration: none;
}
.rp-other-chip:hover { border-color: var(--gold2); }
