:root {
  --bg: #0e0f13;
  --surface: #171922;
  --surface-2: #1f222d;
  --border: #2a2e3b;
  --text: #e6e8ee;
  --muted: #9aa1b2;
  --accent: #7c5cff;
  --accent-soft: #2b2154;
  --pick: #2dd4bf;
  --pick-soft: #103730;
  --alt: #f59e0b;
  --alt-soft: #3b2a0e;
  --danger: #ef4444;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Width of the sticky stage-label column inside each timeline row.
   * The time axis ticks and the now-line bake this offset in via calc()
   * so they line up with the lanes (which start after this column). */
  --stage-col-width: 88px;
  /* Approximate height of the fixed footer, used by every view + the FAB
   * + the loading bar to leave room above. Footer wraps gracefully on
   * very narrow viewports — this reserves enough space for the common
   * single-line layout. */
  --footer-h: 60px;
  --bottom-clearance: calc(var(--footer-h) + var(--safe-bottom));
}

@media (min-width: 700px) {
  :root {
    --stage-col-width: 120px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* spektrum strips data-cloak from the bound root + descendants once
 * bindDOM completes, so this hides the bind-time flash of literal
 * "{{...}}" text. visibility:hidden preserves layout (no shift on
 * reveal). */
[data-cloak] {
  visibility: hidden;
}

h1,
h2,
h3 {
  margin: 0 0 0.4rem 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.15rem;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--bg));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand .tag {
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.topbar-live {
  font-weight: 600;
}

.topbar-live::first-letter {
  color: #ef4444;
}

/* ---------- Layout: mobile first (single column) ---------- */

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  padding-bottom: calc(96px + var(--bottom-clearance));
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

textarea,
input[type="text"],
input[type="password"],
select {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  margin-top: 4px;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

label {
  display: block;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

label small {
  display: block;
  margin-top: 4px;
}

button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.12s ease, transform 0.06s ease;
}

button:hover {
  background: #262a36;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
  font-weight: 600;
}

button.primary:hover {
  background: #6f4dff;
}

button.primary:disabled {
  background: #4a3f8a;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: dw-spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
  flex: 0 0 auto;
}

@keyframes dw-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

/* ---------- Page-wide loading bar (fake progress) ----------
 * Fixed bottom strip, fills 0% → 95% with an ease-out curve so it feels
 * snappy at first then asymptotes — we don't know when the LLM will
 * actually return, so we never claim 100% mid-load. A second animation
 * scrolls the gradient continuously for the "alive, working" feel. */

.loading-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bottom-clearance);
  height: 3px;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.loading-bar::before {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--pick),
    var(--alt),
    var(--danger),
    var(--accent)
  );
  background-size: 200% 100%;
  animation:
    dw-fake-progress 14s cubic-bezier(0.1, 0.6, 0.3, 1) forwards,
    dw-gradient-shimmer 1.4s linear infinite;
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.55),
    0 0 6px rgba(45, 212, 191, 0.3);
}

@keyframes dw-fake-progress {
  0% {
    width: 0%;
  }
  18% {
    width: 36%;
  }
  55% {
    width: 74%;
  }
  100% {
    width: 95%;
  }
}

@keyframes dw-gradient-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: -200% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar::before {
    animation: dw-fake-progress 14s linear forwards;
  }
}

button.ghost {
  background: transparent;
}

#recommend-btn,
#clear-recs-btn,
.card button.primary,
.card button.ghost {
  width: 100%;
  margin-top: 12px;
}

.status {
  margin: 10px 0 0 0;
  min-height: 1em;
}

.status.error {
  color: var(--danger);
}

.btn-hint {
  margin: 6px 0 0 0;
  font-size: 0.76rem;
  text-align: center;
  letter-spacing: 0.01em;
}

/* ---------- Role template picker ---------- */

.template-picker {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  background-image: linear-gradient(180deg, var(--surface-2), #1a1d28);
}

.template-picker:focus {
  color: var(--text);
}

/* ---------- Filters ---------- */

.filter-grid {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  user-select: none;
  color: var(--muted);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.pitch-toggle {
  font-weight: 600;
}

.pitch-toggle.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--alt);
  color: #fcd58e;
}

/* ---------- Pitch / vendor flag pill ---------- */

.pitch-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: help;
  user-select: none;
}

