/* =========================================================
   Light-Way design tokens
   ========================================================= */
:root {
  /* Brand: navy & gold (from the Light-Way crest). The token names "teal" and
     "amber" are historical — they now hold navy and gold. */
  --ink: #0F1A2E;
  --ink-soft: #4A566B;
  --paper: #F7F5EF;
  --paper-raised: #FFFFFF;
  --line: #E0DCCF;
  --teal: #14284B;
  --teal-deep: #0B1A33;
  --teal-tint: #E7ECF5;
  --amber: #C9A227;
  --amber-tint: #F8F0D6;
  --stage: #0A1426;
  --stage-tile: #111F3A;
  --stage-line: #24365A;
  --danger: #B4453A;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(22, 33, 31, 0.06), 0 8px 24px rgba(22, 33, 31, 0.06);
  /* System fonts only — nothing is fetched from an outside website. */
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --ink: #E8ECF4;
  --ink-soft: #A9B4CA;
  --paper: #0D1525;
  --paper-raised: #152038;
  --line: #27385C;
  --teal: #2C4C8C;
  --teal-deep: #1F3868;
  --teal-tint: #1B2B4D;
  --amber: #D8B13A;
  --amber-tint: #3A3115;
  --stage: #070D1A;
  --danger: #E0685C;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink: #E8ECF4;
  --ink-soft: #A9B4CA;
  --paper: #0D1525;
  --paper-raised: #152038;
  --line: #27385C;
  --teal: #2C4C8C;
  --teal-deep: #1F3868;
  --teal-tint: #1B2B4D;
  --amber: #D8B13A;
  --amber-tint: #3A3115;
  --stage: #070D1A;
  --danger: #E0685C;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  color: var(--ink);
}

p { line-height: 1.55; color: var(--ink-soft); }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  display: inline-block;
}

.brand-crest {
  height: 38px;
  width: auto;
  display: block;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-block:hover { text-decoration: none; }
.brand-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  padding-left: 48px; /* aligns under the wordmark, past the crest image */
}

.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; row-gap: 8px; }
.topnav-user { color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; white-space: nowrap; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #94372e; }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* =========================================================
   Flash messages
   ========================================================= */
.flash-stack { max-width: 520px; margin: 0 auto 20px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; }
.flash-success { background: var(--teal-tint); color: var(--teal-deep); }
.flash-error { background: #FBE7E4; color: var(--danger); }
.flash-info { background: var(--amber-tint); color: #6b5410; }

/* =========================================================
   Auth pages
   ========================================================= */
.page.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}

.auth-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .sub { margin-bottom: 26px; font-size: 0.93rem; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field textarea:focus {
  border-color: var(--teal);
  background: #fff;
}

.auth-switch { margin-top: 20px; font-size: 0.88rem; text-align: center; color: var(--ink-soft); }

/* =========================================================
   Dashboard
   ========================================================= */
.page { padding: 40px 32px 80px; max-width: 1040px; margin: 0 auto; }

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.dash-head h1 { font-size: 1.9rem; }
.dash-actions { display: flex; gap: 10px; }

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 32px 0 14px;
}

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

.meeting-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.meeting-card h3 { font-size: 1.05rem; }
.meeting-card .code {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--teal-deep);
  background: var(--teal-tint);
  padding: 3px 9px;
  border-radius: 5px;
  display: inline-block;
  width: fit-content;
}
.meeting-card .meta { font-size: 0.82rem; color: var(--ink-soft); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* =========================================================
   Meeting room — the spotlight layout
   ========================================================= */
.page.room-page {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--stage);
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  color: #fff;
  border-bottom: 1px solid var(--stage-line);
}
.room-header .title { font-family: var(--font-display); font-size: 1.05rem; }
.room-header .code-pill {
  font-family: monospace;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.08);
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  color: #D3DCEE;
}
.room-header-right { display: flex; align-items: center; gap: 14px; }
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #E8C65A;
}
.live-dot::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(201,162,39,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(201,162,39,0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::before { animation: none; }
  .hero-glow { animation: none; }
  .steps-path::before { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

.room-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
}

.stage-area {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  padding: 20px 24px;
  min-height: 0;
  flex: 1;
}

/* The host's tile — larger than a participant tile, but modest in size
   so there's real room left over for everyone else to be seen clearly. */
.spotlight-tile {
  position: relative;
  flex: 0 0 300px;
  max-width: 300px;
  background: var(--stage-tile);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spotlight-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spotlight-tile .avatar-fallback {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
}
.tile-label {
  position: absolute;
  left: 14px; bottom: 14px;
  background: rgba(10, 20, 38, 0.72);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.host-badge {
  background: var(--amber);
  color: #1B1403;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Everyone else — a wrapping grid that fills whatever space the host
   tile leaves behind, so a lot of participants can be visible at once. */
.filmstrip-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.filmstrip-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8C9DC2;
  margin-bottom: 10px;
}
.filmstrip {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 168px);
  grid-auto-rows: 112px;
  justify-content: start;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}
.mini-tile {
  position: relative;
  width: 168px;
  height: 112px;
  background: var(--stage-tile);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-tile .avatar-fallback {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--teal-deep);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.mini-tile .tile-label {
  font-size: 0.7rem;
  padding: 3px 8px;
  left: 8px; bottom: 8px;
}
.mini-tile.muted-indicator::after {
  content: "🔇";
  position: absolute;
  top: 8px; right: 8px;
  font-size: 0.75rem;
}

/* In-room "recording" indicator — a compact badge in the header, only
   shown while the host actually has recording turned on. */
.recording-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(196, 90, 74, 0.14);
  border: 1px solid rgba(196, 90, 74, 0.4);
  border-radius: 20px;
  color: #ffb3a3;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.recording-notice .rec-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: pulse 1.6s infinite ease-in-out;
}

.recording-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #E8C65A;
  letter-spacing: 0.02em;
}

/* Playback page */
.playback-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px 40px;
}
.playback-note {
  color: #D3DCEE;
  font-size: 0.9rem;
  text-align: center;
  max-width: 480px;
}
.playback-video {
  width: 100%;
  max-width: 900px;
  max-height: 65vh;
  background: #000;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stage-line);
}
.room-page .btn-ghost {
  color: #fff;
  border-color: var(--stage-line);
}
.room-page .btn-ghost:hover {
  border-color: var(--teal);
  color: #F0D676;
}

.filmstrip-empty {
  color: #7D8DB0;
  font-size: 0.85rem;
  padding: 14px 4px;
}

/* Controls bar */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: #070F1F;
  border-top: 1px solid var(--stage-line);
  flex-wrap: wrap;
}
.ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 60px;
  height: 52px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stage-line);
  background: var(--stage-tile);
  color: #D3DCEE;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ctrl-btn .icon { width: 19px; height: 19px; display: block; }
