/* ══════════════════════════════════════════════════════════
   MODERATOR APP – Build with Vibe
   Styles for the internal moderator/trainer view.
   ══════════════════════════════════════════════════════════ */

/* ── Layout ── */
.page { height: auto; min-height: 100vh; overflow: visible; padding-bottom: 40px; }

/* ── Header ── */
.mod-header .subtitle { font-weight: 700; letter-spacing: 0.5px; }
.run-select {
  background: var(--glass-8); border: 1px solid var(--border-strong);
  color: var(--text); padding: 6px 10px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.8125rem;
  margin-right: 16px; cursor: pointer;
}
.run-select:focus { border-color: var(--orange); outline: none; }
[data-theme="light"] .run-select { background: rgba(0,0,0,0.04); }

/* ── Tab Bar ── */
.tab-bar {
  display: flex; gap: 0; margin: 0;
  border-bottom: 1px solid var(--border-strong);
  padding: 0 var(--page-pad);
}
.tab {
  padding: 10px 20px; font-size: 0.875rem; font-weight: 600;
  font-family: var(--font-heading);
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── Tab Panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════
   TIMETABLE TAB (reused from timing-tool)
   ═══════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; margin: 12px 0 8px;
  background: var(--glass-5); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.toolbar label { font-size: 0.8125rem; color: var(--text-muted); }
.toolbar input[type="time"] {
  background: var(--glass-8); border: 1px solid var(--border-strong);
  color: var(--text); padding: 4px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.875rem;
}
.toolbar .clock {
  font-family: var(--font-mono); font-size: 1.125rem; font-weight: 600;
  color: var(--orange); margin-left: auto;
}
.toolbar .day-info {
  font-size: 0.8125rem; color: var(--text-muted);
  padding: 4px 10px; background: var(--glass-5); border-radius: var(--radius-sm);
}
.schedule-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.8125rem; margin-top: 4px;
}
.schedule-table th {
  text-align: left; padding: 8px 10px; font-weight: 600; font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.schedule-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
.schedule-table td:nth-child(1) { width: 28px; text-align: center; }
.schedule-table td:nth-child(4),
.schedule-table td:nth-child(5),
.schedule-table td:nth-child(6) {
  font-family: var(--font-mono); font-size: 0.8125rem; text-align: right;
}
.schedule-table td:nth-child(7) { text-align: center; }
tr.row-slot td { color: var(--text); font-weight: 500; }
tr.row-slot td:nth-child(3) { cursor: pointer; }
tr.row-section td { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }
tr.row-section td:nth-child(3) { padding-left: 28px; }
tr.row-section.hidden { display: none; }
tr.row-break td { color: var(--text-faint); font-style: italic; background: var(--glass-3); }
tr.row-daybreak td {
  text-align: center; font-weight: 700; font-size: 0.875rem;
  color: var(--orange); padding: 14px 10px;
  background: var(--orange-bg); border-top: 2px solid var(--orange-border);
  border-bottom: 2px solid var(--orange-border);
}
.btn-daybreak-move {
  background: var(--glass-10); border: 1px solid var(--orange-border);
  color: var(--orange); font-size: 0.6875rem; padding: 6px 12px;
  border-radius: 4px; cursor: pointer; font-family: var(--font-body);
  vertical-align: middle; margin: 0 6px; min-height: 44px; min-width: 44px;
}
.btn-daybreak-move:hover { background: var(--glass-20); }
tr.row-phase td {
  font-weight: 700; font-size: 0.75rem; letter-spacing: 0.3px;
  color: var(--text-muted); padding: 10px 10px 4px; border-bottom: none;
}
tr.is-past td { opacity: 0.4; }
tr.is-current td { color: var(--text) !important; opacity: 1; }
tr.is-current { background: var(--orange-bg); }
tr.is-current td:first-child { color: var(--orange); font-weight: 700; }
tr.is-overtime td:nth-child(5),
tr.is-overtime td:nth-child(6) { color: var(--red); }
.dur-input {
  width: 56px; text-align: right; padding: 2px 4px;
  background: var(--glass-5); border: 1px solid transparent;
  color: inherit; font-family: var(--font-mono); font-size: 0.8125rem;
  border-radius: 4px; transition: border var(--ease-fast);
}
.dur-input:hover { border-color: var(--border-strong); }
.dur-input:focus { border-color: var(--orange); outline: none; background: var(--glass-10); }
tr.is-past .dur-input { pointer-events: none; }
.break-dur {
  width: 56px; text-align: right; padding: 2px 4px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-faint); font-family: var(--font-mono); font-size: 0.8125rem;
  font-style: italic; border-radius: 4px;
}
.break-dur:hover { border-color: var(--border-strong); background: var(--glass-5); }
.break-dur:focus { border-color: var(--orange); outline: none; background: var(--glass-10); font-style: normal; color: var(--text); }
.toggle { cursor: pointer; user-select: none; font-size: 0.625rem; color: var(--text-faint); display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .toggle { transition: transform var(--ease-fast); }
}
.toggle.open { transform: rotate(90deg); }
.btn-group { display: flex; gap: 3px; justify-content: center; }
.btn-now {
  padding: 6px 10px; font-size: 0.6875rem; font-weight: 600;
  background: var(--orange); color: var(--bg); border: none;
  border-radius: 4px; cursor: pointer; transition: opacity var(--ease-fast);
  font-family: var(--font-body); white-space: nowrap;
  min-height: 44px; min-width: 44px;
}
.btn-now:hover { opacity: 0.85; }
.btn-now.btn-end { background: var(--glass-12); color: var(--text-muted); }
.btn-now.btn-end:hover { background: var(--glass-20); color: var(--text); }
[data-theme="light"] .btn-now { color: #fff; }
tr.is-past .btn-group { display: none; }
.btn-reset {
  padding: 4px 12px; font-size: 0.75rem; font-weight: 500;
  background: var(--glass-8); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-body);
}
.btn-reset:hover { background: var(--glass-12); color: var(--text); }
.eod-marker {
  display: inline-block; font-size: 0.6875rem; font-weight: 600;
  color: var(--red); margin-left: 8px;
}
.eod-ok { color: var(--p1); }
.summary {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 10px 16px; margin-top: 8px;
  background: var(--glass-3); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.8125rem; color: var(--text-muted);
}
.summary strong { color: var(--text); }