.pitch-flag--strong {
  background: rgba(245, 158, 11, 0.18);
  color: #fbcb6c;
  border-color: rgba(245, 158, 11, 0.55);
}

.pitch-flag--soft {
  background: rgba(154, 161, 178, 0.14);
  color: #c8cdd9;
  border-color: rgba(154, 161, 178, 0.35);
}

/* ---------- Schedule grid ---------- */

.schedule {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.slot-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.slot-time {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.slot-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.session {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.session:hover {
  border-color: #404656;
}

.session.hidden {
  display: none;
}

.session.pick {
  border-color: var(--pick);
  background: linear-gradient(180deg, var(--pick-soft), var(--surface-2));
}

.session.alt {
  border-color: var(--alt);
}

.session-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.session-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.session-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.session-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(124, 92, 255, 0.12);
  color: #c5b9ff;
  border-radius: 999px;
}

.badge {
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge.pick {
  background: var(--pick);
  color: #032722;
}

.badge.alt {
  background: var(--alt);
  color: #2b1a02;
}

.rationale {
  font-size: 0.85rem;
  background: rgba(45, 212, 191, 0.06);
  border-left: 2px solid var(--pick);
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 4px;
  color: var(--text);
}

.session.alt .rationale {
  background: rgba(245, 158, 11, 0.06);
  border-left-color: var(--alt);
}

.session-desc {
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.session.expanded .session-desc {
  -webkit-line-clamp: unset;
  display: block;
}

details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}

details[open] summary {
  margin-bottom: 6px;
}

.overall-advice {
  background: linear-gradient(180deg, #1a1832, var(--surface));
  border-color: #3a2e7a;
}

.overall-advice p {
  margin: 0;
  font-size: 0.9rem;
}

/* ---------- Demo mode pill (top-centre) ---------- */

.demo-pill {
  --y: 0;
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, var(--y));
  z-index: 15;
  background: rgba(245, 158, 11, 0.16);
  color: #fcd58e;
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 0;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s ease, transform 0.06s ease;
}

.demo-pill:hover {
  background: rgba(245, 158, 11, 0.24);
  --y: -1px;
}

.demo-pill:active {
  --y: 0;
}

.demo-pill-icon {
  font-size: 0.85rem;
}

/* On narrow phones the brand sits next to the pill — give the pill its
 * own space by shifting the brand title slightly smaller. The pill keeps
 * its full label since it's the more action-y element. */
@media (max-width: 480px) {
  .demo-pill-label {
    /* "Demo mode · 14:15" only — drops "fictive time" at < 480px */
  }
}

/* When demo mode is on, the pill takes up ~32px above the topbar's
 * bottom edge. Sticky agenda + live headers need to clear that space
 * so the pill never sits over them on scroll. */
body.demo-on .agenda-header,
body.demo-on .live-header {
  top: calc(56px + 36px);
}

@media (min-width: 700px) {
  body.demo-on .agenda-header,
  body.demo-on .live-header {
    top: calc(64px + 36px);
  }
}

/* Settings modal Demo-toggle row */
.demo-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.demo-toggle-row > div {
  flex: 1 1 auto;
  min-width: 0;
}

.demo-toggle-row > div p {
  margin: 4px 0 0 0;
}

.demo-toggle-row > button {
  flex: 0 0 auto;
  min-width: 70px;
}

.demo-toggle-row > button.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--alt);
  color: #fcd58e;
}

/* Demo explanation modal */
.demo-card {
  border-color: rgba(245, 158, 11, 0.45);
}

.demo-body p {
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.demo-list {
  margin: 4px 0 12px 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

/* ---------- Modal (Settings) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  /* mobile: no padding, modal-card fills the overlay */
  padding: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--surface);
  color: var(--text);
  width: 100%;
  display: flex;
  flex-direction: column;
  /* full-screen on mobile */
  border-radius: 0;
  border: none;
  box-shadow: none;
  max-height: 100dvh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 12px;
  min-height: 40px;
  min-width: 40px;
  border: 1px solid transparent;
}

.modal-close:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.modal-footer button {
  flex: 1 1 50%;
  margin: 0;
}

@media (min-width: 700px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .modal-card {
    width: min(480px, 100%);
    max-height: min(80vh, 720px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }

  .modal-header {
    padding-top: 14px;
  }

  .modal-footer {
    padding-bottom: 12px;
  }

  .modal-footer button {
    flex: 0 0 auto;
    min-width: 110px;
  }

  .modal-footer {
    justify-content: flex-end;
  }
}

/* ---------- Floating action button ---------- */

.fab {
  --fab-y: 0;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(12px + var(--bottom-clearance));
  z-index: 30;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  min-height: 48px;
  width: auto;
  max-width: calc(100% - 32px);
  text-align: center;
  transform: translate(-50%, var(--fab-y));
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.12s ease;
}

.fab:hover {
  background: #6f4dff;
  --fab-y: -1px;
}

.fab:active {
  --fab-y: 0;
}


/* ---------- Agenda view ---------- */

.agenda {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
  padding-bottom: calc(24px + var(--bottom-clearance));
}

.agenda-header {
  position: sticky;
  top: 56px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.agenda-header .back {
  flex: 0 0 auto;
  padding: 8px 12px;
  min-height: 40px;
}

.agenda-heading {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}

.agenda-export {
  flex: 0 0 auto;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.print-only {
  display: none;
}

.agenda-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.agenda-empty {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.agenda-empty p {
  margin: 0 0 16px 0;
}

.agenda-empty .primary {
  width: auto;
  display: inline-block;
}

.agenda-strategy {
  margin-bottom: 14px;
}

.notify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
}

.notify-banner--on {
  border-color: rgba(45, 212, 191, 0.45);
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.08), var(--surface));
}

.notify-banner--denied {
  border-color: rgba(239, 68, 68, 0.4);
}

.notify-icon {
  font-size: 1rem;
}

.notify-label {
  flex: 1 1 60%;
  min-width: 140px;
}

.notify-banner .notify-action {
  flex: 0 0 auto;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 0.82rem;
  margin: 0;
  width: auto;
}

.agenda-strategy p {
  margin: 8px 0 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.agenda-strategy summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 0;
}

.agenda-strategy summary::-webkit-details-marker {
  display: none;
}

.agenda-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: stretch;
}

.agenda-time {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-top: 14px;
  color: var(--accent);
}

.agenda-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pick);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}

