/* confsched — shared styles. Vanilla CSS, mobile-first, light + dark. */

:root {
  --brand: #5b5bf0;
  --brand-600: #4a45e0;
  --brand-050: #eeeefc;
  --ok: #16a34a;
  --ok-bg: #e7f6ec;
  --warn: #d97706;
  --warn-bg: #fdf1df;
  --danger: #dc2626;
  --danger-bg: #fdeaea;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e4e6ef;
  --text: #1a1a2e;
  --muted: #6b6f80;
  --shadow: 0 1px 2px rgba(20, 20, 50, 0.06), 0 4px 16px rgba(20, 20, 50, 0.05);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8a8aff;
    --brand-600: #a0a0ff;
    --brand-050: #1c1c34;
    --ok: #4ade80;
    --ok-bg: #16281c;
    --warn: #fbbf24;
    --warn-bg: #2a2110;
    --danger: #f87171;
    --danger-bg: #2c1616;

    --bg: #0f0f1e;
    --surface: #181829;
    --surface-2: #20203a;
    --border: #2b2b45;
    --text: #e8e8f2;
    --muted: #9a9ab0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme='dark'] { color-scheme: dark; }
:root[data-theme='light'] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.brandmark { font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brandmark .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--brand); display: inline-block; }
.grow { flex: 1; }