/* ═══════════════════════════════════
   SLOT-NAVIGATOR TAB
   ═══════════════════════════════════ */
.navigator-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 120px);
}

/* ── Sidebar ── */
.slot-sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 8px 0;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 120px);
}
.slot-list {
  list-style: none; margin: 0; padding: 0;
}
.slot-list li {
  display: block;
}
.slot-list .slot-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 8px 16px; cursor: pointer;
  font-size: 0.8125rem; color: var(--text-muted);
  background: none; border: none;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  text-decoration: none;
  font-family: var(--font-body);
}
.slot-list .slot-item:hover {
  background: var(--glass-5); color: var(--text);
}
.slot-list .slot-item.active {
  background: var(--glass-8); color: var(--orange);
  border-left-color: var(--orange); font-weight: 600;
}
.slot-list .slot-nr {
  display: inline-block; width: 24px; text-align: right;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-faint); flex-shrink: 0;
}
.slot-list .slot-item.active .slot-nr { color: var(--orange); }
.slot-list .slot-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Phase dividers (replace day dividers) */
.slot-list .phase-divider {
  padding: 12px 16px 4px;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.slot-list .phase-divider.first { border-top: none; margin-top: 0; }

/* ── Slot Detail (contains timing bar, notes bar, two columns) ── */
.slot-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 120px);
}