.ctrl-btn .icon svg { width: 100%; height: 100%; display: block; }
.ctrl-btn .ctrl-label { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.ctrl-btn:hover { background: #17264A; border-color: #2A3F6B; }
.ctrl-btn.active-off { background: rgba(196, 90, 74, 0.16); border-color: var(--danger); color: #ffb3a3; }
.ctrl-btn.active-on { background: rgba(201, 162, 39, 0.18); border-color: var(--amber); color: #F0D676; }
.ctrl-btn.leave {
  flex-direction: row;
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  width: auto;
  height: 44px;
  padding: 0 22px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.86rem;
  gap: 8px;
  align-self: center;
}
.ctrl-btn.leave:hover { background: #94372e; }

/* Recording is a distinct "live" red, not the generic teal "on" state */
#btn-record.active-on { background: rgba(196, 90, 74, 0.22); border-color: var(--danger); color: #ffb3a3; }

/* Notes side panel */
.notes-panel {
  position: fixed;
  top: 0; right: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: var(--paper-raised);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 40;
}
.notes-panel.open { transform: translateX(0); }
.notes-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notes-header h3 { font-size: 1.05rem; margin: 0; }
.notes-close {
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.notes-close:hover { color: var(--ink); }
.notes-close svg { width: 17px; height: 17px; }
.notes-list { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.note-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.note-item .note-meta { font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
.note-item .note-content { font-size: 0.9rem; color: var(--ink); white-space: pre-wrap; }
.notes-form { padding: 14px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.notes-form textarea {
  resize: vertical;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--paper);
}


/* =========================================================
   Gallery view
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
  flex: 1;
  align-content: start;
}
.gallery-grid .spotlight-tile,
.gallery-grid .mini-tile {
  width: 100%;
  height: 200px;
  max-width: none;
  flex: none;
}
.gallery-grid .mini-tile { aspect-ratio: auto; }

/* =========================================================
   Reaction picker + floating toasts
   ========================================================= */
.reaction-picker { display: flex; gap: 6px; }
.reaction-btn {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 50%;
  font-size: 1.05rem;
  padding: 0;
}

.reaction-toasts {
  position: fixed;
  left: 24px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 45;
  pointer-events: none;
}
.reaction-toast {
  background: rgba(10, 20, 38, 0.9);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: reaction-pop 2.6s ease forwards;
  box-shadow: var(--shadow-card);
}
.reaction-emoji { font-size: 1.2rem; }
.reaction-name { color: #D3DCEE; font-weight: 600; }
@keyframes reaction-pop {
  0% { opacity: 0; transform: translateY(8px); }
  10% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* =========================================================
   Virtual background picker
   ========================================================= */
.bg-picker-wrap { position: relative; }
.background-menu {
  display: none;
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--stage-tile);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 150px;
  box-shadow: var(--shadow-card);
  z-index: 50;
}
.background-menu.open { display: block; }
.bg-option {
  padding: 8px 10px;
  color: #fff;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bg-option:hover { background: #1A2C52; }
.bg-option.selected { background: var(--teal); }

/* =========================================================
   Control button states
   ========================================================= */
.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
#btn-chat, #btn-participants, #btn-notes { position: relative; }

/* Badge shown on a tile that's currently sharing their screen */
.presenting-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(10, 20, 38, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
}
.spotlight-tile, .mini-tile { position: relative; }

.hand-badge { font-size: 0.95em; }

/* =========================================================
   Waiting room / lobby overlay
   ========================================================= */
.waiting-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 38, 0.92);
  z-index: 60;
  align-items: center;
  justify-content: center;
}
.waiting-overlay.show { display: flex; }
.waiting-box {
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.waiting-box h3 { margin-bottom: 8px; }
.waiting-box p { margin-bottom: 16px; }

/* =========================================================
   Chat panel
   ========================================================= */
.chat-panel .chat-item { margin-bottom: 4px; }
.chat-item .chat-meta { font-size: 0.72rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.chat-item .chat-bubble {
  background: var(--teal-tint);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: inline-block;
  max-width: 90%;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-item-self .chat-bubble { background: var(--teal); color: #fff; }
.chat-form { flex-direction: row !important; }
.chat-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--paper);
}

/* =========================================================
   Participants panel
   ========================================================= */
.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.participant-name { display: flex; align-items: center; gap: 6px; }
.participants-toolbar { padding: 0 20px 12px; }
.pending-section { padding: 14px 20px 0; }
.pending-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 700; margin-bottom: 8px; }
.pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pending-name { font-size: 0.88rem; font-weight: 600; }
.pending-actions { display: flex; gap: 6px; }



/* =========================================================
   Chat send button — icon-only, matches the close-button treatment
   ========================================================= */
#chat-send {
  width: 40px; height: 40px; min-width: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#chat-send svg { width: 17px; height: 17px; }

/* =========================================================
   Recording consent modal (reuses .waiting-overlay/.waiting-box)
   ========================================================= */
.consent-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

/* =========================================================================
   Responsive — phones and tablets
   Breakpoints:
     <= 1024px            tablets (iPads etc.) — layout stays horizontal
                           (spotlight + filmstrip side by side), just tighter
     <= 720px              phone portrait — call stacks vertically, controls
                           compact down to icon+label pills
     <= 400px              small phones — icon-only controls, no labels
     short landscape height  forces the horizontal layout back on even on a
                           phone, since there's no vertical room to stack
   ========================================================================= */

/* ---- Tablet: portrait iPads and similar — mild tightening only ---- */
@media (max-width: 1024px) {
  .spotlight-tile { flex-basis: 240px; max-width: 240px; }
  .filmstrip { grid-template-columns: repeat(auto-fill, 150px); grid-auto-rows: 100px; }
  .mini-tile { width: 150px; height: 100px; }
  .notes-panel { width: 320px; }
}

/* ---- Global chrome (top bar, dashboard, auth) from tablet width down ---- */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .topnav { gap: 10px; row-gap: 6px; }
  .topnav-link { font-size: 0.82rem; }
  .topnav-user { display: none; } /* name isn't essential chrome at this width */
  .brand-tagline { display: none; }

  .page { padding: 24px 16px 56px; }
  .dash-head { flex-direction: column; align-items: flex-start; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1; }

  .auth-card { padding: 30px 22px; }
}

/* ---- Phone portrait: stack the call, compact the controls ---- */
@media (max-width: 720px) {
  .room-header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .room-header .title { font-size: 0.95rem; }
  .room-header-right { gap: 8px; }

  .stage-area { flex-direction: column; padding: 10px; gap: 10px; }
  .spotlight-tile {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    height: max(160px, 28vh);
  }
  .filmstrip-wrap { min-height: 96px; }
  .filmstrip { grid-template-columns: repeat(auto-fill, 118px); grid-auto-rows: 82px; }
  .mini-tile { width: 118px; height: 82px; }

  .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 10px; gap: 8px; }

  .reaction-picker { display: none; } /* keeps the control bar to one row on narrow phones */
  .background-menu { left: auto; right: 0; transform: none; }

  .controls-bar { gap: 6px; padding: 10px 8px; }
  .ctrl-btn { min-width: 50px; height: 46px; padding: 5px 6px; }
  .ctrl-btn .icon { width: 17px; height: 17px; }
  .ctrl-btn .ctrl-label { font-size: 0.58rem; }
  .ctrl-btn.leave { height: 40px; padding: 0 16px; font-size: 0.8rem; }

  .reaction-toasts { left: 12px; bottom: 118px; }

  .notes-panel, .chat-panel, .participants-panel { width: 100%; max-width: 100%; }

  .waiting-box { padding: 26px 20px; max-width: 92vw; }
  .consent-actions { flex-direction: column; }
  .consent-actions .btn { width: 100%; }
}

/* ---- Small phones: icon-only control bar, no room for labels ---- */
@media (max-width: 400px) {
  .ctrl-btn .ctrl-label { display: none; }
  .ctrl-btn { min-width: 42px; width: 42px; height: 42px; padding: 0; }
  .controls-bar { gap: 5px; }
  .spotlight-tile { height: max(140px, 24vh); }
  .filmstrip { grid-template-columns: repeat(auto-fill, 104px); grid-auto-rows: 74px; }
  .mini-tile { width: 104px; height: 74px; }
}

/* ---- Landscape phones: short viewport — go horizontal like a tablet,
        there just isn't enough vertical room to stack the call ---- */
@media (max-height: 480px) and (orientation: landscape) {
  .stage-area { flex-direction: row; padding: 8px 12px; gap: 10px; }
  .spotlight-tile { flex: 0 0 200px; max-width: 200px; width: auto; height: auto; }
  .filmstrip { grid-template-columns: repeat(auto-fill, 110px); grid-auto-rows: 76px; }
  .mini-tile { width: 110px; height: 76px; }
  .controls-bar { padding: 6px 8px; }
  .ctrl-btn { height: 38px; }
  .ctrl-btn .ctrl-label { display: none; }
  .waiting-box { padding: 18px 22px; }
}

/* =========================================================================
   Landing page — signed-out visitors
   The name is the concept: "Light-way" is a beam cutting through the dark.
   The page opens on the same dark stage the actual call uses (var(--stage))
   with a single warm glow behind the headline, then gets literally lighter
   as you scroll — paper, then white — before returning to dark for the
   footer. It's not a coat of paint; the palette *is* the pitch.
   ========================================================================= */

.page.landing-page { max-width: none; padding: 0; }

.section-inner { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* ---- Nav (sits flush against the hero, reads as one dark block) ---- */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: var(--stage);
  border-bottom: 1px solid var(--stage-line);
}
.brand-on-dark { color: #fff; }
.landing-nav-links { display: flex; gap: 28px; }
.landing-nav-links a {
  color: #BCC8E0;
  font-size: 0.9rem;
  font-weight: 600;
}
.landing-nav-links a:hover { color: #fff; text-decoration: none; }
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }

.btn-ghost-dark { background: transparent; border-color: var(--stage-line); color: #EEF2FA; }
.btn-ghost-dark:hover { border-color: #fff; color: #fff; }
.btn-amber { background: var(--amber); color: #1B1403; }
.btn-amber:hover { background: #B8921F; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* ---- Hero ---- */
.hero {
  position: relative;
  background: radial-gradient(ellipse at 50% 0%, #14284B 0%, var(--stage) 55%, #070F1F 100%);
  overflow: hidden;
  padding: 96px 32px 110px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 560px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.30) 0%, rgba(201, 162, 39, 0) 68%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-crest { height: 130px; width: auto; margin: 0 auto 20px; display: block; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.12;
  margin-bottom: 22px;
}
.hero-sub {
  color: #CBD5E8;
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 34px;
}
.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ---- Feature / steps sections — page gets literally lighter here ---- */
.section-band { padding: 84px 32px; }
.section-band:nth-of-type(1) { background: var(--paper); }
.section-steps { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.eyebrow-dark { color: var(--teal); }
.section-band h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  max-width: 620px;
  margin-bottom: 48px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--teal-tint);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; margin: 0; }

/* ---- Steps: a real ordered process, so numbering earns its place ---- */
.steps-path {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  position: relative;
}
.steps-path::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 10px, transparent 10px 18px);
}
.step { position: relative; }
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--stage);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.step h3 { font-size: 1.02rem; margin-bottom: 8px; }
.step p { font-size: 0.9rem; margin: 0; }

/* ---- Final CTA band ---- */
.cta-band {
  background: linear-gradient(135deg, var(--teal-deep), var(--stage));
  padding: 76px 32px;
  text-align: center;
}
.cta-inner h2 { color: #fff; margin-bottom: 10px; }
.cta-inner p { color: #CBD5E8; margin-bottom: 28px; }

/* ---- Footer ---- */
.landing-footer { background: var(--stage); padding: 32px; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { color: #9AA8C4; font-size: 0.84rem; margin: 0; }

/* ---- Responsive: landing page ---- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-path { grid-template-columns: 1fr; gap: 32px; }
  .steps-path::before { display: none; }
}

@media (max-width: 640px) {
  .landing-nav { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .landing-nav-links { display: none; } /* anchor nav isn't worth the space on a phone */
  .landing-nav-actions { width: 100%; justify-content: flex-end; }

  .hero { padding: 56px 20px 64px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }

  .section-band { padding: 56px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 56px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* =========================================================================
   Interactive track switcher — "Education administration" / "Business"
   ========================================================================= */
.track-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 36px;
}
.track-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.track-tab .icon { width: 16px; height: 16px; display: block; }
.track-tab .icon svg { width: 100%; height: 100%; }
.track-tab:hover { color: var(--ink); }
.track-tab.is-active { background: var(--teal); color: #fff; }

.track-panel {
  display: none;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
.track-panel.is-active { display: grid; }
.track-panel-text h3 { margin-bottom: 10px; }
.track-panel-text p { margin: 0; }

.track-topics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.track-topics li {
  padding: 12px 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

/* =========================================================================
   Split-screen auth pages (login / register) — branding panel + form
   ========================================================================= */
.page.auth-split-page { max-width: none; padding: 0; min-height: 100vh; min-height: 100dvh; }

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-branding {
  position: relative;
  background: radial-gradient(ellipse at 50% 0%, #14284B 0%, var(--stage) 55%, #070F1F 100%);
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-glow {
  top: -160px;
  left: -80px;
  transform: none;
  width: 480px;
  height: 420px;
}
.auth-branding-tagline {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 22px 0 14px;
  position: relative;
}
.auth-branding h2 {
  position: relative;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1.3;
  max-width: 380px;
  margin-bottom: 32px;
}
.auth-branding-points {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.auth-branding-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #DCE4F3;
  font-size: 0.9rem;
}
.auth-branding-points .icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: var(--amber);
}
.auth-branding-points .icon svg { width: 16px; height: 16px; }

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--paper);
}
.auth-form-side .auth-card { box-shadow: none; border: 1px solid var(--line); }

/* =========================================================================
   Motion touches — small, purposeful, all skip under prefers-reduced-motion
   ========================================================================= */

/* The hero glow breathes gently, like light rather than a static graphic */
.hero-glow {
  animation: glow-breathe 6s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}
.auth-glow { animation: glow-breathe-static 6s ease-in-out infinite; }
@keyframes glow-breathe-static {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* The dashed line connecting the 3 steps slowly "flows" — a small nod to
   the brand name (light finding its way along the path) */
.steps-path::before {
  animation: path-flow 3.5s linear infinite;
}
@keyframes path-flow {
  from { background-position: 0 0; }
  to { background-position: 18px 0; }
}

/* Feature cards lift slightly on hover — cheap, tasteful affordance */
.feature-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(20, 40, 36, 0.12); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================================
   Responsive: track switcher and auth split
   ========================================================================= */
@media (max-width: 900px) {
  .track-panel.is-active { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 780px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-branding {
    padding: 28px 24px;
    min-height: 0;
  }
  .auth-branding h2 { font-size: 1.25rem; max-width: none; margin-bottom: 20px; }
  .auth-branding-points { display: none; } /* keep the mobile branding band short so the form isn't pushed below the fold */
  .auth-glow { width: 320px; height: 260px; top: -120px; }
  .auth-form-side { padding: 32px 20px 48px; }
}

@media (max-width: 640px) {
  .track-switch { flex-direction: column; width: 100%; border-radius: var(--radius-md); }
  .track-tab { justify-content: center; }
}

/* =========================================================================
   Consultant marketplace — directory, profiles, booking, messaging, admin
   ========================================================================= */

.topnav-link { color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }
.topnav-link:hover { color: var(--ink); text-decoration: none; }
.topnav-admin { color: var(--amber); }

.back-link { display: inline-block; margin-bottom: 20px; color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; }
.section-heading { margin: 32px 0 14px; font-size: 1.05rem; }

/* ---- Marketplace promo card on the dashboard ---- */
.marketplace-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 36px;
}
.marketplace-promo h3 { font-size: 1.02rem; margin-bottom: 4px; }
.marketplace-promo p { margin: 0; font-size: 0.88rem; }
.marketplace-promo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Directory grid ---- */
.consultant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.consultant-card {
  display: block;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.consultant-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(20,40,36,0.1); text-decoration: none; }
.consultant-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.consultant-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.consultant-headline { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 12px; }
.consultant-card-price { margin-top: 14px; font-weight: 700; color: var(--teal-deep); }

.avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-circle-lg { width: 64px; height: 64px; font-size: 1.4rem; }

.verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
}
.verified-badge .icon { width: 12px; height: 12px; }
.verified-badge .icon svg { width: 100%; height: 100%; }

.vertical-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--amber-tint);
  color: #6b5410;
}
.vertical-pill.vertical-business { background: var(--teal-tint); color: var(--teal-deep); }
.vertical-pill.vertical-both { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }

/* ---- Public consultant profile ---- */
.profile-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}
.profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.profile-badges { display: flex; gap: 8px; margin-top: 8px; }
.profile-bio { line-height: 1.65; margin-bottom: 24px; white-space: pre-wrap; }
.profile-actions { margin-top: 20px; }

.price-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}
.price-amount { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--teal-deep); margin-bottom: 8px; }
.price-note { font-size: 0.8rem; color: var(--ink-soft); margin: 0; }

.booking-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.booking-card h3 { margin-bottom: 14px; }
.or-divider { text-align: center; color: var(--ink-soft); font-size: 0.8rem; margin: 4px 0 14px; }

.profile-summary-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-top: 20px;
}
.profile-summary-card p { margin-bottom: 10px; }

/* ---- Status pills (appointments + verification) ---- */
.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  text-transform: capitalize;
}
.status-pending { background: var(--amber-tint); color: #6b5410; }
.status-approved, .status-confirmed, .status-completed { background: var(--teal-tint); color: var(--teal-deep); }
.status-rejected, .status-declined, .status-cancelled { background: #FBE7E4; color: var(--danger); }

/* ---- Appointment / admin queue rows (shared list pattern) ---- */
.appointment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.appointment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.appointment-row strong { display: block; margin-bottom: 2px; }
.appt-time { display: block; font-size: 0.82rem; color: var(--ink-soft); }
.appt-note { font-size: 0.84rem; color: var(--ink-soft); margin: 4px 0 0; font-style: italic; }
.appt-price { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 0.86rem; color: var(--teal-deep); }
.appt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Availability slots ---- */
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
}

/* ---- Messaging inbox + thread ---- */
.conversation-list { display: flex; flex-direction: column; gap: 8px; }
.conversation-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--ink);
}
.conversation-row:hover { border-color: var(--teal); text-decoration: none; }
.conversation-preview strong { display: block; margin-bottom: 2px; }
.conversation-preview p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60ch; }

.thread-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 680px;
}
.thread-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.thread-messages { display: flex; flex-direction: column; gap: 12px; min-height: 200px; margin-bottom: 20px; }
.thread-messages .chat-item-self { align-self: flex-end; text-align: right; }
.thread-form { display: flex; gap: 10px; align-items: flex-end; }
.thread-form textarea { flex: 1; min-height: 44px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; resize: vertical; }

/* ---- Admin document list ---- */
.doc-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.doc-list li a {
  display: inline-block;
  padding: 10px 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.doc-list-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; }
.reject-form { margin-top: 12px; }

/* ---- Wider auth-style card for multi-field forms ---- */
.auth-card-wide { max-width: 560px; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr; gap: 14px; }

/* =========================================================================
   Responsive: marketplace pages
   ========================================================================= */
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .consultant-grid { grid-template-columns: 1fr; }
  .marketplace-promo { flex-direction: column; align-items: flex-start; }
  .appointment-row { flex-direction: column; align-items: flex-start; }
  .appt-actions { width: 100%; }
  .conversation-preview p { max-width: 40ch; }
}

/* =========================================================================
   Landing page — "Book a consultant directly" advertisement section
   ========================================================================= */
.book-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}
.book-lead { margin: 18px 0 26px; max-width: 46ch; }

.book-points {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.book-points li { display: flex; align-items: flex-start; gap: 12px; }
.book-points .icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex; align-items: center; justify-content: center;
}
.book-points .icon svg { width: 12px; height: 12px; }
.book-points span:last-child { font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); }
.book-points strong { color: var(--ink); }

.book-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Preview: two stacked sample profile cards, offset like a browsable stack */
.book-preview { position: relative; padding-top: 34px; min-height: 340px; }
.book-preview-label {
  position: absolute;
  top: 0; left: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.book-preview-card {
  cursor: default;
  width: 300px;
  max-width: 80vw;
  position: absolute;
}
.book-preview-card:hover { transform: none; box-shadow: var(--shadow-card); }
.book-preview-card:first-of-type { top: 34px; left: 0; z-index: 2; }
.book-preview-card-behind {
  top: 78px;
  left: 44px;
  z-index: 1;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .book-layout { grid-template-columns: 1fr; gap: 40px; }
  .book-preview { max-width: 100%; margin: 0; padding-top: 30px; min-height: 300px; }
  .book-preview-label { white-space: nowrap; }
  .book-preview-card { width: min(280px, 76vw); }
  .book-preview-card-behind { left: 32px; top: 70px; }
}

@media (max-width: 640px) {
  .book-actions { flex-direction: column; width: 100%; }
  .book-actions .btn { width: 100%; }
}

/* =========================================================================
   Password reveal toggle (login, register, account settings)
   ========================================================================= */
.password-field-wrap { position: relative; }
.password-field-wrap input {
  width: 100%;
  padding-right: 44px; /* room for the toggle button so text never runs under it */
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.password-toggle-btn:hover { color: var(--ink); background: var(--paper); }
.password-toggle-btn svg { width: 18px; height: 18px; }

/* =========================================================================
   Admin: user management
   ========================================================================= */
.user-search-form {
  display: flex;
  gap: 10px;
  margin: 24px 0 20px;
  max-width: 420px;
}
.user-search-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--paper-raised);
}
.user-row { color: var(--ink); }
.user-row:hover { border-color: var(--teal); text-decoration: none; }
.moderation-card { margin-top: 16px; border-color: rgba(196, 90, 74, 0.3); }

/* Call time-limit badge in the room header */
.time-limit-notice {
  font-size: 0.76rem;
  font-weight: 700;
  color: #BCC8E0;
  background: rgba(255,255,255,0.06);
  padding: 5px 12px;
  border-radius: 20px;
}

/* =========================================================================
   Virtual school: checkbox pills (Cambridge stage selection)
   ========================================================================= */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-raised);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.checkbox-pill input { accent-color: var(--teal); }
.checkbox-pill:has(input:checked) { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-deep); }