.agenda-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.agenda-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.agenda-rationale {
  margin: 0;
  font-size: 0.88rem;
  background: rgba(45, 212, 191, 0.08);
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
}

.agenda-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.agenda-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(124, 92, 255, 0.12);
  color: #c5b9ff;
  border-radius: 999px;
}

/* ---------- Desktop overrides ---------- */

@media (min-width: 700px) {
  .topbar {
    padding: 14px 20px;
  }

  .brand {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  h1 {
    font-size: 1.25rem;
  }

  .slot-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .agenda-row {
    grid-template-columns: 80px 1fr;
  }

  .agenda-header {
    top: 64px;
  }
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 360px 1fr;
    gap: 20px;
    padding: 20px;
    padding-bottom: 20px;
  }

  .sidebar {
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .fab {
    bottom: calc(20px + var(--bottom-clearance));
    min-width: 180px;
  }

  .agenda {
    padding: 24px;
  }
}

/* ---------- Session detail modal ---------- */

@media (min-width: 700px) {
  .session-detail-card {
    width: min(640px, 100%);
    max-height: min(85vh, 800px);
  }
}

.session-detail-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-detail-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.session-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.session-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.session-detail-section h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.session-detail-section .rationale {
  margin: 0;
}

.session-detail-description {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.speaker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speaker-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speaker-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.speaker-meta {
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.small {
  font-size: 0.78rem;
}

/* ---------- Live timeline view ---------- */

.live {
  padding: 14px;
  padding-bottom: calc(24px + var(--bottom-clearance));
  max-width: 1400px;
  margin: 0 auto;
}

.live-header {
  position: sticky;
  top: 56px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.live-header .back {
  flex: 0 0 auto;
  padding: 8px 12px;
  min-height: 40px;
}

.live-title {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.live-title h2 {
  margin: 0;
  font-size: 1rem;
}

.live-mode-toggle {
  flex: 0 0 auto;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.live-mode-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.timeline {
  position: relative;
  min-height: 220px;
}

.timeline-axis {
  position: relative;
  height: 26px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.timeline-tick {
  position: absolute;
  top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0 2px;
}

.timeline-tick.major {
  color: var(--text);
  font-weight: 700;
}

.timeline-tick.major::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 1px;
  height: 8px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline-tracks {
  position: relative;
}

.timeline-row {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

.timeline-row:last-child {
  border-bottom: none;
}

.timeline-stage {
  position: sticky;
  left: 0;
  z-index: 3;
  flex: 0 0 var(--stage-col-width);
  width: var(--stage-col-width);
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.timeline-lane {
  position: relative;
  flex: 1 1 auto;
  min-height: 60px;
  background-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(100% - 1px),
    rgba(255, 255, 255, 0.02) 100%
  );
}

.timeline-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.06s ease;
  text-align: left;
  font: inherit;
  color: inherit;
}

.timeline-block:active {
  transform: scale(0.98);
}

.timeline-block:hover {
  border-color: var(--accent);
  z-index: 2;
}

.timeline-block.pick {
  border-color: var(--pick);
  background: linear-gradient(180deg, var(--pick-soft), var(--surface));
}

.timeline-block.alt {
  border-color: var(--alt);
}

.timeline-block.pitch {
  border-left: 3px solid var(--alt);
}

.timeline-block-time {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.timeline-block-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.timeline-now-label {
  position: absolute;
  top: 2px;
  left: 4px;
  background: #ef4444;
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.live-empty {
  margin-top: 24px;
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 700px) {
  .timeline-stage {
    font-size: 0.85rem;
  }
  .timeline-row {
    min-height: 70px;
  }
  .timeline-lane {
    min-height: 70px;
  }
  .timeline-block-title {
    font-size: 0.85rem;
  }
}

@media (min-width: 900px) {
  .live {
    padding: 24px;
  }
  .live-header {
    top: 64px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 10px 18px calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px dotted var(--muted);
  padding-bottom: 1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.spektrum-mark {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-bottom: none;
  padding: 0;
  color: var(--muted);
  transition: color 0.12s ease, background 0.12s ease, transform 0.06s ease;
}

.site-footer .social-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-footer .social-link:active {
  transform: translateY(1px);
}

.site-footer .social-link svg {
  display: block;
}

/* ---------- Print (Save as PDF) ---------- */
@media print {
  @page {
    margin: 14mm 14mm 16mm 14mm;
  }

  html,
  body {
    background: white !important;
    color: black !important;
  }

  /* Hide everything except the agenda. */
  .topbar,
  .fab,
  .modal-overlay,
  .layout,
  .agenda-empty,
  .agenda-header,
  .agenda-export,
  .notify-banner,
  .site-footer {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .print-header h1 {
    margin: 0 0 8px 0;
    font-size: 16pt;
    color: black;
  }

  .agenda {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Force the strategy <details> open in print regardless of UI state. */
  details {
    display: block !important;
  }
  details > * {
    display: revert !important;
  }
  details > summary {
    list-style: none;
    font-weight: 700;
    margin-bottom: 6px;
    color: black;
  }
  details > summary::-webkit-details-marker {
    display: none;
  }

  .agenda-strategy {
    background: white !important;
    border: 1px solid #d0d0d0 !important;
    color: black !important;
    box-shadow: none !important;
    margin-bottom: 12pt !important;
    padding: 10pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .agenda-strategy p {
    color: #222 !important;
  }

  .agenda-list {
    gap: 8pt;
  }

  .agenda-row {
    grid-template-columns: 60pt 1fr !important;
    gap: 10pt;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .agenda-time {
    color: black !important;
    padding-top: 10pt;
    font-size: 11pt;
  }

  .agenda-card {
    background: white !important;
    color: black !important;
    border: 1px solid #c0c0c0 !important;
    border-left: 3px solid #2dd4bf !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .agenda-title {
    color: black !important;
    font-size: 12pt;
  }

  .agenda-meta {
    color: #444 !important;
    font-size: 9pt;
  }

  .agenda-rationale {
    background: #f4f4f4 !important;
    color: #111 !important;
    font-size: 9.5pt;
    padding: 6pt 8pt !important;
  }

  .agenda-pill {
    background: #efefef !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    font-size: 8pt;
  }

  /* Avoid the sticky/positioning rules carrying into print. */
  .agenda-strategy,
  .agenda-card,
  .agenda-row {
    position: static !important;
  }
}