/* ── Timing Bar ── */
.slot-timing-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: var(--glass-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.timing-info {
  display: flex; align-items: center; gap: 16px;
}
.timing-label {
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700;
  color: var(--text);
}
.timing-times {
  font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500;
  color: var(--orange);
}
.timing-duration {
  font-family: var(--font-mono); font-size: 0.8125rem;
  color: var(--text-muted);
}
.timing-actions {
  display: flex; gap: 6px;
}
.btn-timing {
  padding: 6px 14px; font-size: 0.75rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-body);
  transition: opacity 0.15s;
  background: var(--orange); color: var(--bg);
}
.btn-timing:hover { opacity: 0.85; }
.btn-timing-stop {
  background: var(--glass-12); color: var(--text-muted);
}
.btn-timing-stop:hover { background: var(--glass-20); color: var(--text); }
[data-theme="light"] .slot-timing-bar { background: rgba(0,0,0,0.02); }
[data-theme="light"] .btn-timing { color: #fff; }

/* ── Sticky Notes Bar ── */
.notes-bar {
  padding: 8px 24px;
  background: var(--glass-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-textarea {
  width: 100%; padding: 8px 12px;
  background: var(--glass-5); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 0.8125rem;
  line-height: 1.5; resize: vertical; min-height: 40px;
}
.notes-textarea:focus {
  border-color: var(--orange); outline: none;
  background: var(--glass-8);
}
[data-theme="light"] .notes-bar { background: rgba(0,0,0,0.015); }
[data-theme="light"] .notes-textarea { background: rgba(0,0,0,0.02); }
[data-theme="light"] .notes-textarea:focus { background: rgba(0,0,0,0.04); }

/* ── Two-Column Content Area ── */
.slot-columns {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  flex: 1;
  overflow: hidden;
}
.slot-col-left {
  overflow-y: auto;
  padding: 24px 32px 48px;
}
.slot-col-right {
  overflow-y: auto;
  padding: 16px 20px;
  border-left: 1px solid var(--border);
  background: var(--glass-2);
}
.slot-col-right .col-heading {
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-faint); margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .slot-col-right { background: rgba(0,0,0,0.015); }

/* ── Module Markdown Content ── */
.module-content {
  line-height: 1.7;
  font-size: 0.9375rem;
  max-width: 800px;
}
.module-content h1 {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
  color: var(--orange); margin: 0 0 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.module-content h2 {
  font-family: var(--font-heading); font-size: 1.125rem; font-weight: 700;
  color: var(--text); margin: 28px 0 12px;
}
.module-content h3 {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 600;
  color: var(--text); margin: 20px 0 8px;
}
.module-content p { margin: 8px 0; color: var(--text-secondary); }
.module-content ul, .module-content ol {
  margin: 8px 0; padding-left: 24px; color: var(--text-secondary);
}
.module-content li { margin: 4px 0; }
.module-content li::marker { color: var(--text-faint); }
.module-content strong { color: var(--text); font-weight: 600; }
.module-content code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--glass-8); padding: 2px 6px; border-radius: 4px;
  color: var(--orange);
}
.module-content pre {
  background: var(--glass-5); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; overflow-x: auto;
  margin: 12px 0;
}
.module-content pre code {
  background: none; padding: 0; color: var(--text-secondary);
}
.module-content table {
  width: 100%; border-collapse: collapse; font-size: 0.8125rem;
  margin: 12px 0;
}
.module-content th {
  text-align: left; padding: 8px 10px; font-weight: 600;
  border-bottom: 2px solid var(--border-strong); color: var(--text-muted);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.3px;
}
.module-content td {
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.module-content blockquote {
  border-left: 3px solid var(--orange);
  margin: 12px 0; padding: 8px 16px;
  background: var(--glass-3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-style: italic;
}
.module-content a {
  color: var(--orange); text-decoration: none;
}
.module-content a:hover { text-decoration: underline; }
.module-content hr {
  border: none; border-top: 1px solid var(--border); margin: 24px 0;
}

/* ── Teilnehmer-Hinweise ── */
.hint-card {
  background: var(--glass-5); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  margin-bottom: 8px;
}
.hint-card-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.hint-card-app {
  font-weight: 400; color: var(--text-muted);
  font-size: 0.75rem;
}
.hint-card-body {
  font-size: 0.8125rem; color: var(--text-secondary);
  line-height: 1.6;
}
.hint-card-list {
  margin: 0;
  padding-left: 18px;
}
.hint-card-list li {
  margin: 0 0 6px;
}
.hint-card-list li:last-child {
  margin-bottom: 0;
}
.hint-card-paragraph {
  margin: 0 0 6px;
}
.hint-card-paragraph:last-child {
  margin-bottom: 0;
}
.hint-card-empty {
  font-size: 0.8125rem; color: var(--text-faint);
  font-style: italic; padding: 8px 0;
}
[data-theme="light"] .hint-card { background: rgba(0,0,0,0.02); }

/* ── Slot Navigation ── */
.slot-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 32px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-slot-nav {
  padding: 8px 16px; font-size: 0.8125rem; font-weight: 600;
  background: var(--glass-8); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.btn-slot-nav:hover { background: var(--glass-12); color: var(--text); }
.btn-slot-nav:disabled { opacity: 0.3; cursor: default; }
.slot-nav-info {
  font-size: 0.75rem; color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 80px 20px;
  color: var(--text-faint); font-size: 0.875rem;
}

/* ── Light mode overrides ── */
[data-theme="light"] .toolbar { background: rgba(0,0,0,0.02); }
[data-theme="light"] .summary { background: rgba(0,0,0,0.02); }
[data-theme="light"] .dur-input { background: rgba(0,0,0,0.03); }
[data-theme="light"] .dur-input:focus { background: rgba(0,0,0,0.06); }
[data-theme="light"] .break-dur:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .break-dur:focus { background: rgba(0,0,0,0.06); }
[data-theme="light"] tr.row-break td { background: rgba(0,0,0,0.02); }
[data-theme="light"] tr.row-daybreak td { background: rgba(229,98,0,0.06); }
[data-theme="light"] .btn-daybreak-move { background: rgba(0,0,0,0.04); }
[data-theme="light"] .btn-daybreak-move:hover { background: rgba(0,0,0,0.08); }
[data-theme="light"] .module-content blockquote { background: rgba(0,0,0,0.02); }

/* ═══════════════════════════════════
   SLOT-TRIGGER (mobile-only button that opens bottom sheet)
   ═══════════════════════════════════ */
.slot-trigger {
  display: none;  /* shown only on phone via media query */
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--glass-5); border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; text-align: left;
  min-height: 52px;
  transition: background var(--ease-fast);
}
.slot-trigger:hover { background: var(--glass-8); }
.slot-trigger:focus-visible { outline-offset: -2px; }
.slot-trigger-label {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot-trigger-chevron {
  color: var(--orange); font-size: 0.875rem; flex-shrink: 0;
}

/* ═══════════════════════════════════
   SLOT-DETAILS (<details> wrappers — neutral on desktop)
   ═══════════════════════════════════ */
.slot-details { display: block; }
.slot-details[open] .slot-details-chevron { transform: rotate(180deg); }
/* Desktop: hide the summary bar, always show content */
.slot-details-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.slot-details-summary::-webkit-details-marker { display: none; }
.slot-details-summary::marker { content: ''; }
/* Ensure content is visible on desktop regardless of <details> open state */
@media (min-width: 641px) {
  .slot-details > :not(summary) { display: block !important; }
}

/* ═══════════════════════════════════
   BOTTOM SHEET (slot selector on mobile)
   ═══════════════════════════════════ */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  animation: sheet-fade-in 0.2s ease;
}
.sheet-backdrop[hidden] { display: none; }

.slot-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
  z-index: 51;
  animation: sheet-slide-up 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  -webkit-overflow-scrolling: touch;
}
.slot-sheet[hidden] { display: none; }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--glass-20);
  border-radius: 2px;
  margin: 10px auto 6px;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.sheet-title {
  font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint);
}
.sheet-close {
  background: var(--glass-5); border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ease-fast), color var(--ease-fast);
}
.sheet-close:hover { background: var(--glass-12); color: var(--text); }