/* =========================================================================
   Sign-up role selector (student / teacher / parent / other)
   ========================================================================= */
.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}
.role-option input { margin-top: 3px; accent-color: var(--teal); }
.role-option-body { display: flex; flex-direction: column; gap: 2px; font-size: 0.84rem; }
.role-option-body strong { color: var(--ink); font-size: 0.9rem; }
.role-option-body span { color: var(--ink-soft); font-size: 0.78rem; }
.role-option:has(input:checked) { border-color: var(--teal); background: var(--teal-tint); }
@media (max-width: 520px) { .role-options { grid-template-columns: 1fr; } }

.field-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .field-row-2 { grid-template-columns: 1fr; } }

/* Fix: the global `.field label { display:block }` rule was beating the
   flex layout on option pills nested inside a .field. Raising specificity. */
.field .role-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  font-size: inherit;
  color: inherit;
}
.field .checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.field .checkbox-pill:has(input:checked) { color: var(--teal-deep); }
.field .role-option input, .field .checkbox-pill input { width: auto; flex-shrink: 0; }


/* ---- Landing: "Join Light-Way" student / teacher / parent cards ---- */
.join-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.join-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.join-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(20, 40, 36, 0.12); }
.join-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.join-card p { font-size: 0.92rem; margin: 0 0 20px; flex: 1; }
.join-note { margin: 28px 0 0; font-size: 0.92rem; text-align: center; }
@media (max-width: 960px) { .join-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Admin-controlled sessions: requests, guest lists
   ========================================================= */
.request-row { align-items: flex-start; gap: 24px; }
.request-info { flex: 1 1 280px; min-width: 0; }
.request-actions { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.request-approve { display: flex; flex-direction: column; gap: 8px; }
.request-approve .field { margin-bottom: 0; }
.request-decline { display: flex; gap: 8px; align-items: center; }
.request-decline input { flex: 1; min-width: 0; }

.guest-list {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  padding: 6px;
}
.guest-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}
.guest-option:hover { background: var(--teal-tint); }
.guest-option input { accent-color: var(--teal); }
.guest-email { color: var(--ink-soft); font-size: 0.8rem; margin-left: 6px; }

/* =========================================================
   Landing: mission, programmes, values
   ========================================================= */
.mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.mission-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}
.mission-card h3 { font-size: 1.15rem; }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 28px; }
.value-card {
  border-top: 3px solid var(--amber);
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.value-card h3 { font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.value-card p { margin: 0; font-size: 0.9rem; }
.program-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }
.program-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.program-card h3 { font-size: 1.1rem; margin: 0; }
.program-card p { margin: 0; font-size: 0.92rem; }
.objective-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.objective-list li { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; }
.objective-list strong { display: block; margin-bottom: 4px; color: var(--ink); }
.objective-list span { font-size: 0.9rem; color: var(--ink-soft); }

/* ---- Landing creative additions ---- */
.hero-pills { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 34px 0 0; }
.hero-pills li { padding: 7px 16px; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; color: rgba(255,255,255,0.9); font-size: 0.82rem; letter-spacing: 0.03em; backdrop-filter: blur(4px); background: rgba(255,255,255,0.06); }
.program-card { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.program-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(20,40,36,.12); }
.program-num { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--amber); opacity: .85; }
.program-points { margin: 6px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: .88rem; line-height: 1.7; }
.pathway { list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; padding: 0; margin: 40px 0 0; position: relative; }
.pathway li { position: relative; padding: 34px 18px 0; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.pathway li::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--teal), var(--amber)); }
.pathway li:first-child::before { left: 50%; } .pathway li:last-child::before { right: 50%; }
.pathway-dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 21px; height: 21px; border-radius: 50%; background: var(--paper-raised); border: 4px solid var(--amber); box-shadow: 0 0 0 4px var(--amber-tint); }
.pathway strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.pathway span:not(.pathway-dot) { font-size: .88rem; color: var(--ink-soft); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
@media (max-width: 900px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .service-grid { grid-template-columns: 1fr; } }
.service-card { background: var(--paper-raised); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius-md); padding: 16px 18px; transition: transform .18s ease, border-color .18s ease; }
.service-card:hover { transform: translateX(4px); border-left-color: var(--amber); }
.service-card h3 { font-size: 1rem; margin-bottom: 4px; } .service-card p { margin: 0; font-size: .88rem; }
.faq { max-width: 760px; }
.faq details { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 18px; margin-top: 12px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--amber); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; }
@media (max-width: 640px) { .pathway li::before, .pathway li:first-child::before, .pathway li:last-child::before { display: none; } .pathway li { padding-top: 38px; padding-bottom: 14px; } }

/* ---- Director's welcome ---- */
.director { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 48px; align-items: center; }
.director-photo { position: relative; }
.director-photo::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 3px solid var(--amber); border-radius: var(--radius-lg); z-index: 0; }
.director-photo img { position: relative; z-index: 1; width: 100%; display: block; border-radius: var(--radius-lg); object-fit: cover; aspect-ratio: 4 / 4.4; object-position: 50% 20%; box-shadow: var(--shadow-card); }
.director-text h2 { margin-bottom: 14px; }
.director-text p { font-size: 1.02rem; line-height: 1.7; }
.director-sign { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; padding-left: 14px; border-left: 3px solid var(--amber); }
.director-sign span { font-size: .88rem; color: var(--ink-soft); }
@media (max-width: 760px) { .director { grid-template-columns: 1fr; gap: 36px; } .director-photo { max-width: 340px; margin: 0 auto; } }

/* =========================================================
   School portal: tracker, panels, timetable, notices, reports
   ========================================================= */
.tracker { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; margin: 22px 0; counter-reset: t; }
.tracker-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: .85rem; color: var(--ink-soft); }
.tracker-step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.tracker-step:first-child::before { display: none; }
.tracker-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-raised); border: 2px solid var(--line); font-weight: 700; font-size: .85rem; }
.tracker-done .tracker-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.tracker-done::before, .tracker-current::before { background: var(--teal); }
.tracker-current .tracker-dot { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px var(--amber-tint); }
.tracker-current .tracker-label, .tracker-done .tracker-label { color: var(--ink); font-weight: 600; }
.tracker-failed .tracker-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tracker-failed::before { background: var(--danger); }
.ref-card { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 16px; border: 1px dashed var(--amber); border-radius: var(--radius-md); background: var(--amber-tint); margin-bottom: 8px; }
.ref-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ref-number { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .05em; }
.student-panel { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-card); }
.student-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.student-panel-head h2 { margin: 0 0 4px; font-size: 1.4rem; }
.student-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 8px; }
.student-panel-grid h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; font-family: var(--font-body); }
.student-panel-grid p { margin: 0 0 8px; font-size: .92rem; }
.notice-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.notice { background: var(--paper-raised); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius-md); padding: 12px 16px; }
.notice p { margin: 6px 0 0; font-size: .92rem; }
.notice-date { display: block; font-size: .78rem; color: var(--ink-soft); margin: 2px 0; }
.timetable-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.tt-day { display: grid; grid-template-columns: 70px 1fr; gap: 16px; margin-bottom: 14px; }
.tt-date { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--teal); color: #fff; border-radius: var(--radius-md); padding: 8px 4px; }
.tt-date strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.tt-date span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.tt-items { display: flex; flex-direction: column; gap: 8px; }
.tt-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px; }
.tt-item .appt-time { display: block; }
@media (max-width: 860px) { .timetable-layout { grid-template-columns: 1fr; } .tracker { grid-template-columns: 1fr 1fr; row-gap: 18px; } .tracker-step::before { display: none; } }
.report-sheet { max-width: 760px; margin: 0 auto; background: var(--paper-raised); border: 1px solid var(--line); border-top: 6px solid var(--amber); border-radius: var(--radius-md); padding: 36px 40px; box-shadow: var(--shadow-card); }
.report-head { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.report-crest { height: 72px; width: auto; }
.report-head h1 { margin: 2px 0; font-size: 1.7rem; }
.report-tagline { margin: 0; color: var(--ink-soft); font-style: italic; }
.report-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 24px; margin-bottom: 14px; }
.report-meta p { margin: 0 0 6px; } .report-meta strong { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.report-text { white-space: pre-wrap; line-height: 1.7; }
.report-actions { display: flex; gap: 10px; margin-top: 26px; }
@media print {
  .topbar, .no-print, .flash-stack, .landing-footer { display: none !important; }
  body, html { background: #fff; }
  .report-sheet { border: none; box-shadow: none; padding: 0; max-width: none; }
}


/* =========================================================
   High-class finishing touches (navy & gold)
   ========================================================= */
.section-band h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--amber), rgba(201, 162, 39, 0));
  border-radius: 2px;
}
.hero h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.hero-crest { filter: drop-shadow(0 8px 24px rgba(201, 162, 39, 0.35)); }
.btn-amber { box-shadow: 0 6px 18px rgba(201, 162, 39, 0.28); }
.laurel-rule { display: flex; align-items: center; gap: 16px; color: var(--amber); margin: 8px 0 28px; }
.laurel-rule::before, .laurel-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201,162,39,0), var(--amber)); }
.laurel-rule::after { background: linear-gradient(270deg, rgba(201,162,39,0), var(--amber)); }