/* ── Buttons / inputs ────────────────────────────────────── */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-weight: 600;
  transition: transform 0.04s ease, background 0.15s ease, border-color 0.15s;
}
button:hover, .btn:hover { border-color: var(--brand); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.active-toggle { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }

input[type=text], input[type=email], textarea, select {
  font: inherit; width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { font-weight: 600; font-size: 13px; }

/* ── Cards / panels ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ── Badges / chips ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand-050); color: var(--brand-600);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  text-transform: uppercase;
}
.badge.partner { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
/* "▶ Video" marker on a session that has a recording. */
.chip-video { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
/* The video chip is a real button, so it needs the font and cursor a <span>
   got for free. Everything else it inherits from .chip, which keeps a
   clickable chip and a decorative one looking identical. */
.chip-doc { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

button.chip { font-family: inherit; font-size: 12px; line-height: inherit; cursor: pointer; }
/* Resume prompt: brand-tinted so it reads as an offer rather than a warning. */
.keep-watching { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
/* Momentary ring on the card a shared link points at. */
/* Catch-up strip: horizontal so a day's worth of recordings costs one row
   rather than a screen, and still works on a phone. */
/* Slides / handout rows on a session. */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.doc-row .doc-icon { font-size: 18px; flex: none; }
.doc-row .doc-thumb { flex: none; width: 54px; aspect-ratio: 4 / 3; object-fit: cover; object-position: top;
  border-radius: 6px; border: 1px solid var(--border); background: #fff; }
/* min-width:0 is what lets the text actually shrink; without it a flex child
   refuses to go below its content width and the filename shoves the buttons
   out of the row. */
.doc-row .doc-text { flex: 1 1 140px; min-width: 0; }
.doc-row .doc-name { font-weight: 600; font-size: 13px; }
.doc-row .doc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row .doc-actions { display: flex; gap: 6px; flex: none; margin-left: auto; }
@media (max-width: 420px) { .doc-row .doc-actions { margin-left: 0; width: 100%; } }
.doc-frame { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.doc-frame iframe { width: 100%; height: 68vh; min-height: 380px; border: 0; display: block; }

.shelf-strip { display: flex; gap: 10px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; scroll-snap-type: x proximity; }
.shelf-item {
  flex: 0 0 156px; scroll-snap-align: start; text-align: left; cursor: pointer;
  background: transparent; border: 0; padding: 0; font: inherit; color: inherit;
}
.shelf-thumb {
  width: 156px; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--border); background: #000;
}
.shelf-thumb-blank { display: grid; place-items: center; color: #fff; font-size: 20px; }
/* A deck has no frame to show, so the tile makes its own cover — a typographic
   panel that reads as deliberate rather than as a video thumbnail that failed
   to load. */
.shelf-cover {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: relative; color: var(--brand);
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--brand) 20%, var(--surface-2)),
    color-mix(in srgb, var(--brand) 7%, var(--surface-2)));
}
.shelf-cover-track { position: absolute; top: 6px; left: 7px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.shelf-cover-icon { font-size: 24px; line-height: 1; }
.shelf-cover-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.shelf-badges { font-size: 11px; font-weight: 600; color: var(--brand); margin-top: 3px; }
.shelf-title { font-size: 13px; font-weight: 600; margin-top: 5px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-item:hover .shelf-thumb { border-color: var(--brand); }
.shelf-item:focus-visible .shelf-thumb { outline: 2px solid var(--brand); outline-offset: 2px; }

.daybar-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.daybar-toggle .daycaret { font-size: 11px; opacity: 0.7; width: 10px; }
.daybar-toggle .daysummary { margin-left: auto; display: flex; align-items: center; font-weight: 400; }
.daybar-toggle.is-collapsed { opacity: 0.75; }
.daybar-toggle:hover { opacity: 1; }

.session.linked { animation: linked-pulse 2.4s ease-out; }
@keyframes linked-pulse {
  0%, 55% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .session.linked { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); } }
button.chip-video:hover { background: var(--brand-600); border-color: var(--brand-600); }
button.chip-video:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Border only — .session.picked owns the inset shadow and --mecol, so a card
   that is both picked and recorded still reads as picked. */
.session.has-video { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.slot.is-past .session.has-video { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }

/* Player shell. 16:9 via aspect-ratio so the box is reserved before metadata
   loads and the card doesn't jump when playback starts. */
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  margin-top: 8px; border-radius: 10px; overflow: hidden;
  background: #000; border: 1px solid var(--border);
}
.video-frame video, .video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }


/* member initials avatar */
.ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--brand-050); color: var(--brand-600); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.ava.me { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Timeline (member grid) ──────────────────────────────── */
/* Sticky header holding the top bar + the view tabs, as one unit. */
.stickyhead { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); transition: transform 0.28s ease; }
.stickyhead > .topbar { position: static; border-bottom: none; background: transparent; backdrop-filter: none; }
.stickyhead .no-print:last-child { padding-bottom: 8px; }

/* Top-bar actions: inline on desktop; collapsed behind a ⋯ toggle on mobile. */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-menu-toggle { display: none; }
@media (max-width: 640px) {
  .topbar-menu-toggle { display: inline-flex; }
  .topbar-actions { display: none; flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .topbar-actions.open { display: flex; }
  /* Auto-hide the whole header when scrolling down; JS toggles .hide. */
  .stickyhead.hide { transform: translateY(-100%); }
}

.daybar {
  padding: 14px 0 8px; margin-top: 8px;
  font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}
.slot { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.slot .time { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 3px; }
.slot .time .end { display: block; font-weight: 500; opacity: 0.7; }
.slot.plenary .body { color: var(--muted); }
.slot .label { font-weight: 700; }

/* Speaker bios & photos */
.speaker-block { display: flex; gap: 12px; margin-top: 10px; align-items: flex-start; }
.speaker-photo { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border); background: var(--surface-2); }
.spk-thumb { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border); }

/* Mobile bottom tab bar (replaces the scrolling top tabs on phones) */
.botnav { display: none; }
@media (max-width: 680px) {
  .viewnav-top { display: none !important; }
  .botnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(0,0,0,0.12); }
  .botnav .bn { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; background: transparent; border: 0; color: var(--muted); padding: 7px 2px 6px; cursor: pointer; }
  .botnav .bn.active { color: var(--brand); }
  .botnav .bn .ic { font-size: 19px; line-height: 1; position: relative; }
  .botnav .bn .lb { font-size: 10px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .botnav .bn-badge { position: absolute; top: -5px; left: 10px; background: #e11d48; color: #fff; font-size: 9px; font-weight: 800; min-width: 14px; height: 14px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
  body { padding-bottom: 62px; }
  .offline-bar, .msgbar { bottom: 56px; }
}

/* Partners / sponsors directory */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.partner-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
/* White plate so logos designed for white backgrounds stay visible on dark theme. */
.partner-logo-wrap { height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: #fff; border-radius: 8px; padding: 8px; }
.partner-logo { max-height: 44px; max-width: 100%; width: auto; object-fit: contain; }
.partner-name { font-weight: 700; letter-spacing: -0.01em; }
.partner-chip { display: inline-flex; align-items: center; gap: 6px; }
.partner-chip img { height: 18px; width: auto; border-radius: 3px; }

/* Compact icon action buttons (session detail) */
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 17px; line-height: 1; cursor: pointer; text-decoration: none; color: var(--text); }
.iconbtn:hover { border-color: var(--brand); }
.iconbtn.on { border-color: #f5a623; box-shadow: inset 0 0 0 1px #f5a623; }

/* Card feedback indicators (you rated / you sent kudos) */
.fbk-ico { font-size: 13px; line-height: 1; }
.fbk-ico.star { color: #f5a623; }

/* Star rating */
.stars { display: flex; gap: 4px; }
.star { background: transparent; border: 0; padding: 0 2px; font-size: 26px; line-height: 1; cursor: pointer; color: color-mix(in srgb, var(--muted) 45%, transparent); transition: color 0.1s; }
.star.on { color: #f5a623; }
.star:hover { color: #f5a623; }

/* Install-to-home-screen tip */
.install-tip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--brand-050); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); border-radius: 12px; font-size: 13px; }
.install-tip .it-icon { font-size: 18px; flex: none; }
.install-tip .it-text { flex: 1; min-width: 0; color: var(--text); }
.install-tip .it-x { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; flex: none; }

/* Unread messages: tab badge + attention banner */
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .tab-badge { animation: badgepulse 1.8s ease-in-out infinite; } }
@keyframes badgepulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0.5); } 50% { box-shadow: 0 0 0 5px rgba(225,29,72,0); } }
.msgbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--brand); color: #fff; padding: 9px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 -2px 12px rgba(0,0,0,0.2); transform: translateY(110%); transition: transform 0.25s ease; }
.msgbar.show { transform: none; }
.msgbar-btn { background: #fff; color: var(--brand-600); border: 0; border-radius: 8px; padding: 5px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.msgbar-x { background: transparent; border: 0; color: rgba(255,255,255,0.85); font-size: 15px; cursor: pointer; padding: 2px 4px; }
@media print { .msgbar { display: none; } }

/* Offline banner */
.offline-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--warn, #d97706); color: #1a1a2e; text-align: center; padding: 9px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 -2px 12px rgba(0,0,0,0.18); transform: translateY(110%); transition: transform 0.25s ease; }
.offline-bar.show { transform: none; }
@media print { .offline-bar { display: none; } }

/* Schedule search & filter bar */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filterbar input[type="search"] { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; }
.filterbar select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; }
.filterbar .js-count { margin-left: auto; }