.sheet-list {
  list-style: none; margin: 0; padding: 4px 0 8px;
}
.sheet-list li { display: block; }
.sheet-list .slot-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 14px 20px;
  min-height: 52px;
  background: none; border: none;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body); font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast);
}
.sheet-list .slot-item:hover { background: var(--glass-5); color: var(--text); }
.sheet-list .slot-item.active {
  background: var(--orange-bg); color: var(--orange);
  border-left-color: var(--orange); font-weight: 600;
}
.sheet-list .slot-nr {
  display: inline-block; width: 28px; text-align: right;
  font-family: var(--font-mono); font-size: 0.8125rem;
  color: var(--text-faint); flex-shrink: 0;
}
.sheet-list .slot-item.active .slot-nr { color: var(--orange); }
.sheet-list .slot-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-list .phase-divider {
  padding: 16px 20px 6px;
  font-family: var(--font-heading);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.sheet-list .phase-divider.first { border-top: none; margin-top: 0; }

@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes sheet-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.sheet-open { overflow: hidden; }

/* Light-mode overrides for sheet */
[data-theme="light"] .sheet-backdrop { background: rgba(0,0,0,0.35); }
[data-theme="light"] .slot-sheet { box-shadow: 0 -8px 32px rgba(0,0,0,0.15); }
[data-theme="light"] .sheet-close { background: rgba(0,0,0,0.04); }
[data-theme="light"] .sheet-close:hover { background: rgba(0,0,0,0.08); }

/* ═══════════════════════════════════
   MOBILE TIMETABLE (card list)
   ═══════════════════════════════════ */
.mobile-timetable { display: none; }
.mt-phase {
  font-family: var(--font-heading);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint);
  margin: 20px 4px 8px;
}
.mt-phase:first-child { margin-top: 4px; }
.mt-daybreak {
  text-align: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 0.8125rem;
  color: var(--orange);
  padding: 10px 12px;
  margin: 12px 0;
  background: var(--orange-bg);
  border-top: 2px solid var(--orange-border);
  border-bottom: 2px solid var(--orange-border);
  border-radius: var(--radius-sm);
}
.mt-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--glass-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background var(--ease-fast);
}
.mt-card.is-break {
  background: var(--glass-3);
  border-style: dashed;
}
.mt-card.is-past { opacity: 0.45; }
.mt-card.is-current {
  background: var(--orange-bg);
  border-color: var(--orange-border);
}
.mt-nr {
  grid-row: 1 / span 2;
  font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600;
  color: var(--text-muted); text-align: right;
}
.mt-card.is-current .mt-nr { color: var(--orange); }
.mt-title {
  font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.mt-card.is-break .mt-title {
  font-family: var(--font-body); font-weight: 400; font-style: italic;
  color: var(--text-muted);
}
.mt-dur {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-faint);
  justify-self: end;
}
.mt-times {
  grid-column: 2 / span 2;
  font-family: var(--font-mono); font-size: 0.8125rem;
  color: var(--text-muted);
}
.mt-card.is-current .mt-times { color: var(--orange); font-weight: 500; }
.mt-pill {
  display: inline-block;
  font-family: var(--font-body); font-size: 0.625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--bg); background: var(--orange);
  padding: 2px 6px; border-radius: 4px;
  margin-left: 6px; vertical-align: middle;
}
[data-theme="light"] .mt-pill { color: #fff; }

/* ═══════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════ */
@media (max-width: 1024px) {
  .slot-columns { grid-template-columns: 1fr; }
  .slot-col-right {
    border-left: none; border-top: 1px solid var(--border);
  }
}

/* Tablet (641-768px): keep sidebar-as-strip fallback */
@media (max-width: 768px) and (min-width: 641px) {
  .navigator-layout { grid-template-columns: 1fr; }
  .slot-sidebar {
    position: static; max-height: none;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .slot-list { display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto; }
  .slot-list li { flex-shrink: 0; }
  .slot-list .slot-item { padding: 8px 12px; border-left: none; border-bottom: 3px solid transparent; }
  .slot-list .slot-item.active { border-bottom-color: var(--orange); border-left-color: transparent; }
  .slot-list .phase-divider { display: none; }
  .slot-detail { max-height: none; }
  .slot-col-left { padding: 16px; }
  .slot-timing-bar { padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
  .notes-bar { padding: 8px 16px; }
}

/* Phone (≤ 640px): mobile-optimized layout */
@media (max-width: 640px) {
  /* Header: hide wordmark, expand run-select */
  .bwv-logo-wordmark { display: none; }
  .mod-header .subtitle { display: none; }
  .run-select { flex: 1; margin-right: 0; min-width: 0; max-width: 200px; }
  .bwv-header-right { flex: 1; gap: 8px; }

  /* Tab bar: bigger touch targets */
  .tab-bar { padding: 0 8px; }
  .tab { padding: 14px 16px; min-height: 48px; font-size: 0.8125rem; flex: 1; text-align: center; }

  /* Navigator: single-column, sidebar replaced by bottom-sheet */
  .navigator-layout { display: block; min-height: 0; }
  .slot-sidebar { display: none; }
  .slot-detail { display: block; max-height: none; overflow: visible; }

  /* Mobile-only slot-trigger appears */
  .slot-trigger { display: flex; }

  /* Timing bar: stacked */
  .slot-timing-bar {
    flex-direction: column; align-items: stretch;
    padding: 12px 16px; gap: 10px;
  }
  .timing-info {
    flex-wrap: wrap; gap: 8px 12px;
  }
  .timing-label { font-size: 0.9375rem; }
  .timing-times { font-size: 1rem; }
  .timing-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .btn-timing {
    min-height: 48px; font-size: 0.9375rem;
    padding: 10px 14px;
  }

  /* Notes bar: card-like, prominent */
  .notes-bar {
    padding: 12px 16px;
    background: var(--glass-4);
  }
  .notes-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-faint);
    margin-bottom: 6px;
  }
  .notes-textarea {
    min-height: 140px;
    font-size: 1rem;  /* prevent iOS zoom on focus */
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }

  /* Columns stack */
  .slot-columns { display: block; }
  .slot-col-left {
    padding: 12px 16px 96px;  /* bottom space for fixed slot-nav */
  }
  .slot-col-right {
    border-left: none; border-top: none;
    background: transparent;
    padding: 0 16px 12px;
  }

  /* Details: make summary visible and tappable on phone */
  .slot-details {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--glass-3);
    margin-bottom: 12px;
    overflow: hidden;
  }
  .slot-details-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    min-height: 52px;
    font-family: var(--font-heading);
    font-size: 0.875rem; font-weight: 700;
    color: var(--text);
    transition: background var(--ease-fast);
  }
  .slot-details-summary:hover { background: var(--glass-5); }
  .slot-details[open] > .slot-details-summary {
    border-bottom: 1px solid var(--border);
    color: var(--orange);
  }
  .slot-details-chevron {
    color: var(--orange);
    font-size: 0.875rem;
    transition: transform var(--ease-fast);
  }
  .slot-details > :not(summary) {
    padding: 14px 16px;
  }
  .slot-details .col-heading {
    margin: 0; padding: 0; border: none;
    font-size: 0.875rem; color: inherit;
    text-transform: none; letter-spacing: 0;
  }
  .module-content { font-size: 0.9375rem; }
  .module-content h1 { font-size: 1.25rem; }
  .module-content h2 { font-size: 1.0625rem; margin-top: 20px; }
  .module-content h3 { font-size: 0.9375rem; }
  .module-content table { display: block; overflow-x: auto; }

  /* Slot-nav: fixed bottom */
  .slot-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    margin: 0;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: var(--bg);
    border-top: 1px solid var(--border-strong);
    gap: 8px;
    z-index: 5;
  }
  .btn-slot-nav {
    flex: 1;
    min-height: 48px;
    font-size: 0.9375rem;
  }
  .slot-nav-info {
    font-size: 0.6875rem;
    flex-shrink: 0;
  }

  /* Timetable: swap table for cards */
  .toolbar {
    flex-direction: column; align-items: stretch;
    gap: 8px; padding: 12px 16px;
  }
  .toolbar .clock { margin-left: 0; font-size: 1.375rem; text-align: center; }
  .toolbar .day-info { text-align: center; }
  .toolbar label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .schedule-table { display: none; }
  .mobile-timetable { display: block; padding: 0 12px 32px; }
  .summary { font-size: 0.75rem; padding: 10px 12px; gap: 12px; }
}

/* ── Print ── */
@media print {
  .toolbar, .btn-group, .btn-reset, .bwv-header, .tab-bar,
  .slot-sidebar, .slot-nav, .notes-bar, .slot-timing-bar { display: none; }
  .navigator-layout { grid-template-columns: 1fr; }
  .slot-columns { grid-template-columns: 1fr; }
  .tab-panel { display: block !important; }
  tr.row-section.hidden { display: table-row; }
}

/* ── Screen reader only ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