/* Public inner pages */
.public-hero { background: radial-gradient(ellipse at 50% 0%, #14284B 0%, var(--stage) 70%); padding: 72px 32px 64px; text-align: center; }
.public-hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 14px; }
.public-hero p { color: #CBD5E8; max-width: 640px; margin: 0 auto; font-size: 1.05rem; line-height: 1.6; }
.crest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin-top: 28px; }
.crest-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 6px; }
.crest-num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--amber); font-family: var(--font-display); font-weight: 700; margin-bottom: 6px; }
.crest-card h3 { margin: 0; font-size: 1.1rem; } .crest-card p { margin: 0; font-size: .93rem; }
.crest-quote { max-width: 760px; margin: 40px auto 0; text-align: center; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.5; color: var(--teal); }
.crest-quote::before { content: "\201C"; display: block; font-size: 3rem; color: var(--amber); line-height: .6; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 36px; } .prose p, .prose li { line-height: 1.75; color: var(--ink-soft); }
.prose ul { padding-left: 20px; }
.admit-steps { list-style: none; counter-reset: a; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.admit-steps li { counter-increment: a; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 20px; }
.admit-steps li::before { content: counter(a); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--amber); font-family: var(--font-display); font-weight: 700; }
.admit-steps strong { display: block; color: var(--ink); } .admit-steps span { font-size: .92rem; color: var(--ink-soft); }
.promise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 28px; }
.promise-card { background: var(--paper-raised); border: 1px solid var(--line); border-top: 4px solid var(--amber); border-radius: var(--radius-md); padding: 20px; }
.promise-card h3 { font-size: 1.02rem; margin-bottom: 6px; } .promise-card p { margin: 0; font-size: .92rem; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: #CBD5E8; font-size: .9rem; } .footer-links a:hover { color: var(--amber); text-decoration: none; }

/* ---- Dark mode components that use literals ---- */
:root[data-theme="dark"] a { color: #9DB8EC; }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-danger,
:root[data-theme="dark"] .btn-amber, :root[data-theme="dark"] a.btn { text-decoration: none; }
:root[data-theme="dark"] .btn-primary { color: #fff; }
:root[data-theme="dark"] .btn-amber { color: #14284B; }
:root[data-theme="dark"] .field input:focus, :root[data-theme="dark"] .field textarea:focus { background: var(--paper-raised); }
:root[data-theme="dark"] .landing-nav-links a, :root[data-theme="dark"] .brand-on-dark { color: #fff; }
:root[data-theme="dark"] .topnav-link { color: var(--ink-soft); }
:root[data-theme="dark"] .topnav-admin { color: var(--amber); }
:root[data-theme="dark"] img.brand-crest { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) a { color: #9DB8EC; }
  :root:not([data-theme="light"]) .btn-primary { color: #fff; }
  :root:not([data-theme="light"]) .btn-amber { color: #14284B; }
  :root:not([data-theme="light"]) .field input:focus, :root:not([data-theme="light"]) .field textarea:focus { background: var(--paper-raised); }
  :root:not([data-theme="light"]) .topnav-admin { color: var(--amber); }
}

/* ---- Theme toggle ---- */
.theme-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--paper-raised); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
}
.theme-toggle:hover { border-color: var(--amber); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---- Admin navigation ---- */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--amber); color: #14284B;
  font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: "\25BE"; margin-left: 5px; font-size: 0.75em; }
.nav-menu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 70; min-width: 230px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
}
.nav-menu-panel a { padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink); font-size: 0.9rem; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.nav-menu-panel a:hover { background: var(--teal-tint); text-decoration: none; }

/* ---- Admin control room ---- */
.attention-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.attention-card {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); color: var(--ink);
}
.attention-card:hover { text-decoration: none; border-color: var(--amber); }
.attention-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.attention-label { font-size: 0.86rem; color: var(--ink-soft); }
.attention-card.is-hot { border-color: var(--amber); box-shadow: inset 3px 0 0 var(--amber); }
.attention-card.is-clear .attention-num { color: var(--ink-soft); }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.quick-action { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-raised); color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.quick-action small { display: block; margin-top: 2px; font-weight: 400; color: var(--ink-soft); font-size: 0.8rem; }
.quick-action:hover { text-decoration: none; border-color: var(--teal); }
@media (max-width: 800px) { .attention-grid { grid-template-columns: repeat(2, 1fr); } .nav-menu-panel { position: static; box-shadow: none; } }

:root[data-theme="dark"] .eyebrow, :root[data-theme="dark"] .eyebrow-dark { color: var(--amber); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow, :root:not([data-theme="light"]) .eyebrow-dark { color: var(--amber); } }

/* ---- Back-to-home link on login / sign-up ---- */
.back-home { display: block; width: 100%; max-width: 420px; align-self: center; margin-bottom: 14px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.back-home:hover { color: var(--teal); text-decoration: none; }
.auth-form-side { flex-direction: column; }

/* ---- Placements: students + teachers lists, new-placement dialog ---- */
.placement-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; align-items: start; }
.placement-columns h3, .placement-current-title { margin-bottom: 12px; }
.placement-columns .appointment-row a { color: inherit; }
@media (max-width: 800px) { .placement-columns { grid-template-columns: 1fr; } }
.placement-dialog {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 26px;
  background: var(--paper-raised); color: var(--ink); width: min(480px, 92vw);
  box-shadow: var(--shadow-card);
}
.placement-dialog::backdrop { background: rgba(10, 20, 38, 0.55); }
.placement-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---- All users: category filter ---- */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-raised); color: var(--ink-soft); font-size: 0.86rem; font-weight: 600;
}
.filter-tab:hover { text-decoration: none; border-color: var(--amber); color: var(--ink); }
.filter-tab.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.filter-count { opacity: 0.75; font-weight: 500; margin-left: 4px; }
.cat-pill { background: var(--teal-tint); color: var(--teal-deep); }
.cat-admin { background: var(--amber-tint); color: #6b5410; }
.cat-guest { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }

/* ---- Notifications: bell, panel, toasts ---- */
.notif { position: relative; }
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper-raised); color: var(--ink-soft); cursor: pointer;
}
.notif-bell:hover { color: var(--ink); border-color: var(--amber); }
.notif-bell.has-urgent { color: var(--amber); border-color: var(--amber); animation: notif-ring 1.6s ease-in-out infinite; }
@keyframes notif-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,.5); } 50% { box-shadow: 0 0 0 6px rgba(201,162,39,0); } }
@media (prefers-reduced-motion: reduce) { .notif-bell.has-urgent { animation: none; } }
.notif-count {
  position: absolute; top: -5px; right: -5px; min-width: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 80; width: min(360px, 92vw);
  max-height: 70vh; overflow: auto; padding: 8px;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
}
.notif-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; }
.notif-link { background: none; border: 0; padding: 0; color: var(--ink-soft); font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: underline; }
.notif-link:hover { color: var(--ink); }
.notif-desktop { display: block; margin: 8px; }
.notif-empty { margin: 0; padding: 18px 10px; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
.notif-item, .toast {
  display: flex; gap: 10px; padding: 12px; border-radius: var(--radius-sm);
  border-left: 4px solid var(--line); background: var(--paper);
}
.notif-item + .notif-item { margin-top: 6px; }
.lvl-urgent { border-left-color: var(--danger); }
.lvl-warn { border-left-color: var(--amber); }
.lvl-info { border-left-color: var(--teal); }
.notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-body strong { font-size: 0.9rem; color: var(--ink); }
.notif-body span { font-size: 0.84rem; color: var(--ink-soft); }
.notif-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column;
  gap: 10px; width: min(360px, calc(100vw - 36px));
}
.toast { background: var(--paper-raised); border: 1px solid var(--line); border-left-width: 4px; box-shadow: var(--shadow-card); }
.toast.lvl-urgent { border-left-color: var(--danger); }
.toast.lvl-warn { border-left-color: var(--amber); }

/* =========================================================
   Classes, timetable and teacher-hosted sessions
   ========================================================= */
.class-pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--teal-tint); color: var(--teal-deep); white-space: nowrap; }
.class-pill-none { background: var(--amber-tint); color: #6b5410; }
.class-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.class-chip { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink-soft); font-size: .86rem; text-decoration: none; }
.class-chip:hover { border-color: var(--teal); color: var(--teal-deep); }
.class-chip.is-on { background: var(--teal); border-color: var(--teal); color: #fff; }
.inline-class-form { margin-top: 6px; }
.inline-class-form select { font-size: .85rem; padding: 3px 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type="text"] { flex: 1; min-width: 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--ink-soft); }
.radio-line { display: block; font-weight: 400; margin: 4px 0; }
.is-archived { opacity: .6; }
.roster { margin-top: 6px; font-size: .86rem; }
.roster summary { cursor: pointer; color: var(--teal-deep); }
.roster ul { margin: 6px 0 0 18px; padding: 0; }

/* Compulsory lessons, automatic recording, silent observer */
.attendance-notice { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--amber-tint); color: #6b5410; }
.observer-notice { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #1f2d36; color: #d7e5ec; border: 1px dashed #5b7686; }
.attendance-overlay { z-index: 9999; }
.controls-bar.is-observer .ctrl-btn:not(#btn-view-mode):not(#btn-chat):not(#btn-participants):not(#btn-leave) { display: none; }
.controls-bar.is-observer .reaction-picker { display: none; }
.is-observer ~ .chat-panel .chat-form, .chat-panel .chat-form.is-readonly { display: none; }
.observe-btn { border-color: #5b7686; }

/* ---------- Whiteboard + enlarged screen share ---------- */
.wb-overlay, .focus-overlay {
  position: fixed; inset: 0; z-index: 120; display: none;
  flex-direction: column; background: #0E1A22;
}
.wb-overlay.show, .focus-overlay.show { display: flex; }
.wb-toolbar, .focus-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 12px; background: #16262f; color: #fff; flex: 0 0 auto;
}
.wb-toolbar-view, .focus-bar { justify-content: space-between; }
.wb-btn {
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; min-height: 36px;
}
.wb-btn.is-on { background: rgba(201,162,39,.25); border-color: var(--amber); color: #F0D676; }
.wb-btn.wb-close { margin-left: auto; background: rgba(196,90,74,.25); border-color: var(--danger); }
.wb-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); cursor: pointer; padding: 0;
}
.wb-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--amber); }
.wb-sep { width: 1px; height: 24px; background: rgba(255,255,255,.2); }
.wb-stage {
  position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px;
}
#wb-canvas {
  background: #fff; max-width: 100%; max-height: 100%; aspect-ratio: 16 / 9;
  width: auto; height: auto; touch-action: none; cursor: crosshair; border-radius: 6px;
}
#wb-canvas.wb-readonly { cursor: default; pointer-events: none; }
#wb-text-input {
  display: none; position: absolute; z-index: 2; min-width: 160px; background: rgba(255,255,255,.9);
  border: 1px dashed #888; padding: 0; margin: 0; resize: both; font-family: "Segoe UI", Arial, sans-serif; line-height: 1.25;
}