/* Past / now / upcoming state (venue-time based) */
/* Fade the parts of a finished block individually, not the block as a whole.
   Opacity on a parent caps everything inside it, so a whole-slot fade makes it
   impossible to keep any one card bright. Sessions with a recording are the
   thing people come back for once an event is over, so they hold full strength
   while the rest of the block recedes. */
.slot.is-past > .time,
.slot.is-past > .body > :not(.sessions),
.slot.is-past .session:not(.has-video) { opacity: 0.5; }
.slot.is-now { background: color-mix(in srgb, var(--ok, #16a34a) 9%, transparent); border-radius: 10px; box-shadow: inset 3px 0 0 var(--ok, #16a34a); padding-left: 8px; margin-left: -8px; }
.nowtag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.02em; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }
.nowtag.now { background: var(--ok, #16a34a); color: #fff; }
.nowtag.next { background: var(--brand-050); color: var(--brand-600); border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.slot .sublabel { font-size: 12px; color: var(--muted); }

.sessions {
  display: grid; gap: 10px; margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-items: start; /* each card only as tall as its own content, so expanding one
                         doesn't stretch its empty rowmates */
}
.session {
  position: relative; text-align: left; align-items: stretch;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 92px;
}
.session:hover { border-color: var(--brand); }
.session.picked { border-color: var(--mecol, var(--brand)); background: color-mix(in srgb, var(--mecol, var(--brand)) 12%, transparent); box-shadow: inset 0 0 0 1px var(--mecol, var(--brand)); }
.session .stitle { font-weight: 700; font-size: 14px; line-height: 1.25; }
.session .smeta { font-size: 12px; color: var(--muted); }
.session .sfoot { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.session .check {
  position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; color: transparent;
  padding: 0; background: transparent; cursor: pointer; z-index: 2;
}
.session .check:hover { border-color: var(--brand); }
.session.mine .check { background: var(--mecol, var(--brand)); border-color: var(--mecol, var(--brand)); color: #fff; }
/* Waitlisted: signed up but not holding a seat — dashed amber, distinct from a confirmed pick. */
.session.waitlisted { border-color: color-mix(in srgb, var(--warn) 55%, transparent); border-style: dashed; }
.session .check.wait { border-color: var(--warn); color: var(--warn); border-style: dashed; }
.session .room { font-size: 11px; font-weight: 700; color: var(--muted); }
.session.conflict { border-color: var(--danger); }

/* Inline notes on cards & time-block rows — capped so long notes never balloon. */
.snotes { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; cursor: pointer; }
.snote { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.snote-body { font-size: 12.5px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.snote-meta { font-size: 11px; margin-top: 3px; }
.snote-more { text-align: center; }
@media print { .snotes { max-height: none; overflow: visible; } .snote-body { -webkit-line-clamp: unset; } }

/* read-only expandable cards (public schedule) */
details.session { cursor: pointer; }
details.session > summary.session-summary { list-style: none; display: flex; flex-direction: column; gap: 6px; }
details.session > summary.session-summary::-webkit-details-marker { display: none; }
details.session[open] { border-color: var(--brand); }

.notes-btn {
  margin-left: auto; padding: 2px 8px; font-size: 12px; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.notes-btn:hover { border-color: var(--brand); color: var(--brand); }
.sfoot-actions { margin-left: auto; display: flex; gap: 6px; }
.sfoot-actions .notes-btn { margin-left: 0; }

/* ── Coverage panel ──────────────────────────────────────── */
.cov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat.good .num { color: var(--ok); }
.stat.warn .num { color: var(--warn); }
.stat.bad .num { color: var(--danger); }

/* ── Schedule editor ─────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.ed-block { border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.ed-block-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ed-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--muted); min-width: 92px; }
.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.ed-block .ed-row:first-child { border-top: none; }
.ed-add { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ed-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.ed-actions { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }
.ed-canceled .ed-title { text-decoration: line-through; opacity: 0.55; }
.ed-note { color: var(--warn); font-size: 12px; font-weight: 600; margin-top: 3px; }

/* change flags on session cards / rows */
.session.canceled { opacity: 0.62; }
.session.canceled .stitle { text-decoration: line-through; }
.sannounce { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 8px; padding: 4px 8px; }
.slot-announce { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 8px; padding: 4px 8px; margin-top: 4px; display: inline-block; }

/* ── Breakout matrix (grid view / embed) ─────────────────── */
.matrix-wrap { overflow-x: auto; margin-top: 14px; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.matrix { border-collapse: separate; border-spacing: 8px; min-width: 1160px; }
.matrix thead th { background: #5b5bf0; color: #fff; font-size: 12px; font-weight: 800; padding: 10px; border-radius: 10px; text-align: center; vertical-align: middle; width: 150px; }
.matrix .matrix-corner { background: transparent; }
.matrix th.matrix-round { background: #5b5bf0; color: #fff; text-align: left; min-width: 132px; border-radius: 10px; padding: 10px 12px; vertical-align: top; }
.matrix th.matrix-round > div:first-child { font-weight: 800; font-size: 13px; }
.matrix .matrix-round-sub { font-weight: 600; color: rgba(255, 255, 255, 0.82); font-size: 11px; margin-top: 3px; }
.matrix-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; vertical-align: top; width: 150px; font-size: 12.5px; line-height: 1.35; box-shadow: var(--shadow); }
.matrix-cell.has { cursor: pointer; transition: border-color 0.12s ease, transform 0.04s ease; }
.matrix-cell.has:hover { border-color: var(--brand); }
.matrix-cell.has:active { transform: translateY(1px); }
.matrix-title { font-weight: 700; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .matrix-cell { background: var(--surface-2); } }

/* Compact breakout grid (embed) — denser, title-only. */
.breakouts.compact .daybar { font-size: 13px; padding: 10px 0 6px; margin-top: 6px; }
.breakouts.compact .sessions { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; margin-top: 6px; }
.breakouts.compact .session { padding: 7px 9px; min-height: 0; gap: 4px; }
.breakouts.compact .stitle { font-size: 12.5px; }
.breakouts.compact .badge { font-size: 10px; padding: 2px 6px; }
@media (max-width: 420px) { .breakouts.compact .sessions { grid-template-columns: 1fr 1fr; } }

/* ── Matrix / grid layout (tracks × rounds) ──────────────── */
.matrix-scroll { overflow-x: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
.matrix th, .matrix td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: top; }
.matrix tr > *:last-child { border-right: 0; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix .m-th, .matrix .m-corner { position: sticky; top: 0; z-index: 3; background: var(--surface-2); color: var(--text); font-weight: 700; text-align: left; padding: 8px 10px; min-width: 128px; }
.matrix .m-th.m-track { color: #fff; }
.matrix .m-corner { left: 0; z-index: 4; min-width: 96px; }
.matrix .m-rowh { position: sticky; left: 0; z-index: 2; background: var(--surface-2); color: var(--text); font-weight: 700; text-align: left; padding: 8px 10px; min-width: 96px; max-width: 150px; }
.matrix .m-rowh.m-track { color: #fff; }
.matrix .m-cell { padding: 7px 10px; min-width: 128px; max-width: 220px; }
.matrix .m-cell:hover { background: var(--brand-050); }
.matrix .m-empty { text-align: center; color: var(--muted); }
.matrix .m-title { font-weight: 650; line-height: 1.25; }
.matrix .m-spk, .matrix .m-room { font-size: 11px; margin-top: 2px; }
.matrix .m-desc { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); white-space: pre-wrap; max-width: 240px; }

/* ── Countdown ───────────────────────────────────────────── */
.countdown { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.cd-unit { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 58px; }
.cd-num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* Floating "jump to now" pill. Only appears during the event when the live session
   is off-screen — it never moves the page on its own; tapping is the only scroll. */
.nowfab {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(10px);
  z-index: 95; background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  padding: 9px 15px; font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 5px 18px rgba(0,0,0,0.28);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.nowfab.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nowfab .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.7); animation: nowpulse 1.8s ease-out infinite; }
@keyframes nowpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); } 70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (max-width: 680px) { .nowfab { bottom: 74px; } }
@media (prefers-reduced-motion: reduce) { .nowfab { transition: opacity 0.2s ease; } .nowfab .dot { animation: none; } }

/* ── Footer funnel ───────────────────────────────────────── */
.brandfoot { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px 40px; }
.brandfoot a { font-weight: 700; text-decoration: none; }

/* ── Modal ───────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 25, 0.55); display: grid; place-items: center;
  padding: 16px; z-index: 50;
}
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }

@media print {
  .topbar, .viewnav, .no-print, .brandfoot, .toast, .notes-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .ed-block { box-shadow: none !important; border-color: #bbb; }
  .wrap { max-width: 100%; padding: 0; }
  .daybar { position: static; background: none; border-color: #999; }
  .agenda-item, .ed-row, .ed-block, .card { break-inside: avoid; }
}

@media (max-width: 560px) {
  .slot { grid-template-columns: 60px 1fr; }
  .sessions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .sessions { grid-template-columns: 1fr; }
}

/* ── Study view: recording and slides side by side ────────────────────────── */
/* Fills the viewport below the top bar so both panes are usable at once;
   scrolling a page-length layout while trying to follow a talk is the thing
   this view exists to avoid. */
.watch-split {
  --split: 55%;
  display: grid;
  grid-template-columns: var(--split) 10px minmax(0, 1fr);
  gap: 0;
  height: calc(100dvh - 116px);
  min-height: 420px;
  padding: 12px;
  box-sizing: border-box;
}
.watch-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.watch-left { justify-content: center; }
.watch-left .video-frame { aspect-ratio: auto; height: 100%; }
.watch-doc { flex: 1; min-height: 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface-2); }
.watch-doc iframe { width: 100%; height: 100%; border: 0; display: block; }

.watch-handle { cursor: col-resize; border-radius: 3px; margin: 0 3px; background: transparent;
  transition: background 0.15s ease; }
.watch-handle:hover, .watch-handle:focus-visible, .watch-split.dragging .watch-handle {
  background: color-mix(in srgb, var(--brand) 55%, transparent); outline: none; }
/* A drag in progress must not select text in either pane, or the page fills
   with blue highlight the moment the pointer crosses the video. */
.watch-split.dragging { user-select: none; }
.watch-split.dragging iframe { pointer-events: none; }

.watch-title { font-weight: 700; font-size: 15px; }
.watch-tabs { display: flex; gap: 6px; }
.watch-tabs .tab { padding: 5px 11px; font-size: 12px; }

/* Stacked on a phone: side-by-side panes would leave neither usable. The video
   stays put at the top so the deck scrolls beneath it. */
@media (max-width: 860px) {
  .watch-split { display: block; height: auto; padding: 10px; }
  .watch-handle { display: none; }
  .watch-left { position: sticky; top: 0; z-index: 5; background: var(--bg);
    padding-bottom: 8px; margin-bottom: 8px; }
  /* Cap the sticky player so a tall phone still shows a useful slice of the
     deck underneath it rather than a sliver. */
  .watch-left .video-frame { max-height: 40dvh; }
  .watch-left video { object-fit: contain; }
  .watch-left .video-frame { aspect-ratio: 16 / 9; height: auto; }
  /* flex:none matters: the base rule sets flex:1, which is flex-basis:0%, and
     a flex-basis beats height on a flex item — so the height below was being
     ignored and the deck collapsed to the iframe's default. */
  .watch-doc { flex: none; height: 78dvh; min-height: 460px; }
}