/* ---- Shared-screen viewer: the picture IS the overlay; the bar floats on top ---- */
.focus-overlay {
  width: 100%; height: 100%; height: 100dvh;
  background: #000; overflow: hidden; z-index: 130;
}
.focus-overlay.show { display: block; }
.focus-overlay video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;           /* "Fit": the whole screen, nothing cropped */
  background: #000;
}
.focus-overlay.fill video { object-fit: cover; }   /* "Fill": crop to cover the display */
/* Phone held upright: turn the picture sideways so it uses the whole screen */
.focus-overlay.rotated video {
  inset: auto; top: 50%; left: 50%;
  width: 100vh; width: 100dvh; height: 100vw; height: 100dvw;
  transform: translate(-50%, -50%) rotate(90deg);
}
.focus-overlay:fullscreen { width: 100%; height: 100%; background: #000; }
.focus-overlay:-webkit-full-screen { width: 100%; height: 100%; background: #000; }
.focus-overlay .focus-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  transition: opacity .25s ease, transform .25s ease;
}
.focus-overlay .focus-bar.hidden { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.focus-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.focus-actions .wb-btn[hidden] { display: none; }
/* Waiting for the first tap before the browser allows full screen */
.focus-overlay.needs-tap #focus-full { animation: focusPulse 1.2s ease-in-out infinite; border-color: var(--amber); }
@keyframes focusPulse { 50% { box-shadow: 0 0 0 4px rgba(201,162,39,.45); } }
@media (prefers-reduced-motion: reduce) { .focus-overlay.needs-tap #focus-full { animation: none; } }
@media (max-width: 720px) { .focus-overlay .focus-bar { font-size: .85rem; } .focus-bar #focus-label { flex: 1 1 100%; } .focus-actions { justify-content: flex-start; } }

/* ---- Tiles that are presenting show the whole screen, not a cropped webcam picture ---- */
.spotlight-tile.is-screen video, .mini-tile.is-screen video { object-fit: contain; background: #000; }

/* ---- Share chooser (phones / tablets) ---- */
.share-sheet { z-index: 140; }
.share-sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.share-sheet-actions .btn { width: 100%; }


/* =========================================================
   Usability pass: navigation, confirmations, admin guidance
   ========================================================= */

/* ---- Accessibility basics ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--teal); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ---- Top bar: stays in reach while scrolling ---- */
.topbar { position: sticky; top: 0; z-index: 60; flex-wrap: wrap; gap: 8px 20px; }
.topnav { margin-left: auto; justify-content: flex-end; gap: 6px 20px; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.topnav-sep { width: 1px; height: 20px; background: var(--line); }

.topnav-link { padding: 8px 2px; }
/* Admin links used gold text on white (about 2.4:1, hard to read). Navy reads clearly;
   dark mode keeps gold, which is bright enough on a dark background. */
.topnav-admin { color: var(--teal); }
.topnav-link.is-current { color: var(--ink); box-shadow: inset 0 -2px 0 var(--amber); }
.nav-menu-panel a.is-current { background: var(--teal-tint); }

.nav-toggle {
  display: none; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--teal); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

/* Mid-size screens: the signed-in name is the first thing to give way (Account stays). */
@media (max-width: 1399px) { .topnav-user, .topnav-sep { display: none; } }

/* Below this width the links fold into a Menu button next to the logo. */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .topbar-tools { order: 2; margin-left: auto; }
  .topnav { order: 3; flex-basis: 100%; margin-left: 0; justify-content: flex-start; }
  .js .topnav { display: none; flex-direction: column; align-items: stretch; gap: 0; padding-top: 6px; }
  .js .topnav.is-open { display: flex; }
  .topnav > .topnav-link, .nav-menu > summary { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  .topnav-link.is-current { box-shadow: inset 3px 0 0 var(--amber); padding-left: 12px; }
  .topnav > .btn { margin-top: 10px; min-height: 44px; }
  .nav-menu-panel { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .nav-menu-panel a { padding: 12px; }
  .topnav-user { display: block; padding: 10px 4px 0; }
}

/* Dashboard counters: five in a row on desktop, two on a phone, never an orphan row. */
.attention-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---- Buttons: comfortable to hit ---- */
.btn-sm { min-height: 36px; }
@media (pointer: coarse) { .btn { min-height: 44px; } }

/* ---- Messages ---- */
.flash-stack { max-width: 640px; }
.flash-stack .flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; transition: opacity 0.2s ease; }
.flash.is-leaving { opacity: 0; }
.flash-close {
  flex: none; background: none; border: 0; color: inherit; cursor: pointer;
  font-size: 1.3rem; line-height: 1; padding: 0 4px; opacity: 0.7;
}
.flash-close:hover { opacity: 1; }
:root[data-theme="dark"] .flash-error { background: #3A1F22; color: #F2A39A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flash-error { background: #3A1F22; color: #F2A39A; } }

/* ---- Confirmation dialog ---- */
.confirm-dialog {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0;
  background: var(--paper-raised); color: var(--ink); width: min(440px, 92vw); box-shadow: var(--shadow-card);
}
.confirm-dialog::backdrop { background: rgba(10, 20, 38, 0.55); }
.confirm-body { padding: 24px 26px 20px; }
.confirm-body h3 { margin: 0 0 8px; font-size: 1.2rem; }
.confirm-body p { margin: 0 0 22px; color: var(--ink-soft); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---- Admin: live-now banner and setup guide ---- */
.live-banner {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; margin: 0 0 22px;
  border: 1px solid var(--amber); border-left-width: 4px; border-radius: var(--radius-md);
  background: var(--amber-tint); color: var(--ink);
}
.live-banner-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: live-pulse 1.8s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(180, 69, 58, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(180, 69, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 69, 58, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-row small { display: block; color: var(--ink-soft); }

.guide-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-raised); margin: 0 0 8px; }
.guide-card > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.guide-card > summary::-webkit-details-marker { display: none; }
.guide-card > summary::after { content: "Show"; font-weight: 500; color: var(--ink-soft); font-size: 0.85rem; }
.guide-card[open] > summary::after { content: "Hide"; }
.guide-steps {
  counter-reset: step; list-style: none; margin: 0; padding: 4px 18px 18px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px;
}
.guide-steps li {
  counter-increment: step; position: relative; padding: 14px 14px 14px 52px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.guide-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.guide-steps a { font-weight: 600; }
.guide-steps small { display: block; margin-top: 2px; color: var(--ink-soft); line-height: 1.4; }

/* ---- Forms: grouped, with hints ---- */
.form-section { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.form-section > legend {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  width: 100%; padding: 0 0 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
}
.field-hint { display: block; margin-top: 4px; font-size: 0.82rem; font-weight: 400; color: var(--ink-soft); line-height: 1.4; }
.picker-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.picker-count { margin-left: auto; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.search-clear { font-size: 0.85rem; margin-left: 6px; }

/* ---- Form controls: dropdowns match the text fields; radios/checkboxes stay their own size ---- */
main.page select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 34px 10px 12px; max-width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-color: var(--paper); color: var(--ink); font-size: 0.95rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
main.page select:focus { border-color: var(--teal); }
.field select { width: 100%; }
.inline-class-form select { padding: 4px 28px 4px 8px; }
.field input[type="checkbox"], .field input[type="radio"] {
  width: auto; padding: 0; margin: 0 8px 0 0; flex: none; accent-color: var(--teal);
  vertical-align: -2px; background: none;
}
.radio-line { display: flex; align-items: flex-start; gap: 2px; padding: 6px 0; font-weight: 400; color: var(--ink); font-size: 0.93rem; line-height: 1.4; }
.radio-line input { margin-top: 3px; }


/* ===========================================================================
   Student link (guests without accounts), invite panel, "More" menu
   =========================================================================== */
.guest-crest { display: block; width: 56px; height: 56px; margin: 0 auto 12px; object-fit: contain; }
.guest-note { margin-top: 16px; font-size: .85rem; color: var(--ink-soft); line-height: 1.45; }
.link-box { width: 100%; padding: 8px 10px; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); color: inherit; }
.nav-menu-note { padding: 8px 14px 6px; font-size: .78rem; opacity: .7; max-width: 240px; line-height: 1.35; }

.invite-panel .invite-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.invite-help { margin: 0; font-size: .9rem; line-height: 1.45; }
.invite-link-row { display: flex; gap: 8px; }
.invite-link-row input { flex: 1; min-width: 0; padding: 8px 10px; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); color: inherit; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.toggle-row input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.toggle-row small { display: block; opacity: .7; font-size: .8rem; margin-top: 2px; }
.invite-note { min-height: 1.2em; margin: 0; font-size: .85rem; color: var(--teal); }
.appt-actions .btn[data-copy] { white-space: nowrap; }


/* =========================================================
   Presentations (slides)
   The overlay covers the whole screen for everyone while the host presents.
   Viewers: the slide alone, full screen, with a bar that hides itself.
   Host: presenter view (slide, next-slide preview, buttons, strip of slides).
   ========================================================= */
.sl-overlay {
  position: fixed; inset: 0; z-index: 135; display: none; color: #fff;
  width: 100%; height: 100%; height: 100dvh; background: #000; overflow: hidden;
}
.sl-overlay.show { display: block; }
.sl-overlay:fullscreen { width: 100%; height: 100%; background: #000; }
.sl-overlay:-webkit-full-screen { width: 100%; height: 100%; background: #000; }

.sl-stage { position: absolute; inset: 0; background: #000; }
.sl-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;            /* the whole slide, never cropped */
  user-select: none; -webkit-user-drag: none; background: #000;
}
.sl-stage img:not([src]) { visibility: hidden; }
.sl-loading, .sl-failed {
  position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px;
  background: rgba(0,0,0,.72); font-size: .95rem; z-index: 2;
}
.sl-loading[hidden], .sl-failed[hidden] { display: none; }

/* ----- top bar ----- */
.sl-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
  background: linear-gradient(to bottom, rgba(0,0,0,.78), rgba(0,0,0,0));
  transition: opacity .25s ease, transform .25s ease;
}
.sl-topbar.hidden { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.sl-heading { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.sl-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.sl-chip {
  flex: none; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(201,162,39,.25); color: #F0D676; border: 1px solid var(--amber);
}
.sl-top-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sl-top-actions .wb-btn[hidden] { display: none; }
.sl-top-actions .wb-btn.is-on { background: rgba(201,162,39,.25); border-color: var(--amber); color: #F0D676; }
.sl-overlay.needs-tap #sl-full { animation: focusPulse 1.2s ease-in-out infinite; border-color: var(--amber); }
@media (prefers-reduced-motion: reduce) { .sl-overlay.needs-tap #sl-full { animation: none; } }

/* ----- viewers: slide count in the corner, always there but quiet ----- */
.sl-counter {
  position: absolute; z-index: 3; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  padding: 4px 12px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: .9rem; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* Phone held upright: turn the slide sideways so it uses the whole screen */
.sl-overlay.rotated .sl-stage img {
  inset: auto; top: 50%; left: 50%;
  width: 100vh; width: 100dvh; height: 100vw; height: 100dvw;
  transform: translate(-50%, -50%) rotate(90deg);
}

/* ----- host: presenter view ----- */
.sl-overlay.is-host.show {
  display: grid; background: #0E1A22;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top top" "stage side" "ctrl ctrl" "strip strip";
}
.sl-overlay.is-host .sl-topbar {
  grid-area: top; position: static; background: #16262f; transform: none;
}
.sl-overlay.is-host .sl-stage {
  grid-area: stage; position: relative; inset: auto; margin: 10px; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.sl-hands {
  flex: 0 1 auto; font-size: .85rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(201,162,39,.22); color: #F0D676; border: 1px solid var(--amber);
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sl-hands[hidden] { display: none; }

.sl-side {
  grid-area: side; display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px 10px 0; min-height: 0; overflow-y: auto;
}
.sl-side-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.sl-next {
  position: relative; aspect-ratio: 16 / 9; width: 100%; flex: 0 0 auto; background: #000; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.sl-next img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sl-next img[hidden] { display: none; }
.sl-last-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 8px; font-size: .85rem; opacity: .75; }
.sl-last-note[hidden] { display: none; }
.sl-side-help { margin: 0; font-size: .82rem; line-height: 1.5; color: #c9d4dc; }
.sl-side-help kbd {
  display: inline-block; padding: 0 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px;
  font: inherit; font-size: .75rem; background: rgba(255,255,255,.08);
}

.sl-controls {
  grid-area: ctrl; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 12px; background: #16262f;
}
.sl-controls .wb-btn { min-height: 48px; min-width: 48px; font-size: 1rem; border-radius: 10px; }
.sl-controls .wb-btn:disabled { opacity: .35; cursor: default; }
.sl-controls .sl-big { padding: 8px 22px; font-weight: 600; }
.sl-controls .sl-primary { background: var(--amber); border-color: var(--amber); color: #1a1405; }
.sl-controls .sl-primary:disabled { background: rgba(201,162,39,.35); color: #fff; }
.sl-jump { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.sl-jump input {
  width: 4.2em; min-height: 48px; text-align: center; font: inherit; font-size: 1.05rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff;
}

.sl-strip {
  grid-area: strip; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: #101d25;
  scrollbar-width: thin;
}
.sl-thumb {
  position: relative; flex: 0 0 auto; width: 128px; aspect-ratio: 16 / 9; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 6px; background: #000; cursor: pointer;
}
.sl-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sl-thumb span {
  position: absolute; left: 4px; bottom: 3px; padding: 0 6px; border-radius: 4px;
  background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; font-variant-numeric: tabular-nums;
}
.sl-thumb:hover { border-color: rgba(255,255,255,.45); }
.sl-thumb.is-current { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(201,162,39,.4); }

@media (max-width: 820px) {
  .sl-overlay.is-host.show {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "stage" "ctrl" "strip";
  }
  .sl-side { display: none; }
  .sl-thumb { width: 96px; }
  .sl-controls .sl-big { padding: 8px 14px; }
  .sl-heading strong { max-width: 36vw; }
}
@media (max-height: 520px) {            /* a phone on its side: give the slide the room */
  .sl-strip { display: none; }
  .sl-controls { padding: 6px 10px; }
  .sl-controls .wb-btn, .sl-jump input { min-height: 40px; }
}

/* ----- the Slides panel (host) ----- */
.slides-panel { z-index: 45; }
.slides-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1 1 auto; }
.slides-drop {
  display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center;
  padding: 22px 14px; border: 2px dashed var(--line); border-radius: var(--radius-md);
  background: var(--paper); color: var(--ink); font: inherit; cursor: pointer;
}
.slides-drop strong { font-size: 1rem; }
.slides-drop span { font-size: .84rem; color: var(--ink-soft); line-height: 1.4; }
.slides-drop:hover, .slides-drop.is-drag { border-color: var(--amber); background: var(--amber-tint); }
.slides-drop:disabled { opacity: .6; cursor: progress; }
#slides-progress { width: 100%; height: 8px; }
#slides-progress[hidden] { display: none; }
.slides-note { min-height: 1.2em; margin: 0; font-size: .88rem; color: var(--teal); }
.slides-note.is-error, .slides-meta.is-error { color: var(--danger); }
.slides-empty { margin: 4px 0; font-size: .88rem; color: var(--ink-soft); }
.slides-list { display: flex; flex-direction: column; gap: 10px; }
.slides-item {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 12px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-raised);
}
.slides-thumb {
  grid-row: span 2; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--teal-tint);
  border: 1px solid var(--line);
}
.slides-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.slides-thumb.is-busy { animation: slidesPulse 1.2s ease-in-out infinite; }
@keyframes slidesPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .slides-thumb.is-busy { animation: none; } }
.slides-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slides-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.slides-meta { font-size: .82rem; color: var(--ink-soft); line-height: 1.35; }
.slides-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   Weak connections: low-data menu and the connection banner
   ========================================================= */
.lowdata-wrap { position: relative; }
.lowdata-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  padding: 8px;
  background: var(--stage-tile);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 60;
}
.lowdata-menu.show { display: block; }
.lowdata-title { color: #9FB0D0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 8px 6px; }
.lowdata-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #E3EAF8;
  text-align: left;
  cursor: pointer;
}
.lowdata-menu button b { font-size: 0.86rem; }
.lowdata-menu button span { font-size: 0.74rem; color: #9FB0D0; }
.lowdata-menu button:hover:not(:disabled) { background: #17264A; }
.lowdata-menu button.selected { border-color: var(--amber); background: rgba(201, 162, 39, 0.14); }
.lowdata-menu button:disabled { opacity: 0.4; cursor: not-allowed; }
.lowdata-menu button[hidden] { display: none; }

.net-banner {
  display: none;
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, calc(100vw - 24px));
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1B2B4D;
  border: 1px solid #2A3F6B;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  color: #F1F4FB;
  font-size: 0.86rem;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 70;
}
.net-banner.show { display: flex; }
.net-banner[data-kind="error"] { border-left-color: var(--danger); }
.net-banner[data-kind="info"] { border-left-color: #6FA3E8; }
.net-banner .net-action { background: var(--amber); color: #1a1405; border: 0; font-weight: 700; white-space: nowrap; }
.net-banner .net-close { background: none; border: 0; color: #9FB0D0; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 2px; }

.data-badge { font-size: 0.85em; opacity: 0.9; white-space: nowrap; }
.mini-tile.no-video video { visibility: hidden; }
.mini-tile.no-video { background: var(--stage-tile); }

/* =========================================================
   Seeing the class (presenter view), teacher video, calling on a student
   ========================================================= */
.sl-side { overflow: hidden; }
.sl-side-help { font-size: .72rem; line-height: 1.35; }
.sl-faces {
  flex: 1 1 45%; min-height: 120px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start;
}
.sl-face { background: #111F3A; border: 1px solid #24365A; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.sl-face.hand { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(201,162,39,.45); }
.sl-face.in-spotlight { border-color: #6FA3E8; box-shadow: 0 0 0 2px rgba(111,163,232,.5); }
.sl-face-media { position: relative; aspect-ratio: 4 / 3; background: #0A1426; }
.sl-face-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-face-initial { position: absolute; inset: 0; display: none; place-items: center; font-size: 1.6rem; font-weight: 700; color: #9FB0D0; }
.sl-face.no-video video { visibility: hidden; }
.sl-face.no-video .sl-face-initial { display: grid; }
.sl-face-name { font-size: .74rem; padding: 3px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-face-actions { display: flex; gap: 4px; padding: 3px 4px 5px; }
.sl-face-actions .wb-btn { flex: 1 1 auto; min-height: 30px; padding: 2px 4px; font-size: .72rem; border-radius: 6px; }
.sl-face-actions [data-act="call"] { background: var(--amber); border-color: var(--amber); color: #1a1405; font-weight: 700; }
.sl-chat-log {
  flex: 1 1 30%; min-height: 80px; overflow-y: auto; font-size: .8rem; line-height: 1.35;
  background: rgba(255,255,255,.05); border-radius: 6px; padding: 6px 8px;
}
.sl-chat-row { margin-bottom: 4px; overflow-wrap: anywhere; }
.sl-chat-row b { color: #F0D676; font-weight: 600; }
.sl-chat-form { display: flex; gap: 6px; flex: 0 0 auto; }
.sl-chat-form input {
  flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 0 10px; border-radius: 6px;
  border: 1px solid #2A3F6B; background: #0A1426; color: #fff;
}
.sl-chat-form .wb-btn { min-height: 38px; }
@media (max-width: 900px) { .sl-overlay.is-host.show { grid-template-columns: minmax(0, 1fr) 240px; } }

/* teacher's picture in the corner of a slide */
.sl-pip {
  position: absolute; z-index: 4; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom));
  width: clamp(110px, 18vw, 200px); aspect-ratio: 4 / 3; background: #000; border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 6px 18px rgba(0,0,0,.5);
}
.sl-pip[hidden] { display: none; }
.sl-pip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-pip-name { position: absolute; left: 6px; bottom: 4px; font-size: .7rem; text-shadow: 0 1px 3px #000; }
.sl-pip-x { position: absolute; top: 2px; right: 4px; background: rgba(0,0,0,.5); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; line-height: 1; cursor: pointer; }
.sl-overlay.rotated .sl-pip { display: none; } /* the slide is turned sideways: don't sit on it */

/* layer above full-screen slides: spotlight card, invitation, toasts */
#classview-layer { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
#classview-layer > * { pointer-events: auto; }
.cv-card {
  position: absolute; top: 72px; right: 12px; width: clamp(190px, 24vw, 320px);
  background: #0E1A22; border: 2px solid #6FA3E8; border-radius: 12px; overflow: hidden; color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
}
.cv-card[hidden] { display: none; }
.cv-card.is-speaking { border-color: var(--amber); }
.cv-media { position: relative; aspect-ratio: 4 / 3; background: #0A1426; }
.cv-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-avatar { position: absolute; inset: 0; display: none; place-items: center; font-size: 3rem; font-weight: 700; color: #9FB0D0; }
.cv-media.no-video video { visibility: hidden; }
.cv-media.no-video .cv-avatar { display: grid; }
.cv-info { padding: 6px 10px 2px; }
.cv-name { font-weight: 700; }
.cv-status { font-size: .8rem; opacity: .85; }
.cv-actions { padding: 4px 10px 10px; display: flex; gap: 8px; }
.cv-actions:empty { display: none; }
.cv-invite {
  position: absolute; left: 50%; top: 28%; transform: translateX(-50%); width: min(380px, calc(100vw - 24px));
  padding: 18px; background: #16262f; border: 2px solid var(--amber); border-radius: 14px; color: #fff; text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,.6);
}
.cv-invite[hidden] { display: none; }
.cv-invite-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.cv-invite-text { font-size: .88rem; opacity: .85; margin-bottom: 14px; }
.cv-invite-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cv-invite-actions .wb-btn { min-height: 48px; padding: 8px 18px; font-size: 1rem; }
.cv-invite-actions .sl-primary { background: var(--amber); border-color: var(--amber); color: #1a1405; font-weight: 700; }
.cv-toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: #16262f; color: #fff; padding: 8px 14px; border-radius: 999px; border: 1px solid #2A3F6B; font-size: .88rem; }

/* =====================================================================
   Teaching tools: drawing on slides, whiteboard extras, poll, breakout
   rooms, timer. (ink.js, whiteboard.js, slideink.js, teachtools.js,
   polls.js, breakout.js, timer.js)
   ===================================================================== */

/* ---- whiteboard additions ---- */
.wb-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-select {
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 6px 8px; font: inherit; min-height: 36px; max-width: 190px;
}
.wb-select option { color: #111; }
.wb-page-label { color: #fff; font-size: .85rem; font-variant-numeric: tabular-nums; padding: 0 4px; }
.wb-btn:disabled { opacity: .35; cursor: default; }
.wb-hint {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 5;
  background: #16262f; color: #fff; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--amber);
  font-size: .9rem; pointer-events: none;
}
.wb-hint[hidden] { display: none; }
#wb-canvas.tool-text { cursor: text; }
#wb-canvas.tool-ruler { cursor: grab; }
#wb-canvas.tool-place { cursor: copy; }
/* A student the teacher let write: their own tool bar replaces the "watching" bar */
.wb-writer-bar { display: none; }
.wb-overlay.is-writer .wb-writer-bar { display: flex; }
.wb-overlay.is-writer .wb-toolbar-view { display: none; }
#wb-canvas:not(.wb-readonly) { touch-action: none; }

/* ---- drawing on slides ---- */
.sl-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;            /* same letterboxing as the slide picture, so strokes stay on the words */
  pointer-events: none;
}
.sl-overlay.rotated .sl-stage canvas {
  inset: auto; top: 50%; left: 50%;
  width: 100vh; width: 100dvh; height: 100vw; height: 100dvw;
  transform: translate(-50%, -50%) rotate(90deg);
}
#sl-ink.drawing { pointer-events: auto; touch-action: none; cursor: crosshair; }
#sl-ink[data-tool="laser"] { cursor: none; }
.sl-ink-bar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6;
  max-width: calc(100% - 20px); display: flex; justify-content: center;
}
.sl-ink-tools {
  display: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px; background: rgba(14,26,34,.92); border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
}
.sl-ink-bar.is-open .sl-ink-tools { display: flex; }
.sl-ink-bar.is-open #sl-ink-open { display: none; }
.sl-ink-bar .wb-btn { min-height: 34px; padding: 4px 10px; background: rgba(14,26,34,.85); }
.sl-ink-bar .wb-btn.is-on { background: rgba(201,162,39,.35); }
.sl-ink-tools .wb-btn { background: rgba(255,255,255,.08); }
.sl-ink-tools .wb-btn.is-on { background: rgba(201,162,39,.25); }

/* ---- the Tools menu and the dock of teacher cards ---- */
#classview-layer > .tt-menu {
  position: fixed; z-index: 3; width: 290px; padding: 8px; background: #16262f; color: #fff;
  border: 1px solid rgba(255,255,255,.2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.tt-menu[hidden] { display: none; }
.tt-menu-title { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .65; padding: 4px 8px 6px; }
.tt-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.tt-menu-item:hover, .tt-menu-item:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.tt-menu-icon { width: 26px; height: 26px; flex: 0 0 26px; color: #F0D676; }
.tt-menu-icon svg { width: 100%; height: 100%; }
.tt-menu-text { display: flex; flex-direction: column; gap: 2px; }
.tt-menu-text small { opacity: .7; font-size: .78rem; line-height: 1.25; }

#classview-layer > .tt-dock {
  position: absolute; right: 12px; top: 64px; width: min(360px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px);
  overflow-y: auto; pointer-events: none;
}
.tt-dock > * { pointer-events: auto; }
.tt-card { background: #16262f; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tt-card[hidden] { display: none; }
.tt-card-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px; }
.tt-card-head h3 { margin: 0; font-size: 1rem; }
.tt-card-body { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.tt-x { background: transparent; color: inherit; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px; opacity: .8; }
.tt-x:hover { opacity: 1; background: rgba(255,255,255,.1); }
.tt-setup, .tt-run { display: flex; flex-direction: column; gap: 10px; }
.tt-setup[hidden], .tt-run[hidden] { display: none; }
.tt-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; font: inherit; min-height: 38px;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22);
}
.tt-input::placeholder { color: rgba(255,255,255,.55); }
.tt-minutes { width: 80px; }
.tt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tt-row[hidden] { display: none; }
.tt-label { font-size: .8rem; opacity: .75; min-width: 78px; }
.tt-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tt-seg-btn {
  min-width: 38px; min-height: 36px; padding: 4px 10px; border-radius: 8px; font: inherit; cursor: pointer;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22);
}
.tt-seg-btn.is-on { background: rgba(201,162,39,.28); border-color: var(--amber); color: #F0D676; }
.tt-hint { margin: 0; font-size: .78rem; opacity: .7; line-height: 1.35; }
.tt-error { margin: 0; color: #ffb4aa; font-size: .85rem; }
.tt-error[hidden] { display: none; }
.tt-go { align-self: stretch; justify-content: center; }
.tt-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.tt-card .btn-ghost:hover { color: #F0D676; border-color: var(--amber); }
.tt-card .btn-ghost.is-on { background: rgba(201,162,39,.25); border-color: var(--amber); color: #F0D676; }
.tt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-check { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.tt-status { font-size: .82rem; opacity: .8; font-variant-numeric: tabular-nums; }
.tt-status.is-open { color: #8fe3b0; opacity: 1; }
.tt-question { font-weight: 600; line-height: 1.3; }
.tt-question[hidden] { display: none; }
.tt-bars { display: flex; flex-direction: column; gap: 6px; }
.tt-bar { display: grid; grid-template-columns: 42px 1fr 78px; align-items: center; gap: 8px; }
.tt-bar-letter { font-weight: 700; }
.tt-bar-track { height: 22px; background: rgba(255,255,255,.1); border-radius: 6px; overflow: hidden; }
.tt-bar-fill { display: block; height: 100%; background: #5aa9e6; border-radius: 6px; transition: width .25s ease; }
.tt-bar.is-correct .tt-bar-fill { background: #3fbf7f; }
.tt-bar.is-correct .tt-bar-letter { color: #8fe3b0; }
.tt-bar-count { font-variant-numeric: tabular-nums; font-size: .82rem; text-align: right; }
.tt-score { font-size: .85rem; color: #8fe3b0; }
.tt-waiting { font-size: .8rem; opacity: .75; line-height: 1.35; }
.tt-waiting:empty { display: none; }

/* breakout (teacher) */
.tt-breakout-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tt-clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.tt-listening { font-size: .82rem; opacity: .8; }
.tt-help { display: flex; flex-direction: column; gap: 6px; }
.tt-help[hidden] { display: none; }
.tt-help-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(201,162,39,.2); border: 1px solid var(--amber); font-size: .85rem; }
.tt-help-row span { flex: 1; }
.tt-groups { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; }
.tt-group { border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 8px; }
.tt-group.is-visited { border-color: var(--amber); background: rgba(201,162,39,.12); }
.tt-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tt-member { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: .88rem; }
.tt-member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-select { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; font: inherit; font-size: .78rem; padding: 2px 4px; max-width: 110px; }
.tt-select option { color: #111; }
.tt-card .btn-danger { color: #fff; }

/* poll (student) */
#classview-layer > .tt-poll {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(460px, calc(100vw - 20px));
  background: #16262f; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 16px; padding: 10px 14px 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 2;
}
.tt-poll[hidden] { display: none; }
.tt-poll-head { display: flex; justify-content: space-between; align-items: center; }
.tt-poll-q { margin: 4px 0 8px; font-weight: 600; line-height: 1.3; }
.tt-choices { display: flex; gap: 8px; margin: 8px 0 6px; }
.tt-choice {
  position: relative; flex: 1 1 0; min-height: 72px; border-radius: 14px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.tt-choice:disabled { cursor: default; opacity: .9; }
.tt-choice:not(:disabled):hover { background: rgba(255,255,255,.16); }
.tt-choice-letter { position: relative; z-index: 1; font-size: 1.9rem; font-weight: 800; }
.tt-choice-count { position: relative; z-index: 1; font-size: .8rem; font-variant-numeric: tabular-nums; }
.tt-choice-bar { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(90,169,230,.4); transition: height .25s ease; }
.tt-choice.is-mine { border-color: var(--amber); background: rgba(201,162,39,.28); }
.tt-choice.is-correct { border-color: #3fbf7f; background: rgba(63,191,127,.3); }
.tt-choice.is-wrong { border-color: #e0685c; background: rgba(224,104,92,.28); }
.tt-poll-note { margin: 0; font-size: .85rem; opacity: .85; text-align: center; }

/* breakout (student) */
#classview-layer > .tt-breakout {
  position: absolute; left: 12px; top: 12px; z-index: 2; max-width: min(520px, calc(100vw - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px;
  background: #16262f; color: #fff; border: 1px solid var(--amber); border-radius: 12px; font-size: .88rem;
}
.tt-breakout[hidden], .tt-clock[hidden] { display: none; }
.tt-breakout .wb-btn { min-height: 32px; padding: 3px 10px; }
.mini-tile.is-gated video, .spotlight-tile.is-gated video { visibility: hidden; }
.mini-tile.is-gated, .spotlight-tile.is-gated { position: relative; }
.mini-tile.is-gated::after, .spotlight-tile.is-gated::after {
  content: attr(data-gate-label); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6px; font-size: .72rem; color: rgba(255,255,255,.75); background: rgba(14,26,34,.85);
}

/* timer and the stay-focused bar */
#classview-layer > .tt-strip { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: rgba(0,0,0,.35); z-index: 3; pointer-events: none; }
.tt-strip.is-focus { height: 10px; }
.tt-strip-fill { height: 100%; width: 100%; background: #3fbf7f; transition: width .3s linear, background-color .4s; }
.tt-strip[data-level="amber"] .tt-strip-fill { background: #f0b429; }
.tt-strip[data-level="red"] .tt-strip-fill, .tt-strip[data-level="done"] .tt-strip-fill { background: #e0685c; }
#classview-layer > .tt-timer {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; max-width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 999px;
  background: rgba(14,26,34,.92); color: #fff; border: 2px solid #3fbf7f; font-variant-numeric: tabular-nums;
}
.tt-timer[data-level="amber"] { border-color: #f0b429; }
.tt-timer[data-level="red"], .tt-timer[data-level="done"] { border-color: #e0685c; }
.tt-timer[data-level="red"] .tt-timer-time { color: #ffb4aa; }
.tt-timer[data-level="done"] { animation: tt-pulse 1s ease-in-out 8; }
.tt-timer.is-paused .tt-timer-time { opacity: .6; }
.tt-timer-time { font-size: 1.3rem; font-weight: 700; }
.tt-timer-label { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.tt-timer-label[hidden] { display: none; }
.tt-timer.is-focus { padding: 10px 22px; gap: 16px; }
.tt-timer.is-focus .tt-timer-time { font-size: 2rem; }
.tt-timer.is-focus .tt-timer-label { font-size: 1.15rem; max-width: 34ch; }
.tt-timer-controls { display: inline-flex; gap: 4px; }
.tt-timer-btn { min-width: 32px; min-height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; font: inherit; cursor: pointer; }
.tt-timer-btn:hover { border-color: var(--amber); }
.tt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes tt-pulse { 50% { transform: translateX(-50%) scale(1.07); background: rgba(224,104,92,.55); } }
@media (prefers-reduced-motion: reduce) { .tt-timer[data-level="done"] { animation: none; } .tt-strip-fill, .tt-bar-fill, .tt-choice-bar { transition: none; } }
/* make room for the bar on screens that have their own top row */
body.tt-timer-on .wb-toolbar { padding-top: 44px; }
body.tt-timer-on .sl-overlay.is-host .sl-topbar { padding-top: 44px; }

@media (max-width: 640px) {
  #classview-layer > .tt-dock { top: auto; bottom: 80px; right: 8px; left: 8px; width: auto; max-height: 60vh; }
  #classview-layer > .tt-poll { bottom: 70px; }
  .tt-timer-label { max-width: 14ch; }
}
/* "hidden" must win over the display set on these (an invisible bar must not block clicks) */
#classview-layer > .tt-timer[hidden], #classview-layer > .tt-strip[hidden], #classview-layer > .tt-poll[hidden],
#classview-layer > .tt-breakout[hidden], #classview-layer > .tt-menu[hidden] { display: none; }
.tt-card-head h3 { color: #fff; font-family: inherit; font-weight: 700; }
#classview-layer > .tt-dock { max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); }
#classview-layer > .tt-toasts {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column;
  align-items: center; gap: 6px; pointer-events: none; width: min(520px, calc(100vw - 24px));
}
.tt-toast { background: #16262f; color: #fff; padding: 8px 14px; border-radius: 999px; border: 1px solid #2A3F6B; font-size: .88rem; text-align: center; }
.tt-poll-note, .tt-poll-q, .tt-poll-head { color: #fff; }


/* ---- inline line icons (replace emoji and symbol characters) ---- */
.ico { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.22em; flex: 0 0 auto; }
.ico svg { width: 100%; height: 100%; display: block; }
.wb-btn .ico, .tt-help-row .ico { margin-right: 2px; }
.wb-btn > .ico:only-child, .sl-edge > .ico { margin-right: 0; }
.sl-edge > .ico { width: 1.1em; height: 1.1em; vertical-align: middle; }
.wb-btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.sl-icon > .ico, .sl-big > .ico { width: 1.2em; height: 1.2em; }
.reaction-btn .icon { width: 18px; height: 18px; }
.reaction-icon { display: inline-flex; width: 1.3rem; height: 1.3rem; color: #F0D676; }
.reaction-icon svg { width: 100%; height: 100%; }
.reaction-emoji.has-text { display: inline-flex; align-items: center; gap: 6px; }
.hand-badge, .data-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 4px; }
.hand-badge .ico, .data-badge .ico, .sl-face-name .ico, .participant-name .ico { width: 1em; height: 1em; vertical-align: -0.15em; margin-left: 4px; color: #F0D676; }
.presenting-badge { display: inline-flex; align-items: center; gap: 6px; }
.presenting-badge .ico { width: 1em; height: 1em; }
.cv-status .ico { width: 1em; height: 1em; margin-right: 4px; vertical-align: -0.15em; }
.observer-notice .ico { width: 1em; height: 1em; margin-right: 4px; }
.tt-timer-btn { display: inline-flex; align-items: center; justify-content: center; }
.tt-timer-btn .ico { width: 14px; height: 14px; }
.tt-bar-letter .ico { width: 1em; height: 1em; margin-left: 4px; }
.rec-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: 1px; }
.tracker-dot .ico-svg { display: block; }
.watch-start-icon svg { display: block; }


/* the students' paused screen: only the break message, covering everything */
#classview-layer > .tt-break-full {
  position: absolute; inset: 0; z-index: 6; box-sizing: border-box; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: radial-gradient(ellipse at 50% 35%, #1d3442 0%, #0E1A22 70%); color: #fff;
}
#classview-layer > .tt-break-full[hidden] { display: none; }
.tt-break-full-icon { width: 76px; height: 76px; color: #F0D676; }
.tt-break-full.is-done .tt-break-full-icon { color: #8fe3b0; }
.tt-break-full-icon svg { width: 100%; height: 100%; }
.tt-break-full-title { margin: 6px 0 0; font-size: clamp(1.8rem, 5vw, 3rem); font-family: inherit; font-weight: 700; color: #fff; }
.tt-break-full-note { margin: 0; max-width: 34ch; font-size: clamp(1rem, 2.4vw, 1.3rem); line-height: 1.4; color: #E3EBEF; overflow-wrap: anywhere; }
.tt-break-full-time { font-size: clamp(3rem, 12vw, 6.5rem); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; color: #F0D676; }
.tt-break-full-time:empty, .tt-break-full-back:empty, .tt-break-full-hint:empty { display: none; }
.tt-break-full-back { margin: 0; font-size: 1.1rem; color: #C9D6DC; }
.tt-break-full-hint { margin: 14px 0 0; max-width: 42ch; font-size: .95rem; color: #9FB2BC; }
.tt-break-full-btn { margin-top: 14px; min-height: 48px; padding: 8px 26px; }
.tt-break-full-btn[hidden] { display: none; }
.tt-break-full.is-done { background: radial-gradient(ellipse at 50% 35%, #1d4a36 0%, #0E1A22 70%); }

/* taking a break */
#classview-layer > .tt-break {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 3;
  width: min(540px, calc(100vw - 24px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px;
  background: rgba(14,26,34,.95); color: #fff; border: 2px solid #f0b429;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); font-variant-numeric: tabular-nums;
}
#classview-layer > .tt-break[hidden] { display: none; }
.tt-break.is-done { border-color: #3fbf7f; animation: tt-break-pop .5s ease-out 1; }
.tt-break-icon { width: 34px; height: 34px; flex: 0 0 34px; color: #F0D676; }
.tt-break.is-done .tt-break-icon { color: #8fe3b0; }
.tt-break-icon svg { width: 100%; height: 100%; }
.tt-break-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tt-break-title { font-size: 1.05rem; }
.tt-break-note { font-size: .88rem; opacity: .9; line-height: 1.3; overflow-wrap: anywhere; }
.tt-break-back { font-size: .8rem; opacity: .7; }
.tt-break-back:empty { display: none; }
.tt-break-time { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.tt-break-side { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tt-break-btn { white-space: nowrap; padding: 2px 10px; }
body.tt-timer-on #classview-layer > .tt-break { top: 112px; }
.tt-card .tt-break-hint { color: rgba(255,255,255,.75); opacity: 1; }
.tt-card .tt-break-go { background: #f0b429; color: #1a1a1a; border: 0; font-weight: 700; }
.tt-card .tt-break-go:hover, .tt-card .tt-break-go:focus-visible { background: #F0D676; }
@keyframes tt-break-pop { 0% { transform: translateX(-50%) scale(.94); } 100% { transform: translateX(-50%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .tt-break.is-done { animation: none; } }
@media (max-width: 640px) {
  .tt-break { flex-wrap: wrap; }
  .tt-break-time { font-size: 1.5rem; }
}


/* ---- Academy badge watermark: signed-in pages only ----------------------
   A large, faint crest fixed behind the content. It never takes clicks, is
   hidden in the live classroom (video matters more there) and when printing. */
body.has-watermark::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("../img/logo-crest-large.png") center 56% / min(70vmin, 640px) auto no-repeat;
  opacity: 0.07;
}
body.has-watermark .page,
body.has-watermark .site-footer { position: relative; z-index: 1; }
:root[data-theme="dark"] body.has-watermark::before { opacity: 0.09; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.has-watermark::before { opacity: 0.09; }
}
body.has-watermark:has(.room-body)::before { display: none; }
@media print { body.has-watermark::before { display: none; } }


/* ---- Landing: learner photos under "Who we are" ------------------------- */
.learner-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 34px; }
.learner-photos figure { position: relative; margin: 0 14px 14px 0; }
.learner-photos figure::before { content: ""; position: absolute; inset: 12px -12px -12px 12px; border: 3px solid var(--amber); border-radius: var(--radius-lg); z-index: 0; }
.learner-photos img { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.learner-photos figure:first-child img { object-position: 30% 40%; }
.learner-photos figure:last-child img { object-position: 30% 35%; }
@media (max-width: 640px) { .learner-photos { grid-template-columns: 1fr; gap: 34px; } }


/* ---- Landing: photo at the top of each programme card ------------------- */
.program-card .program-photo { display: block; width: calc(100% + 48px); height: auto; max-width: none; aspect-ratio: 16 / 9; object-fit: cover; margin: -24px -24px 10px; }
.program-card:nth-child(1) .program-photo { object-position: 40% 25%; }
.program-card:nth-child(2) .program-photo { object-position: 30% 35%; }
.program-card:nth-child(3) .program-photo { object-position: 30% 35%; }
.learner-photos figure:last-child img { object-position: 35% 40%; }


/* ---- Presenter view: fix for narrow screens, edge arrows, "Hide slide" ---- */
/* The 900px rule above also won on phones and small tablets, leaving a dead 240px column
   that squeezed the slide and buttons. Narrow screens get a single column again. */
@media (max-width: 820px) {
  .sl-overlay.is-host.show { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "stage" "ctrl" "strip"; }
  .sl-side { display: none; }
  .sl-overlay.is-host .sl-topbar { padding-top: max(8px, env(safe-area-inset-top)); }
  .sl-top-actions { flex: 1 1 100%; justify-content: flex-start; }
  .sl-top-actions .wb-btn { min-height: 40px; }
}

/* big arrows on the slide itself: a navigation button is always in reach */
.sl-edge {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 72px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(14,26,34,.55); color: #fff; font-size: 2.2rem; line-height: 1;
  opacity: .55; transition: opacity .15s ease, background .15s ease;
}
.sl-edge:hover, .sl-edge:focus-visible { opacity: 1; background: rgba(14,26,34,.85); }
.sl-edge-prev { left: 6px; } .sl-edge-next { right: 6px; }
@media (pointer: coarse) { .sl-edge { opacity: .8; } }

/* Hide slide: only the teacher's own overlay goes away */
.sl-overlay.peek, .sl-overlay.is-host.show.peek { display: none; }
.sl-peek-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 140; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  max-width: calc(100vw - 20px); padding: 8px 12px; border-radius: 14px; color: #fff;
  background: rgba(14,26,34,.94); border: 2px solid var(--amber); box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.sl-peek-bar[hidden] { display: none; }
.sl-peek-label { font-size: .85rem; opacity: .9; }
.sl-peek-hands { font-size: .85rem; padding: 2px 10px; border-radius: 999px; background: rgba(201,162,39,.22); color: #F0D676; border: 1px solid var(--amber); }
.sl-peek-hands[hidden] { display: none; }
.sl-peek-bar .wb-btn { min-height: 42px; }
.sl-peek-bar .sl-primary { background: var(--amber); border-color: var(--amber); color: #1a1405; font-weight: 600; }


/* ==== Teacher's room: the lesson fills the whole browser ===================
   The site menu is tucked away (the Menu button slides it down), and the room's
   own header and controls are slimmer, so the video, slides and tools get the
   height. Students' rooms are unchanged. */
body:has(.room-host) { overflow: hidden; }
body:has(.room-host) .topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  transform: translateY(-110%); transition: transform .22s ease;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
body.site-menu-open:has(.room-host) .topbar { transform: none; }
.site-menu-backdrop { position: fixed; inset: 0; z-index: 149; background: rgba(0,0,0,.45); }
.site-menu-backdrop[hidden], .site-menu-note[hidden] { display: none; }
.site-menu-note {
  position: fixed; left: 50%; bottom: 132px; transform: translateX(-50%); z-index: 151;
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; max-width: calc(100vw - 24px);
  background: #0E1A22; color: #fff; border: 2px solid var(--amber); border-radius: 12px; font-size: .86rem;
}
.room-host .room-header { padding: 8px 16px; }
.room-host .stage-area { padding: 10px 16px; }
body:has(.room-host) .controls-bar { padding: 8px 12px; gap: 6px; }
body:has(.room-host) .ctrl-btn { height: 46px; min-width: 54px; padding: 4px 8px; }
.ctrl-btn .room-glyph { display: grid; place-items: center; font-size: 1.1rem; line-height: 1; }
.ctrl-btn[hidden] { display: none; }

/* =========================================================================
   Photo backgrounds — pictures sitting behind the words.
   Each section sets --band-img (and optionally --band-pos) inline; a navy
   wash keeps the text readable on any photo.
   ========================================================================= */
.hero.has-photo {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,162,39,0.18) 0%, rgba(201,162,39,0) 55%),
    linear-gradient(180deg, rgba(10,20,38,0.80) 0%, rgba(10,20,38,0.72) 50%, rgba(7,15,31,0.92) 100%),
    var(--band-img) center 40% / cover no-repeat;
}
.photo-band {
  background:
    linear-gradient(180deg, rgba(10,20,38,0.84), rgba(10,20,38,0.76)),
    var(--band-img) var(--band-pos, center) / cover no-repeat;
  border-color: transparent;
}
.photo-band .eyebrow-dark { color: var(--amber); }
.photo-band h2 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,0.35); }
.photo-band p { color: #D9E1F0; }
.photo-band .pathway strong { color: #fff; }
.photo-band .pathway span:not(.pathway-dot) { color: #D9E1F0; }
.photo-band .pathway-dot { box-shadow: 0 0 0 4px rgba(201,162,39,0.35); }
.photo-band .step h3 { color: #fff; }
.photo-band .step p { color: #D9E1F0; }
.cta-band.photo-band {
  background:
    linear-gradient(135deg, rgba(8,56,62,0.82), rgba(10,20,38,0.84)),
    var(--band-img) var(--band-pos, center) / cover no-repeat;
}
@media (max-width: 640px) {
  .hero.has-photo, .photo-band { background-attachment: scroll; }
}

/* =========================================================================
   Watching a recording (the student link) + recording list extras
   ========================================================================= */
.page.watch-page { max-width: none; padding: 0; }
.watch-stage {
  min-height: calc(100vh - 80px);
  background: radial-gradient(ellipse at 50% 0%, #14284B 0%, var(--stage) 60%, #070F1F 100%);
  padding: 40px 20px 64px;
}
.watch-inner { max-width: 1000px; margin: 0 auto; }
.watch-stage h1 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 0 8px; }
.watch-meta { color: #BCC8E0; margin: 0 0 22px; font-size: 0.95rem; }
.watch-player { position: relative; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 60px rgba(0,0,0,0.5); aspect-ratio: 16 / 9; }
.watch-player video { width: 100%; height: 100%; display: block; background: #000; }
.watch-start {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(10,20,38,0.62); color: #fff; font: 700 1.15rem var(--font-body, inherit);
}
.watch-start[hidden] { display: none; }
.watch-start-icon {
  width: 84px; height: 84px; border-radius: 50%; background: var(--amber); color: #1B1403;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; padding-left: 6px;
  box-shadow: 0 0 0 10px rgba(201,162,39,0.25);
}
.watch-note { color: #9AA8C4; font-size: 0.88rem; margin-top: 16px; }
@media (max-width: 640px) { .watch-stage { padding: 20px 0 40px; } .watch-inner { padding: 0 14px; } .watch-player { border-radius: 10px; } }

.rec-note { color: var(--ink-soft); font-size: 0.8rem; max-width: 560px; }
.recording-row .appt-actions { flex-wrap: wrap; justify-content: flex-end; }
.rec-more { position: relative; }
.rec-more > summary { list-style: none; cursor: pointer; }
.rec-more > summary::-webkit-details-marker { display: none; }
.rec-more-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md, 10px);
  padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-card);
}
.rec-more-panel .btn { width: 100%; justify-content: flex-start; }

.recording-notice.rec-behind { background: #7A1F1F; border-color: #E06A6A; color: #fff; }
.recording-notice .rec-warn { font-weight: 700; }


/* =========================================================
   YouTube video in a lesson (video.js)
   Covers the screen for everyone; the teacher has the controls.
   ========================================================= */
.vd-overlay {
  position: fixed; top: 0; left: 0; right: 0; z-index: 125; display: none; flex-direction: column; color: #fff;
  width: 100%; height: 100dvh; background: #000; overflow: hidden;
}
.vd-overlay.show { display: flex; }
.vd-overlay.peeked { display: none; }
.vd-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; background: rgba(0, 0, 0, .75);
}
.vd-top strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 200px; }
.vd-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vd-stage { position: relative; flex: 1 1 auto; min-height: 0; background: #000; }
.vd-stage iframe, .vd-stage #vd-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Blocks taps and clicks on the video, so only the teacher's own buttons drive it. */
.vd-shield { position: absolute; inset: 0; z-index: 2; background: transparent; }
.vd-tap { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.1rem; padding: 14px 22px; }
.vd-tap[hidden], .vd-peek-btn[hidden] { display: none; }
.vd-status {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: min(80%, 420px); margin: 0; padding: 12px 16px; text-align: center;
  background: rgba(0, 0, 0, .75); border-radius: 10px; font-size: .95rem; line-height: 1.4;
}
.vd-status[hidden] { display: none; }
.vd-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  background: rgba(0, 0, 0, .85);
}
.vd-bar input[type=range] { flex: 1 1 160px; min-width: 120px; }
.vd-time { font-variant-numeric: tabular-nums; font-size: .85rem; opacity: .85; }
.vd-bar select { background: #14232c; color: #fff; border: 1px solid #2d4452; border-radius: 8px; padding: 6px 8px; }
.vd-peek-btn { position: fixed; z-index: 137; right: 14px; bottom: 90px; }
.vd-row { display: flex; gap: 8px; margin-bottom: 10px; }
.vd-row input { flex: 1 1 auto; min-width: 0; }
.vd-results { display: flex; flex-direction: column; gap: 8px; }
.vd-result {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 6px;
  background: transparent; border: 1px solid var(--border, #2d4452); border-radius: 10px; color: inherit; cursor: pointer;
}
.vd-result:hover, .vd-result:focus-visible { border-color: var(--amber, #f2b705); }
.vd-result img { width: 120px; height: 68px; object-fit: cover; border-radius: 6px; flex: none; background: #14232c; }
.vd-result span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vd-result strong { font-size: .88rem; line-height: 1.25; }
.vd-result small { opacity: .7; }

.video-panel { z-index: 140; }

/* Admin: deleting recordings to free space */
.rec-bulk { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.rec-pick { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; margin-bottom: 4px; cursor: pointer; }

/* ---- Core services (first section after the landing hero) ---- */
.core-services .section-inner { max-width: 1040px; }
.core-services h2 { max-width: 760px; margin-bottom: 18px; }
.core-lead { max-width: 760px; font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 22px; }
.core-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 34px; }
.core-jump a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-raised); color: var(--ink); font-size: .86rem; font-weight: 600; text-decoration: none; }
.core-jump a:hover { border-color: var(--amber); color: var(--teal); }
.core-service { display: grid; grid-template-columns: 72px 1fr; gap: 22px; background: var(--paper-raised); border: 1px solid var(--line); border-left: 5px solid var(--amber); border-radius: var(--radius-lg); padding: 28px 28px 30px; margin: 0 0 22px; box-shadow: var(--shadow-card); scroll-margin-top: 96px; }
.core-num { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--amber); letter-spacing: -.02em; }
.core-body h3 { font-size: 1.4rem; margin: 0 0 4px; }
.core-summary { font-weight: 600; color: var(--teal); margin: 0 0 12px; }
.core-body > p { margin: 0 0 18px; max-width: 760px; }
.core-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin: 0 0 22px; }
.core-cols h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.core-cols p { margin: 0; font-size: .93rem; }
.core-cols ul { margin: 0; padding-left: 18px; font-size: .93rem; }
.core-cols li { margin-bottom: 5px; }
.core-footer-note { margin: 26px 0 0; font-size: 1rem; }
@media (max-width: 640px) {
  .core-service { grid-template-columns: 1fr; gap: 8px; padding: 22px 18px 24px; }
  .core-num { font-size: 1.8rem; }
}
