:root {
  --brand: #e21a1a;
  --brand-rgb: 226, 26, 26;
  --brand-dark: #bc1515;
  --brand-soft: #fde8e8;
  --ink: #17263a;
  --muted: #68778a;
  --line: #e5e9ef;
  --line-strong: #d7dde6;
  --surface: #fff;
  --canvas: #f5f7fa;
  --success: #168a5b;
  --success-soft: #e9f8f1;
  --warning: #a66600;
  --warning-soft: #fff4dc;
  --danger: #d4222a;
  --shadow: 0 14px 42px rgba(23, 38, 58, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; color-scheme: light; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.webinar-app { min-height: 100vh; }
.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  min-height: 80px;
  padding: 0 30px;
  gap: 24px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(23, 38, 58, .035);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 94px; height: 40px; object-fit: contain; object-position: left center; }
.brand > span { display: none; min-width: 0; }
.brand b, .brand small { display: block; }
.brand b { font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  gap: 4px;
  background: #f2f4f7;
  border: 1px solid #eceff3;
  border-radius: 14px;
}
.main-nav button {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  gap: 8px;
  color: #647386;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 720;
  transition: .18s ease;
}
.main-nav button:hover { color: var(--ink); background: rgba(255,255,255,.66); }
.main-nav button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(23,38,58,.08); }
.main-nav .icon { width: 18px; height: 18px; }
.nav-live-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--brand);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12);
}

.header-side { display: flex; align-items: center; justify-self: end; gap: 12px; }
.server-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  gap: 8px;
  color: var(--muted);
  background: #f5f7f9;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.server-pill i { width: 7px; height: 7px; background: #98a3af; border-radius: 50%; }
.server-pill.online { color: var(--success); background: var(--success-soft); border-color: #cfede0; }
.server-pill.online i { background: var(--success); box-shadow: 0 0 0 4px rgba(22,138,91,.1); }
.server-pill.error { color: var(--danger); background: #fff0f0; border-color: #f5d2d4; }
.server-pill.error i { background: var(--danger); }
.teacher-chip { display: flex; align-items: center; gap: 9px; }
.teacher-chip > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--brand-contrast, #fff);
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  border-radius: 11px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 13px rgba(var(--brand-rgb), .18);
}
.teacher-chip b, .teacher-chip small { display: block; white-space: nowrap; }
.teacher-chip b { max-width: 130px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.teacher-chip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: .18s ease;
}
.icon-button:hover { color: var(--brand); border-color: rgba(var(--brand-rgb),.3); background: var(--brand-soft); }
.icon-button .icon { width: 18px; height: 18px; }
.device-settings-button { width: 44px; height: 44px; flex: 0 0 auto; }

.app-content { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 60px; }
.app-view { display: none; }
.app-view.active { display: block; animation: view-in .22s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.page-heading, .live-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.page-heading h1, .live-heading h1 { margin: 0; font-size: clamp(27px, 3vw, 40px); line-height: 1.08; letter-spacing: -.035em; }
.page-heading > div > p:last-child, .live-heading > div > p:last-child {
  max-width: 720px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 17px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:not(:disabled):hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: var(--brand-contrast, #fff); background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 8px 19px rgba(var(--brand-rgb), .2); }
.button-primary:not(:disabled):hover { box-shadow: 0 11px 25px rgba(var(--brand-rgb), .27); }
.button-secondary { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.button-secondary:not(:disabled):hover { border-color: #bfc8d4; box-shadow: 0 7px 18px rgba(23,38,58,.08); }
.button-light { color: var(--brand); background: #fff; border-color: rgba(255,255,255,.7); }
.button-danger { color: #fff; background: var(--danger); box-shadow: 0 8px 20px rgba(212,34,42,.18); }
.button-large { min-height: 51px; padding-inline: 23px; border-radius: 13px; font-size: 14px; }

.active-webinar-banner {
  display: flex;
  align-items: center;
  min-height: 80px;
  margin-bottom: 20px;
  padding: 16px 18px;
  gap: 13px;
  color: var(--brand-contrast, #fff);
  background: linear-gradient(125deg, var(--brand-dark), var(--brand) 58%, var(--brand));
  border-radius: 17px;
  box-shadow: 0 13px 30px rgba(var(--brand-rgb), .2);
}
.live-orb { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; background: rgba(255,255,255,.14); border-radius: 50%; }
.live-orb i { width: 10px; height: 10px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,255,255,.14); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { transform: scale(.78); opacity: .65; } }
.active-webinar-banner div { min-width: 0; margin-right: auto; }
.active-webinar-banner small, .active-webinar-banner strong { display: block; }
.active-webinar-banner small { margin-bottom: 3px; opacity: .78; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.active-webinar-banner strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }

.slot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.slot-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 292px;
  padding: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.slot-card:not(.skeleton):hover { transform: translateY(-3px); border-color: rgba(var(--brand-rgb), .22); box-shadow: 0 19px 50px rgba(23,38,58,.11); }
.slot-card.is-live { border-color: rgba(var(--brand-rgb), .38); box-shadow: 0 17px 45px rgba(var(--brand-rgb), .12); }
.slot-card::after {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 190px;
  height: 190px;
  content: "";
  background: radial-gradient(circle, rgba(var(--brand-rgb),.1), transparent 67%);
  border-radius: 50%;
  pointer-events: none;
}
.slot-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.slot-number {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.slot-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  gap: 6px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 760;
}
.slot-status i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.slot-status.live { color: var(--brand); background: var(--brand-soft); }
.slot-copy { align-self: center; padding: 19px 0 22px; }
.slot-copy small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.slot-copy time { display: block; margin-bottom: 10px; font-size: clamp(34px, 5vw, 52px); line-height: 1; font-weight: 820; letter-spacing: -.05em; }
.slot-copy h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.02em; }
.slot-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.slot-footer { display: flex; align-items: center; padding-top: 17px; gap: 12px; border-top: 1px solid var(--line); }
.slot-audience { display: flex; align-items: center; margin-right: auto; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.slot-audience .icon { width: 16px; height: 16px; }
.slot-footer .button { min-width: 148px; }
.slot-card.skeleton { min-height: 292px; background: linear-gradient(100deg,#fff 30%,#f7f8fa 45%,#fff 60%); background-size: 220% 100%; animation: skeleton 1.3s infinite linear; }
@keyframes skeleton { to { background-position-x: -220%; } }

.simple-flow {
  display: grid;
  grid-template-columns: .75fr 1.7fr;
  align-items: center;
  margin-top: 22px;
  padding: 22px 24px;
  gap: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.simple-flow-heading { display: flex; align-items: center; gap: 12px; }
.simple-flow-heading > span, .card-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 12px;
}
.simple-flow h2, .simple-flow p { margin: 0; }
.simple-flow h2 { font-size: 15px; }
.simple-flow p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.simple-flow ol { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; gap: 12px; list-style: none; }
.simple-flow li { display: flex; align-items: flex-start; min-width: 0; gap: 9px; }
.simple-flow li > b { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 7px; font-size: 10px; }
.simple-flow li strong, .simple-flow li small { display: block; }
.simple-flow li strong { font-size: 11px; }
.simple-flow li small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.live-view { width: min(1500px, 100%); }
.live-heading { align-items: center; }
.live-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  margin-bottom: 9px;
  padding: 0 9px;
  gap: 7px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 780;
}
.live-state-badge i { width: 7px; height: 7px; background: #a4adb8; border-radius: 50%; }
.live-state-badge.online { color: var(--brand); background: var(--brand-soft); border-color: rgba(var(--brand-rgb),.14); }
.live-state-badge.online i { background: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb),.1); animation: live-pulse 1.5s infinite; }
.live-state-badge.waiting { color: var(--warning); background: var(--warning-soft); border-color: #f1dfba; }
.live-state-badge.waiting i { background: #d98b12; }
.live-heading-actions { display: flex; align-items: center; gap: 12px; }
.live-timer,
.recording-timer {
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  padding: 0 13px;
  gap: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 11px;
  font-size: 12px;
}
.live-timer i { width: 7px; height: 7px; background: var(--brand); border-radius: 50%; animation: live-pulse 1.3s infinite; }
.recording-timer {
  color: var(--danger);
  background: #fff0f1;
  border: 1px solid #f5cdd0;
}
.recording-timer i {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: live-pulse 1s infinite;
}
.recording-timer span { font-size: 9px; font-weight: 780; text-transform: uppercase; letter-spacing: .04em; }
.recording-timer b { font-variant-numeric: tabular-nums; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: stretch; gap: 17px; }
.live-stage-column { min-width: 0; min-height: 590px; }
.video-stage {
  position: relative;
  min-width: 0;
  min-height: 590px;
  overflow: hidden;
  background: #10131a;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(8,14,24,.2);
}
.prelive-card {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 35px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 75% 15%, rgba(var(--brand-rgb),.27), transparent 30%),
    radial-gradient(circle at 22% 82%, rgba(70,103,160,.18), transparent 31%),
    #10131a;
}
.prelive-logo { display: grid; width: 142px; height: 72px; place-items: center; padding: 10px; background: #fff; border-radius: 17px; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.prelive-logo img { width: 118px; height: 50px; object-fit: contain; }
.prelive-card h2 { margin: 22px 0 8px; font-size: 27px; letter-spacing: -.03em; }
.prelive-card p { max-width: 480px; margin: 0 0 22px; color: #abb4c3; font-size: 13px; line-height: 1.6; }
.prelive-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; }
.prelive-device-settings {
  min-height: 51px;
  padding-inline: 19px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  border-radius: 13px;
  font-size: 12px;
}
.prelive-device-settings:not(:disabled):hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
.prelive-device-settings:focus-visible { outline: 3px solid rgba(255,255,255,.32); outline-offset: 3px; }
.teacher-video-room, .teacher-video-room.rost-live-room { min-height: 590px; height: 100%; border-radius: 20px; }

.communication-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 590px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.communication-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 7px; gap: 4px; background: #f6f7f9; border-bottom: 1px solid var(--line); }
.communication-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 8px;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 730;
}
.communication-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(23,38,58,.07); }
.communication-tabs .icon { width: 16px; height: 16px; }
.communication-tabs b { display: grid; min-width: 18px; height: 18px; place-items: center; padding: 0 5px; color: var(--muted); background: #eef1f4; border-radius: 99px; font-size: 9px; }
.communication-tabs #chatUnread { color: var(--brand-contrast, #fff); background: var(--brand); }
.communication-pane { display: none; min-height: 0; }
.communication-pane.active { display: block; }
.participant-list { height: 100%; max-height: 539px; padding: 11px; overflow-y: auto; }
.participant-item { display: flex; align-items: center; min-height: 64px; padding: 9px; gap: 10px; border-bottom: 1px solid #eff1f4; }
.participant-item.is-hand-raised { background: #fff9ef; border-radius: 10px; }
.participant-item.is-speaker { background: #f0faf5; border-radius: 10px; }
.participant-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: #fff; background: linear-gradient(145deg,#4e6e9d,#29456d); border-radius: 11px; font-size: 11px; font-weight: 800; }
.participant-item.is-hand-raised .participant-avatar { background: linear-gradient(145deg,#f2a82c,#d87a10); }
.participant-item.is-speaker .participant-avatar { background: linear-gradient(145deg,#28a675,#13734f); }
.participant-copy { min-width: 0; margin-right: auto; }
.participant-copy strong, .participant-copy small { display: block; }
.participant-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.participant-copy small { margin-top: 3px; color: var(--success); font-size: 11px; }
.participant-copy small.hand-status { color: #b56a08; font-weight: 750; }
.participant-copy small.speaker-status { color: var(--success); font-weight: 750; }
.participant-online { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,138,91,.09); }
.speaker-action {
  min-height: 40px;
  max-width: 112px;
  padding: 6px 11px;
  color: var(--brand-contrast, #fff);
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.15;
}
.speaker-action.revoke { color: var(--danger); background: #fff; border: 1px solid rgba(212,34,42,.25); }
.speaker-action:disabled { cursor: wait; opacity: .5; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 260px; padding: 30px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 220px; }
.empty-state > span { display: grid; width: 44px; height: 44px; place-items: center; color: #7d8998; background: #f0f2f5; border-radius: 13px; }
.empty-state strong { margin-top: 12px; color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 210px; margin: 5px 0 0; font-size: 10px; line-height: 1.5; }
.chat-pane.active { display: grid; grid-template-rows: minmax(0,1fr) auto; }
.chat-messages { min-height: 0; max-height: 476px; padding: 13px; overflow-y: auto; }
.chat-message { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: start; margin-bottom: 13px; gap: 8px; }
.chat-avatar { display: grid; width: 32px; height: 32px; place-items: center; color: #fff; background: #476994; border-radius: 9px; font-size: 9px; font-weight: 800; }
.chat-message.own .chat-avatar { background: var(--brand); }
.chat-bubble { min-width: 0; padding: 9px 10px; background: #f2f4f7; border-radius: 4px 11px 11px; }
.chat-message.own .chat-bubble { background: var(--brand-soft); }
.chat-bubble header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.chat-bubble strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-bubble time { flex: 0 0 auto; color: #909aa7; font-size: 8px; }
.chat-bubble p { margin: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.45; }
.chat-form { display: grid; grid-template-columns: minmax(0,1fr) 39px; align-items: end; padding: 10px; gap: 7px; border-top: 1px solid var(--line); }
.chat-form textarea {
  width: 100%;
  min-height: 39px;
  max-height: 90px;
  padding: 10px 11px;
  resize: none;
  color: var(--ink);
  background: #f5f7f9;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  font-size: 10px;
  line-height: 1.4;
}
.chat-form textarea:focus { background: #fff; border-color: rgba(var(--brand-rgb),.35); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.08); }
.chat-form button { display: grid; width: 39px; height: 39px; place-items: center; color: var(--brand-contrast, #fff); background: var(--brand); border: 0; border-radius: 10px; }
.chat-form button:disabled { cursor: not-allowed; opacity: .35; }
.chat-form .icon { width: 17px; height: 17px; }

.questions-pane.active { display: block; height: 100%; min-height: 0; overflow: hidden; }
.quiz-library, .quiz-response-panel { min-height: 100%; padding: 13px; }
.quiz-library { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.quiz-pane-heading {
  display: flex;
  align-items: center;
  margin-bottom: 13px;
  gap: 9px;
}
.quiz-pane-heading > span {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 10px;
}
.quiz-pane-heading > span .icon { width: 18px; height: 18px; }
.quiz-pane-heading strong, .quiz-pane-heading small { display: block; }
.quiz-pane-heading strong { font-size: 12px; }
.quiz-pane-heading small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.quiz-field { display: grid; margin-bottom: 9px; gap: 5px; }
.quiz-field > span { color: var(--muted); font-size: 8px; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.quiz-field select,
.quiz-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 10px;
}
.quiz-field select:focus,
.quiz-search input:focus {
  background: #fff;
  border-color: rgba(var(--brand-rgb), .4);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .08);
}
.quiz-search { display: grid; grid-template-columns: minmax(0, 1fr) 38px; margin-bottom: 8px; gap: 6px; }
.quiz-search button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.quiz-search button:hover { color: var(--brand); border-color: rgba(var(--brand-rgb), .3); }
.quiz-search .icon { width: 15px; height: 15px; }
.quiz-library-status { min-height: 16px; margin: 0 0 7px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.quiz-library-status.error { color: var(--danger); }
.quiz-question-list { display: grid; min-height: 0; max-height: 245px; padding-right: 3px; gap: 6px; overflow-y: auto; flex: 1 1 auto; align-content: start; overscroll-behavior: contain; }
.quiz-load-more {
  width: 100%;
  min-height: 34px;
  margin-top: 7px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgba(var(--brand-rgb), .18);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 780;
}
.quiz-load-more:hover:not(:disabled) { border-color: rgba(var(--brand-rgb), .42); }
.quiz-load-more:disabled { cursor: wait; opacity: .55; }
.quiz-question-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 6px;
  gap: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  transition: border-color .16s ease, background .16s ease;
}
.quiz-question-card:hover { border-color: rgba(var(--brand-rgb), .28); background: #fffafa; }
.quiz-question-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .08); }
.quiz-question-thumb {
  display: grid;
  width: 48px;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  color: #8390a0;
  background: linear-gradient(145deg, #f4f6f8, #e9edf2);
  border: 1px solid #e3e7ec;
  border-radius: 8px;
}
.quiz-question-thumb img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.quiz-question-thumb .icon { width: 17px; height: 17px; }
.quiz-question-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.quiz-question-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }

.quiz-presentation-stage:not([hidden]),
.quiz-preview:not([hidden]),
.quiz-round:not([hidden]) {
  display: contents;
}
.live-layout.quiz-stage-visible .live-stage-column {
  display: grid;
  grid-template-columns: minmax(360px, 1.24fr) minmax(330px, .86fr);
  grid-template-rows: 43px minmax(0, 1fr) auto;
  height: clamp(590px, 45vw, 640px);
  min-height: 590px;
  gap: 12px 14px;
}
.live-layout.quiz-stage-visible .communication-panel { min-height: 590px; }
.quiz-presentation-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 13px 0 15px;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(23,38,58,.06);
}
.quiz-presentation-toolbar > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--ink);
  font-size: 11px;
}
.quiz-presentation-toolbar > span .icon { width: 17px; height: 17px; color: var(--brand); }
.quiz-presentation-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 7px;
}
.quiz-presentation-toolbar button {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 10px;
  gap: 6px;
  color: var(--muted);
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 760;
}
.quiz-presentation-toolbar button:hover:not(:disabled) { color: var(--brand); background: var(--brand-soft); border-color: rgba(var(--brand-rgb), .23); }
.quiz-presentation-toolbar button:disabled { cursor: wait; opacity: .55; }
.quiz-presentation-toolbar button .icon { width: 14px; height: 14px; }
.quiz-presentation-toolbar .quiz-panel-shortcut { display: none; color: var(--brand); background: var(--brand-soft); border-color: rgba(var(--brand-rgb), .2); }
.quiz-stage-visual {
  position: relative;
  grid-column: 1;
  grid-row: 2 / 4;
  align-self: center;
  justify-self: center;
  width: min(100%, 535px);
  max-height: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 12%, rgba(var(--brand-rgb), .08), transparent 30%),
    linear-gradient(145deg, #f7f8fa, #e9edf2);
  border: 1px solid #dde3ea;
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(23,38,58,.11);
}
.quiz-stage-visual img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f4f5f7;
}
.quiz-image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: #929dac;
}
.quiz-image-placeholder .icon { width: 30px; height: 30px; }
.quiz-image-placeholder span { font-size: 10px; font-weight: 720; }
.quiz-stage-visual.has-image .quiz-image-placeholder { display: none; }
.quiz-stage-copy {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(23,38,58,.08);
  overscroll-behavior: contain;
}
.quiz-preview-label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 27px;
  padding: 0 9px;
  gap: 6px;
  color: #9a6509;
  background: #fff7e8;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.quiz-preview-label i { width: 6px; height: 6px; background: #e69a19; border-radius: 50%; }
.quiz-question-meta { margin: 8px 0 4px; color: var(--muted); font-size: 9px; font-weight: 760; }
.quiz-stage-copy > h3 { margin: 0 0 10px; color: var(--ink); font-size: clamp(16px, 1.2vw, 18px); line-height: 1.35; letter-spacing: -.015em; }
.quiz-preview ol, .quiz-live-answers { display: grid; margin: 0; padding: 0; gap: 7px; list-style: none; counter-reset: answer; }
.quiz-preview li, .quiz-live-answers li {
  position: relative;
  min-height: 38px;
  padding: 8px 38px 8px 39px;
  overflow: hidden;
  background: #f7f8fa;
  border: 1px solid #e3e7ec;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
  counter-increment: answer;
}
.quiz-preview li::before, .quiz-live-answers li::before {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  content: counter(answer, upper-alpha);
  color: var(--muted);
  background: #edf0f4;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 820;
}
.quiz-stage-actions {
  position: sticky;
  z-index: 3;
  bottom: -14px;
  display: grid;
  margin: auto -14px -14px;
  padding: 10px 14px 14px;
  gap: 7px;
  background: linear-gradient(to bottom, rgba(255,255,255,.84), #fff 13px);
}
.quiz-stage-actions .button { width: 100%; min-height: 45px; }
.quiz-stage-actions small { display: none; }
.quiz-round-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; gap: 8px; }
.quiz-round-heading .quiz-question-meta { margin: 0; text-align: right; }
.quiz-phase { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; gap: 6px; color: var(--brand); background: var(--brand-soft); border-radius: 99px; font-size: 8px; }
.quiz-phase i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; animation: live-pulse 1.4s infinite; }
.quiz-phase.revealed { color: var(--success); background: var(--success-soft); }
.quiz-phase.revealed i { animation: none; }
.quiz-phase.closed { color: var(--muted); background: #eef1f4; }
.quiz-phase.closed i { animation: none; }
.quiz-live-answers li > span { position: relative; z-index: 2; }
.quiz-live-answers li > i {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: var(--answer-share, 0%);
  background: #e8edf4;
  transition: width .25s ease;
}
.quiz-live-answers li > b { position: absolute; z-index: 2; top: 10px; right: 11px; color: var(--muted); font-size: 10px; }
.quiz-live-answers li.is-correct { color: var(--success); border-color: #bde5d2; }
.quiz-live-answers li.is-correct > i { background: #d9f2e6; }
.quiz-live-answers li.is-correct::before { color: #fff; background: var(--success); }
.quiz-response-panel { height: 100%; overflow-y: auto; }
.quiz-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 6px 0 16px; padding: 12px 0; background: #f6f8fa; border-radius: 11px; }
.quiz-metrics article { padding: 3px 5px; text-align: center; border-right: 1px solid var(--line); }
.quiz-metrics article:last-child { border-right: 0; }
.quiz-metrics strong, .quiz-metrics span { display: block; }
.quiz-metrics strong { font-size: 18px; letter-spacing: -.03em; }
.quiz-metrics span { margin-top: 2px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.quiz-students { min-height: 0; margin-bottom: 12px; }
.quiz-students > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; gap: 8px; }
.quiz-students > div strong { font-size: 10px; }
.quiz-students > div span { color: var(--muted); font-size: 7px; }
.quiz-students ul { display: grid; max-height: 390px; margin: 0; padding: 0; gap: 5px; overflow-y: auto; list-style: none; }
.quiz-students li { display: flex; align-items: center; min-height: 34px; padding: 6px 8px; gap: 7px; background: #f7f8fa; border-radius: 8px; font-size: 9px; }
.quiz-students li > i { width: 6px; height: 6px; flex: 0 0 auto; background: #a9b1bc; border-radius: 50%; }
.quiz-students li.answered > i { background: #4682c0; }
.quiz-students li.correct > i { background: var(--success); }
.quiz-students li.wrong > i { background: var(--danger); }
.quiz-students li b { min-width: 0; margin-right: auto; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.quiz-students li span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.quiz-response-note { margin: 0; padding: 10px; color: var(--muted); background: #f7f8fa; border-radius: 9px; font-size: 8px; line-height: 1.45; }
.quiz-round-actions {
  position: sticky;
  z-index: 3;
  bottom: -14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: auto -14px -14px;
  padding: 10px 14px 14px;
  gap: 7px;
  background: linear-gradient(to bottom, rgba(255,255,255,.84), #fff 13px);
}
.quiz-round-actions .button { min-height: 42px; padding: 0 10px; font-size: 9px; }
.quiz-round-actions .quiz-change-button { grid-column: 1 / -1; }

.live-layout.quiz-stage-visible .video-stage {
  grid-column: 2;
  grid-row: 3;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(8,14,24,.16);
}
.live-layout.quiz-stage-visible .teacher-video-room,
.live-layout.quiz-stage-visible .teacher-video-room.rost-live-room {
  width: 100%;
  min-height: 0;
  height: 100%;
  border-radius: inherit;
}
.live-layout.quiz-stage-visible .teacher-video-room.rost-live-room {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
}
.live-layout.quiz-stage-visible .rost-live-room__status {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  left: 8px;
  min-height: 30px;
  padding: 0 10px;
  background: rgba(24,29,39,.76);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  font-size: 9px;
  backdrop-filter: blur(8px);
}
.live-layout.quiz-stage-visible .rost-live-room__stage {
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
  grid-template-rows: minmax(0, 1fr);
}
.live-layout.quiz-stage-visible .rost-live-room__videos {
  height: 100%;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: minmax(0, 1fr);
  gap: 0;
}
.live-layout.quiz-stage-visible .rost-live-room__videos > [data-identity]:not([data-identity="teacher"]),
.live-layout.quiz-stage-visible .rost-live-room__overflow > [data-identity]:not([data-identity="teacher"]) { display: none; }
.live-layout.quiz-stage-visible .rost-live-room__overflow { display: none; }
.live-layout.quiz-stage-visible .rost-live-tile { border-radius: 10px; }
.live-layout.quiz-stage-visible .rost-live-tile__meta { right: 6px; bottom: 6px; left: 6px; }
.live-layout.quiz-stage-visible .rost-live-tile__name,
.live-layout.quiz-stage-visible .rost-live-tile__badge,
.live-layout.quiz-stage-visible .rost-live-tile__mic { padding: 4px 6px; font-size: 9px; }
.live-layout.quiz-stage-visible .prelive-card { padding: 12px; }
.live-layout.quiz-stage-visible .prelive-card .prelive-logo,
.live-layout.quiz-stage-visible .prelive-card p { display: none; }
.live-layout.quiz-stage-visible .prelive-card h2 { margin: 0 0 10px; font-size: 15px; }
.live-layout.quiz-stage-visible .prelive-actions { gap: 6px; }
.live-layout.quiz-stage-visible .prelive-actions .button { min-height: 38px; padding-inline: 11px; font-size: 9px; }
.quiz-quick-control > span { color: var(--brand); background: var(--brand-soft); }
.quiz-quick-control.is-on,
.quiz-quick-control[aria-pressed="true"] { color: var(--brand); background: #fff7f7; }
.quiz-quick-control.is-on > span,
.quiz-quick-control[aria-pressed="true"] > span { color: var(--brand-contrast, #fff); background: var(--brand); }

.control-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 72px;
  margin: 17px auto 0;
  padding: 7px 9px;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 13px 35px rgba(23,38,58,.11);
}
.media-control {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 76px;
  height: 56px;
  padding: 4px 8px;
  gap: 3px;
  color: #667486;
  background: transparent;
  border: 0;
  border-radius: 11px;
}
.media-control:hover:not(:disabled) { background: #f4f6f8; }
.media-control span { display: grid; width: 28px; height: 28px; place-items: center; background: #eef1f4; border-radius: 9px; }
.media-control.is-on { color: var(--ink); }
.media-control.is-on span { color: var(--success); background: var(--success-soft); }
.media-control small { font-size: 9px; font-weight: 690; white-space: nowrap; }
.media-control .icon { width: 17px; height: 17px; }
.recording-control > span { color: var(--danger); background: #fff0f1; }
.recording-control small { white-space: normal; line-height: 1.05; text-align: center; }
.recording-control.is-recording { color: var(--danger); background: #fff5f5; }
.recording-control.is-recording > span {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(212,34,42,.09);
  animation: live-pulse 1s infinite;
}
.device-settings-control { min-width: 68px; }
.device-settings-control:not(:disabled):hover { color: var(--brand); background: var(--brand-soft); }
.device-settings-control > span { color: var(--brand); background: var(--brand-soft); }
.dock-divider { width: 1px; height: 35px; margin: 0 4px; background: var(--line); }
.end-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 3px;
  padding: 0 17px;
  gap: 8px;
  color: #fff;
  background: var(--danger);
  border: 0;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 760;
  box-shadow: 0 7px 17px rgba(212,34,42,.18);
}
.end-button:disabled, .media-control:disabled { cursor: not-allowed; opacity: .4; }
.end-button .icon { width: 17px; height: 17px; }

.tokens-heading { align-items: center; }
.security-note {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  gap: 7px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #d4eee2;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 740;
}
.security-note .icon { width: 16px; height: 16px; }
.student-link-card {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  margin-bottom: 18px;
  padding: 17px 19px;
  gap: 13px;
  background: linear-gradient(120deg,#18273c,#233d60);
  border-radius: 17px;
  box-shadow: 0 15px 35px rgba(23,38,58,.13);
}
.link-icon { display: grid; width: 42px; height: 42px; place-items: center; color: #fff; background: rgba(255,255,255,.1); border-radius: 12px; }
.student-link-card div { min-width: 0; }
.student-link-card small, .student-link-card strong { display: block; }
.student-link-card small { margin-bottom: 4px; color: #9facbd; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.student-link-card strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.token-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); margin-bottom: 18px; gap: 18px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.token-create-card { padding: 20px; }
.card-heading { display: flex; align-items: center; gap: 12px; }
.card-heading > span { color: var(--brand); background: var(--brand-soft); }
.card-heading h2, .card-heading p { margin: 0; }
.card-heading h2 { font-size: 15px; }
.card-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.token-form { display: grid; grid-template-columns: auto 90px 150px; align-items: center; margin-top: 18px; gap: 10px; }
.token-form label { color: var(--muted); font-size: 10px; font-weight: 700; }
.token-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--ink);
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  font-size: 13px;
  font-weight: 760;
}
.token-form input:focus { background: #fff; border-color: rgba(var(--brand-rgb),.4); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.08); }
.token-status { display: flex; align-items: center; margin-top: 14px; gap: 7px; color: var(--muted); font-size: 9px; }
.token-status i { width: 6px; height: 6px; background: #99a3ae; border-radius: 50%; }
.token-status.online { color: var(--success); }
.token-status.online i { background: var(--success); }
.token-status.error { color: var(--danger); }
.token-status.error i { background: var(--danger); }
.token-stats-card { display: grid; grid-template-columns: repeat(3,1fr); align-items: center; padding: 17px; gap: 7px; }
.token-stats-card article { min-width: 0; padding: 10px; text-align: center; border-right: 1px solid var(--line); }
.token-stats-card article:last-child { border-right: 0; }
.token-stats-card strong, .token-stats-card span { display: block; }
.token-stats-card strong { font-size: 25px; letter-spacing: -.04em; }
.token-stats-card span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; text-transform: uppercase; letter-spacing: .04em; }
.generated-card { margin-bottom: 18px; padding: 19px; color: var(--brand-contrast, #fff); background: linear-gradient(120deg,var(--brand-dark),var(--brand)); border-radius: 18px; box-shadow: 0 15px 34px rgba(var(--brand-rgb),.2); }
.generated-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.generated-heading > span { display: grid; width: 40px; height: 40px; place-items: center; background: rgba(255,255,255,.14); border-radius: 11px; }
.generated-heading h2, .generated-heading p { margin: 0; }
.generated-heading h2 { font-size: 14px; }
.generated-heading p { margin-top: 3px; color: rgba(255,255,255,.73); font-size: 9px; }
.generated-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 15px; gap: 8px; }
.generated-code { display: flex; align-items: center; justify-content: space-between; min-width: 0; min-height: 38px; padding: 0 10px; gap: 8px; color: #fff; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; }
.generated-code code { overflow: hidden; font-size: 10px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.generated-code small { opacity: .62; font-size: 8px; }
.token-list-card { overflow: hidden; }
.list-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 16px; border-bottom: 1px solid var(--line); }
.list-heading h2, .list-heading p { margin: 0; }
.list-heading h2 { font-size: 15px; }
.list-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.token-filters { display: flex; padding: 3px; gap: 3px; background: #f2f4f7; border-radius: 9px; }
.token-filters button { min-height: 29px; padding: 0 10px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 9px; font-weight: 710; }
.token-filters button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(23,38,58,.07); }
.token-table-wrap { overflow-x: auto; }
.token-table { width: 100%; border-collapse: collapse; }
.token-table th { height: 37px; padding: 0 16px; color: #909aa7; background: #fafbfc; font-size: 8px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
.token-table td { height: 54px; padding: 8px 16px; border-top: 1px solid #eff1f4; font-size: 10px; }
.token-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 750; }
.token-student { font-weight: 700; }
.token-student small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.token-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px; font-size: 8px; font-weight: 760; }
.token-badge.free { color: var(--warning); background: var(--warning-soft); }
.token-badge.active { color: var(--success); background: var(--success-soft); }
.token-badge.revoked { color: var(--danger); background: #fff0f0; }
.token-action { min-height: 28px; padding: 0 9px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 8px; font-weight: 700; }
.token-action:hover { color: var(--brand); border-color: rgba(var(--brand-rgb),.3); }
.table-empty { height: 110px !important; color: var(--muted); text-align: center; }

/* White-label branding */
.branding-page-heading { align-items: center; }
.brand-publish-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  gap: 8px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #d4eee2;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}
.brand-publish-status > i { width: 7px; height: 7px; flex: 0 0 auto; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,138,91,.09); }
.brand-publish-status[data-state="dirty"] { color: var(--warning); background: var(--warning-soft); border-color: #f0ddb4; }
.brand-publish-status[data-state="saving"] { color: #3157b9; background: #edf2ff; border-color: #d7e1ff; }
.brand-publish-status[data-state="saving"] > i { animation: brand-status-pulse .9s ease infinite; }
.brand-publish-status[data-state="error"] { color: var(--danger); background: #fff0f0; border-color: #f5d2d4; }
@keyframes brand-status-pulse { 50% { opacity: .35; transform: scale(.75); } }

.branding-layout {
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(360px,.82fr);
  align-items: start;
  gap: 22px;
}
.brand-editor-card { padding: 24px; }
.brand-editor-intro {
  display: flex;
  align-items: center;
  padding-bottom: 21px;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}
.brand-editor-intro > span {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 13px;
}
.brand-editor-intro > span .icon { width: 21px; height: 21px; }
.brand-editor-intro h2, .brand-editor-intro p { margin: 0; }
.brand-editor-intro h2 { font-size: 17px; letter-spacing: -.02em; }
.brand-editor-intro p { max-width: 590px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.brand-editor-section { padding-top: 23px; }
.brand-editor-section + .brand-editor-section { margin-top: 23px; border-top: 1px solid var(--line); }
.brand-code-hint { display: flex; align-items: center; min-height: 40px; margin: 14px 0 0; padding: 8px 10px; gap: 8px; color: var(--muted); background: #f7f9fb; border: 1px solid var(--line); border-radius: 10px; font-size: 9px; line-height: 1.4; }
.brand-code-hint .icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--brand); }
.brand-code-hint strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; letter-spacing: .02em; }
.brand-section-heading { display: flex; align-items: flex-start; margin-bottom: 16px; gap: 11px; }
.brand-section-heading > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 850;
}
.brand-section-heading h3, .brand-section-heading p { margin: 0; }
.brand-section-heading h3 { font-size: 14px; letter-spacing: -.015em; }
.brand-section-heading p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.brand-logo-drop {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) auto;
  align-items: center;
  min-height: 92px;
  padding: 13px;
  gap: 13px;
  background: #fafbfc;
  border: 1px dashed #c9d2dc;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.brand-logo-drop:hover { background: var(--brand-soft); border-color: rgba(var(--brand-rgb),.45); }
.brand-logo-drop:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.11); }
.brand-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.brand-logo-upload-preview {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background-color: var(--brand);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  border: 1px solid rgba(var(--brand-rgb),.16);
  border-radius: 14px;
  font-size: 18px;
  font-weight: 880;
  box-shadow: 0 7px 17px rgba(23,38,58,.09);
}
.brand-logo-upload-preview.has-image { color: transparent; background-color: #fff; }
.brand-logo-copy { display: flex; min-width: 0; flex-direction: column; }
.brand-logo-copy strong { font-size: 12px; }
.brand-logo-copy small { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.brand-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 17px; gap: 14px; }
.brand-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.brand-field > span:first-child, .brand-color-presets legend { color: #455466; font-size: 10px; font-weight: 760; }
.brand-field > input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  font-size: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.brand-field > input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.1); }
.brand-field > small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.brand-color-row { display: flex; align-items: flex-start; gap: 22px; }
.brand-color-field { width: 225px; flex: 0 0 auto; }
.brand-color-control {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 4px;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.brand-color-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.1); }
.brand-color-control input[type="color"] {
  width: 40px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.brand-color-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.brand-color-control input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.brand-color-control input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.brand-color-control input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}
.brand-color-presets { min-width: 0; padding: 0; margin: 0; border: 0; }
.brand-color-presets legend { padding: 0; margin-bottom: 9px; }
.brand-color-presets > div { display: flex; width: 100%; max-width: 100%; padding: 2px 3px 4px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.brand-color-presets > div::-webkit-scrollbar { display: none; }
.brand-color-preset {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  background: var(--preset);
  border: 5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform .15s ease, box-shadow .15s ease;
}
.brand-color-preset:hover { transform: translateY(-2px); }
.brand-color-preset.active, .brand-color-preset[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--preset), 0 6px 13px rgba(23,38,58,.12); }
.brand-color-preset:focus-visible { outline: 3px solid rgba(var(--brand-rgb),.2); outline-offset: 3px; }

.brand-form-message { margin: 18px 0 -4px; padding: 11px 13px; color: var(--danger); background: #fff0f0; border: 1px solid #f5d2d4; border-radius: 10px; font-size: 10px; line-height: 1.45; }
.brand-form-actions { display: flex; align-items: center; justify-content: flex-end; padding-top: 21px; margin-top: 23px; gap: 9px; border-top: 1px solid var(--line); }
.brand-reset-button { color: var(--muted); background: transparent; border-color: transparent; }
.brand-reset-button:not(:disabled):hover { color: var(--danger); background: #fff3f3; border-color: #f5d2d4; }
.brand-publish-button { min-width: 232px; }

.brand-preview-column { position: sticky; top: 102px; min-width: 0; }
.brand-preview-heading { display: flex; align-items: flex-end; justify-content: space-between; min-height: 39px; padding: 0 4px 10px; gap: 12px; }
.brand-preview-heading > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.brand-preview-heading > div > span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand-preview-heading > div > strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview-heading > span { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 8px; font-weight: 720; white-space: nowrap; }
.brand-preview-heading > span i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.brand-live-preview {
  overflow: hidden;
  background: #eef2f5;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(23,38,58,.13);
}
.brand-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 65px;
  padding: 11px 13px;
  gap: 12px;
  color: #fff;
  background: linear-gradient(120deg,#17273b,#203b5a);
}
.brand-preview-wordmark { display: flex; min-width: 0; align-items: center; gap: 9px; }
.brand-preview-logo {
  display: grid;
  width: 76px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background-color: var(--brand);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 880;
}
.brand-preview-logo.has-image { color: transparent; background-color: #fff; }
.brand-preview-wordmark > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.brand-preview-wordmark strong, .brand-preview-wordmark small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview-wordmark strong { font-size: 10px; }
.brand-preview-wordmark small { max-width: 165px; margin-top: 3px; color: #aebdca; font-size: 6px; }
.brand-preview-live { display: inline-flex; align-items: center; min-height: 27px; padding: 0 8px; gap: 5px; color: #fff; background: rgba(var(--brand-rgb),.78); border-radius: 8px; font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.brand-preview-live i { width: 5px; height: 5px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.brand-preview-stage { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); padding: 12px; gap: 9px; }
.brand-preview-camera {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 226px;
  overflow: hidden;
  background: linear-gradient(145deg,#dce7eb,#a9bdc8);
  border-radius: 13px;
}
.brand-preview-camera::before { content: ""; position: absolute; width: 160px; height: 160px; background: rgba(255,255,255,.25); border-radius: 50%; }
.brand-preview-person {
  position: relative;
  z-index: 1;
  display: grid;
  width: 82px;
  height: 82px;
  margin-bottom: 28px;
  place-items: center;
  color: #87412e;
  background: #ffd3c5;
  border: 5px solid rgba(255,255,255,.72);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 850;
  box-shadow: 0 9px 22px rgba(29,57,72,.13);
}
.brand-preview-speaker { position: absolute; right: 8px; bottom: 8px; left: 8px; display: flex; align-items: center; min-height: 29px; padding: 0 8px; gap: 6px; overflow: hidden; color: #fff; background: rgba(17,39,55,.72); border-radius: 7px; font-size: 7px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview-speaker i { width: 5px; height: 5px; flex: 0 0 auto; background: #5be29f; border-radius: 50%; }
.brand-preview-question { min-width: 0; padding: 13px 11px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.brand-preview-question > span { color: var(--brand); font-size: 6px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.brand-preview-question > strong { display: block; margin-top: 7px; font-size: 10px; line-height: 1.3; letter-spacing: -.01em; }
.brand-preview-question ol { display: grid; padding: 0; margin: 11px 0 0; gap: 6px; list-style: none; }
.brand-preview-question li { display: flex; align-items: center; min-height: 37px; padding: 5px 6px; gap: 7px; color: #4e5c6d; background: #f8f9fb; border: 1px solid #e8ecf1; border-radius: 8px; font-size: 7px; font-weight: 650; line-height: 1.25; }
.brand-preview-question li i { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; color: var(--muted); background: #fff; border-radius: 6px; font-size: 7px; font-style: normal; font-weight: 850; }
.brand-preview-question li.selected { color: var(--brand-dark); background: var(--brand-soft); border-color: rgba(var(--brand-rgb),.38); }
.brand-preview-question li.selected i { color: var(--brand-contrast, #fff); background: var(--brand); }
.brand-preview-controls { display: flex; align-items: center; justify-content: center; min-height: 59px; padding: 8px; gap: 7px; background: #fff; border-top: 1px solid var(--line); }
.brand-preview-controls > span { display: grid; width: 32px; height: 32px; place-items: center; color: var(--muted); background: #f1f4f6; border-radius: 9px; }
.brand-preview-controls .icon { width: 14px; height: 14px; }
.brand-preview-controls > strong { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; gap: 5px; color: var(--brand-contrast, #fff); background: linear-gradient(135deg,var(--brand),var(--brand-dark)); border-radius: 9px; font-size: 7px; }
.brand-coverage { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 11px; gap: 7px; }
.brand-coverage article { display: flex; align-items: flex-start; min-width: 0; padding: 10px; gap: 7px; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 11px; }
.brand-coverage article > .icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--success); stroke-width: 2.4; }
.brand-coverage article > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.brand-coverage strong { font-size: 7px; line-height: 1.2; }
.brand-coverage small { color: var(--muted); font-size: 6px; line-height: 1.3; }

.confirm-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 28px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(15,24,37,.28);
  text-align: center;
}
.confirm-dialog::backdrop { background: rgba(13,20,30,.58); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; width: 34px; height: 34px; place-items: center; color: var(--muted); background: #f3f5f7; border: 0; border-radius: 9px; }
.dialog-close .icon { width: 16px; height: 16px; }
.dialog-icon { display: grid; width: 54px; height: 54px; margin: 0 auto; place-items: center; color: var(--danger); background: #fff0f0; border-radius: 16px; }
.confirm-dialog h2 { margin: 16px 0 7px; font-size: 20px; }
.confirm-dialog p { margin: 0 auto; color: var(--muted); font-size: 11px; line-height: 1.55; }
.confirm-dialog > div { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; gap: 9px; }

.device-settings-dialog {
  width: min(760px, calc(100% - 30px));
  max-height: min(760px, calc(100dvh - 30px));
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15,24,37,.28);
}
.device-settings-dialog::backdrop { background: rgba(13,20,30,.58); backdrop-filter: blur(4px); }
.device-settings-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 24px 72px 17px 26px;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}
.device-settings-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 13px;
}
.device-settings-icon .icon { width: 21px; height: 21px; }
.device-settings-header p, .device-settings-header h2 { margin: 0; }
.device-settings-header p { margin-bottom: 3px; color: var(--brand); font-size: 9px; font-weight: 820; letter-spacing: .09em; text-transform: uppercase; }
.device-settings-header h2 { font-size: 21px; letter-spacing: -.025em; }
.device-settings-dialog .dialog-close { top: 22px; right: 22px; width: 44px; height: 44px; }
.device-settings-description { margin: 18px 26px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.device-settings-layout {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(260px,.95fr);
  align-items: start;
  padding: 20px 26px 24px;
  gap: 24px;
}
.device-preview-panel { min-width: 0; }
.device-preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.device-preview-heading h3 { margin: 0; font-size: 12px; }
.device-preview-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 9px;
  font-weight: 750;
}
.device-preview-heading i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,138,91,.09); }
.device-preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(var(--brand-rgb),.2), transparent 35%),
    #111720;
  border-radius: 14px;
}
.device-preview-frame video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.device-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  gap: 10px;
  color: #aeb8c7;
  text-align: center;
}
.device-preview-empty .icon { width: 29px; height: 29px; }
.device-preview-empty span { max-width: 220px; font-size: 10px; line-height: 1.45; }
.device-settings-status { min-height: 34px; margin: 10px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.device-settings-status[data-tone="success"] { color: var(--success); }
.device-settings-status[data-tone="warning"] { color: var(--warning); }
.device-settings-status[data-tone="error"] { color: var(--danger); }
.request-device-access { width: 100%; min-height: 44px; }
.device-settings-fields { display: grid; gap: 16px; }
.device-settings-fields label { display: grid; gap: 7px; }
.device-settings-fields label > span { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 760; }
.device-settings-fields label .icon { width: 16px; height: 16px; color: var(--brand); }
.device-settings-fields select {
  width: 100%;
  min-height: 48px;
  padding: 0 39px 0 12px;
  color: var(--ink);
  background: #f7f8fa;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  font-size: 11px;
  text-overflow: ellipsis;
}
.device-settings-fields select:focus { background: #fff; border-color: rgba(var(--brand-rgb),.45); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.09); }
.device-settings-note {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  gap: 9px;
  color: var(--muted);
  background: #f5f7f9;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.device-settings-note .icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--success); }
.device-settings-note p { margin: 0; font-size: 9px; line-height: 1.5; }
.device-settings-note strong { color: var(--ink); }
.device-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 17px 26px 22px;
  gap: 9px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
}
.device-settings-actions .button { min-height: 44px; }
.device-settings-button:focus-visible,
.device-settings-control:focus-visible,
.device-settings-dialog button:focus-visible,
.device-settings-dialog select:focus-visible { outline: 3px solid rgba(var(--brand-rgb),.2); outline-offset: 2px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; width: min(350px, calc(100% - 32px)); gap: 8px; pointer-events: none; }
.toast {
  padding: 13px 15px;
  color: #fff;
  background: #1c2d43;
  border-radius: 11px;
  box-shadow: 0 13px 35px rgba(15,25,39,.2);
  font-size: 10px;
  font-weight: 670;
  line-height: 1.4;
  animation: toast-in .2s ease both;
}
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .app-header { grid-template-columns: auto 1fr auto; padding-inline: 20px; gap: 15px; }
  .server-pill { display: none; }
  .main-nav button { padding-inline: 12px; }
  .live-layout { grid-template-columns: minmax(0,1fr) 285px; }
  .live-layout.quiz-stage-visible .live-stage-column { grid-template-columns: minmax(320px, 1.15fr) minmax(285px, .85fr); }
  .generated-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .app-header { grid-template-columns: auto 1fr; min-height: 70px; backdrop-filter: none; }
  .main-nav {
    position: fixed;
    z-index: 40;
    right: 12px;
    bottom: 12px;
    left: 12px;
    order: 3;
    justify-content: stretch;
    padding: 5px;
    box-shadow: 0 13px 40px rgba(23,38,58,.18);
  }
  .main-nav button { justify-content: center; flex: 1; }
  .header-side { grid-column: 2; }
  .teacher-chip small { display: none; }
  .app-content { width: min(100% - 30px, 760px); padding-top: 28px; padding-bottom: calc(198px + env(safe-area-inset-bottom)); }
  .page-heading h1, .live-heading h1 { font-size: 29px; }
  .simple-flow { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .live-layout.quiz-stage-visible .live-stage-column { grid-template-columns: minmax(330px, 1.12fr) minmax(300px, .88fr); }
  .video-stage, .teacher-video-room, .teacher-video-room.rost-live-room { min-height: 520px; }
  .communication-panel { min-height: 390px; }
  .communication-panel,
  .quiz-presentation-toolbar { scroll-margin-top: 82px; }
  .live-layout.questions-active:not(.quiz-stage-visible) .communication-panel { order: -1; }
  .live-layout.questions-active:not(.quiz-stage-visible) .video-stage {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .live-layout.questions-active:not(.quiz-stage-visible) .teacher-video-room,
  .live-layout.questions-active:not(.quiz-stage-visible) .teacher-video-room.rost-live-room {
    min-height: 0;
    height: 100%;
  }
  .quiz-presentation-toolbar .quiz-panel-shortcut { display: inline-flex; }
  .participant-list, .chat-messages { max-height: 340px; }
  .control-dock {
    position: fixed;
    z-index: 35;
    right: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 50%;
    margin: 0;
    transform: translateX(-50%);
  }
  .token-grid { grid-template-columns: 1fr; }
  .generated-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .branding-layout { grid-template-columns: 1fr; }
  .brand-preview-column { position: static; top: auto; width: 100%; max-width: 760px; }
}

@media (max-width: 720px) {
  body:has(.app-view.active.quiz-stage-active) .app-content { padding-top: 8px; }
  .app-view.quiz-stage-active .live-heading { display: none; }
  .live-layout.quiz-stage-visible .live-stage-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(120px, 40vw, 160px);
    grid-template-rows: auto auto minmax(0, 1fr);
    height: calc(100dvh - 230px - env(safe-area-inset-bottom));
    min-height: 0;
    overflow: hidden;
    gap: 8px;
  }
  .quiz-presentation-stage:not([hidden]),
  .quiz-preview:not([hidden]),
  .quiz-round:not([hidden]) { display: contents; }
  .quiz-presentation-toolbar {
    position: static;
    z-index: 12;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    padding: 6px 7px;
  }
  .quiz-presentation-toolbar > span { display: inline-flex; flex: 0 0 auto; }
  .quiz-presentation-toolbar > span b { display: none; }
  .quiz-presentation-toolbar-actions {
    justify-content: flex-end;
    width: 100%;
    gap: 5px;
  }
  .quiz-presentation-toolbar button { min-height: 34px; padding-inline: 8px; }
  .quiz-stage-visual {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-height: none;
    margin: 0;
    aspect-ratio: auto;
    background: transparent;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
  }
  .quiz-stage-visual:not(.has-image) { display: none; }
  .quiz-stage-visual img {
    width: 100%;
    height: auto;
    padding: 0;
    aspect-ratio: auto;
    object-fit: contain;
    background: transparent;
  }
  .quiz-stage-copy {
    grid-column: 1 / -1;
    grid-row: 3;
    height: 100%;
    min-height: 0;
    padding: 9px 10px;
    overflow-y: auto;
    border-radius: 13px;
    scrollbar-width: thin;
  }
  .quiz-preview-label {
    min-height: 21px;
    padding-inline: 7px;
    font-size: 7px;
  }
  .quiz-question-meta { margin: 5px 0 3px; font-size: 8px; }
  .quiz-stage-copy > h3 {
    margin-bottom: 6px;
    font-size: clamp(13px, 3.7vw, 16px);
    line-height: 1.25;
  }
  .quiz-preview ol,
  .quiz-live-answers { gap: 4px; }
  .quiz-preview li,
  .quiz-live-answers li {
    min-height: 31px;
    padding: 6px 30px 6px 32px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.25;
  }
  .quiz-preview li::before,
  .quiz-live-answers li::before {
    top: 5px;
    left: 6px;
    width: 19px;
    height: 19px;
    border-radius: 6px;
    font-size: 7px;
  }
  .quiz-live-answers li > b { top: 8px; right: 8px; font-size: 8px; }
  .quiz-round-heading { margin-bottom: 6px; }
  .quiz-phase { min-height: 22px; padding-inline: 7px; font-size: 7px; }
  .quiz-round-heading .quiz-question-meta { font-size: 7px; }
  .quiz-stage-actions,
  .quiz-round-actions {
    position: sticky;
    bottom: -9px;
    margin: auto -10px -9px;
    padding: 8px 10px 9px;
    gap: 5px;
    background: linear-gradient(to bottom, rgba(255,255,255,.86), #fff 9px);
  }
  .quiz-stage-actions .button,
  .quiz-round-actions .button { min-height: 36px; font-size: 8px; }
  .live-layout.quiz-stage-visible .video-stage {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: 100%;
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 2px solid #fff;
    border-radius: 11px;
    box-shadow: 0 8px 22px rgba(8,14,24,.22);
  }
  .live-layout.quiz-stage-visible .teacher-video-room,
  .live-layout.quiz-stage-visible .teacher-video-room.rost-live-room {
    width: 100%;
    min-height: 0;
    height: 100%;
  }
  .live-layout.quiz-stage-visible .rost-live-room__status,
  .live-layout.quiz-stage-visible .rost-live-tile__meta { display: none; }
  .live-layout.quiz-stage-visible .video-stage .prelive-card { padding: 6px; }
  .live-layout.quiz-stage-visible .video-stage .prelive-card .prelive-logo,
  .live-layout.quiz-stage-visible .video-stage .prelive-card p,
  .live-layout.quiz-stage-visible .video-stage .prelive-actions { display: none; }
  .live-layout.quiz-stage-visible .video-stage .prelive-card h2 {
    margin: 0;
    font-size: 9px;
    line-height: 1.2;
  }
  body:has(.app-view.active.quiz-stage-active) .control-dock {
    justify-content: center;
    overflow: visible;
  }
  body:has(.app-view.active.quiz-stage-active) #screenButton,
  body:has(.app-view.active.quiz-stage-active) #recordingButton,
  body:has(.app-view.active.quiz-stage-active) #quizQuickButton,
  body:has(.app-view.active.quiz-stage-active) #liveDeviceSettingsButton,
  body:has(.app-view.active.quiz-stage-active) .dock-divider { display: none; }
}

@media (max-width: 650px) {
  .app-header { padding-inline: 14px; }
  .brand img { width: 78px; height: 34px; }
  .teacher-chip div { display: none; }
  .header-side { gap: 7px; }
  .device-settings-button { width: 44px; height: 44px; }
  .main-nav button { min-height: 48px; padding: 0 6px; flex-direction: column; gap: 2px; font-size: 8px; }
  .main-nav .icon { width: 17px; height: 17px; }
  .page-heading, .live-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .button { align-self: stretch; }
  .slot-grid { grid-template-columns: 1fr; }
  .slot-card { min-height: 270px; padding: 20px; }
  .slot-copy time { font-size: 44px; }
  .simple-flow { padding: 19px; }
  .simple-flow ol { grid-template-columns: 1fr; gap: 14px; }
  .active-webinar-banner { align-items: flex-start; flex-wrap: wrap; }
  .active-webinar-banner .button { width: 100%; }
  .live-heading-actions { width: 100%; flex-wrap: wrap; }
  .live-heading-actions .button { flex: 1; }
  .video-stage, .teacher-video-room, .teacher-video-room.rost-live-room { min-height: 430px; }
  .prelive-actions { width: min(100%, 330px); }
  .prelive-actions .button { width: 100%; }
  .rost-live-room__videos { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .control-dock {
    position: fixed;
    z-index: 20;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    justify-content: flex-start;
    width: auto;
    margin: 0;
    padding-inline: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    transform: none;
  }
  .control-dock::-webkit-scrollbar { display: none; }
  .media-control { min-width: 52px; flex: 1 0 52px; padding-inline: 3px; }
  .media-control small { font-size: 10px; }
  .end-button { width: 48px; padding: 0; }
  .end-button span { display: none; }
  .tokens-heading .security-note { display: none; }
  .student-link-card { grid-template-columns: auto minmax(0,1fr); }
  .student-link-card .button { grid-column: 1 / -1; }
  .token-form { grid-template-columns: 1fr 90px; }
  .token-form .button { grid-column: 1 / -1; }
  .token-stats-card { padding: 10px; }
  .generated-heading { grid-template-columns: auto minmax(0,1fr); }
  .generated-heading .button { grid-column: 1 / -1; }
  .generated-list { grid-template-columns: 1fr; }
  .list-heading { align-items: flex-start; flex-direction: column; }
  .token-filters { width: 100%; }
  .token-filters button { flex: 1; }
  .token-table th:nth-child(4), .token-table td:nth-child(4) { display: none; }
  .token-table th, .token-table td { padding-inline: 10px; }
  .branding-page-heading .brand-publish-status { width: 100%; justify-content: center; }
  .brand-editor-card { padding: 18px; }
  .brand-editor-intro { align-items: flex-start; padding-bottom: 18px; }
  .brand-editor-intro p { font-size: 9px; }
  .brand-logo-drop { grid-template-columns: 58px minmax(0,1fr); min-height: 0; }
  .brand-logo-upload-preview { width: 58px; height: 58px; }
  .brand-logo-action { grid-column: 1 / -1; min-height: 44px; }
  .brand-field-grid { grid-template-columns: 1fr; }
  .brand-field > input { min-height: 48px; font-size: 13px; }
  .brand-color-row { flex-direction: column; gap: 16px; }
  .brand-color-field { width: 100%; }
  .brand-color-control { min-height: 48px; }
  .brand-color-presets { width: 100%; }
  .brand-color-presets > div { max-width: 100%; padding: 2px 3px 4px; overflow-x: auto; scrollbar-width: none; }
  .brand-color-presets > div::-webkit-scrollbar { display: none; }
  .brand-form-actions { display: grid; grid-template-columns: 1fr; }
  .brand-form-actions .button { width: 100%; min-height: 48px; }
  .brand-publish-button { min-width: 0; order: -1; }
  .brand-reset-button { background: #fff; border-color: var(--line); }
  .brand-preview-heading { padding-inline: 2px; }
  .confirm-dialog { padding: 25px 18px 20px; }
  .confirm-dialog > div { grid-template-columns: 1fr; }
  .device-settings-dialog { width: min(100% - 18px, 760px); max-height: calc(100dvh - 18px); border-radius: 18px; }
  .device-settings-header { padding: 18px 66px 14px 18px; }
  .device-settings-dialog .dialog-close { top: 14px; right: 14px; }
  .device-settings-description { margin: 15px 18px 0; }
  .device-settings-layout { grid-template-columns: 1fr; padding: 17px 18px 20px; gap: 20px; }
  .device-preview-frame { min-height: 0; }
  .device-settings-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 14px 18px 18px; }
  .toast-region { right: 16px; bottom: 86px; }
}

@media (max-width: 430px) {
  .brand-editor-intro > span { width: 40px; height: 40px; }
  .brand-editor-intro h2 { font-size: 16px; }
  .brand-section-heading p { font-size: 8px; }
  .brand-preview-header { min-height: 58px; padding: 9px 10px; }
  .brand-preview-logo { width: 62px; height: 34px; }
  .brand-preview-wordmark small { display: none; }
  .brand-preview-live { min-height: 25px; padding-inline: 7px; }
  .brand-preview-stage { padding: 8px; gap: 6px; }
  .brand-preview-camera { min-height: 196px; border-radius: 10px; }
  .brand-preview-camera::before { width: 120px; height: 120px; }
  .brand-preview-person { width: 66px; height: 66px; margin-bottom: 25px; border-width: 4px; font-size: 16px; }
  .brand-preview-speaker { right: 6px; bottom: 6px; left: 6px; min-height: 26px; padding-inline: 6px; }
  .brand-preview-question { padding: 9px 7px; border-radius: 10px; }
  .brand-preview-question > strong { margin-top: 5px; font-size: 8px; }
  .brand-preview-question ol { margin-top: 8px; gap: 4px; }
  .brand-preview-question li { min-height: 31px; padding: 4px; gap: 5px; font-size: 6px; border-radius: 7px; }
  .brand-preview-question li i { width: 19px; height: 19px; border-radius: 5px; font-size: 6px; }
  .brand-preview-controls { min-height: 52px; padding: 6px; gap: 5px; }
  .brand-preview-controls > span { width: 30px; height: 30px; }
  .brand-preview-controls > strong { min-height: 30px; padding-inline: 8px; }
  .brand-coverage { grid-template-columns: 1fr; }
  .brand-coverage article { align-items: center; min-height: 48px; }
  .brand-coverage strong { font-size: 8px; }
  .brand-coverage small { font-size: 7px; }
  .quiz-presentation-toolbar > span b { display: none; }
  .quiz-presentation-toolbar button span { font-size: 9px; }
  .quiz-presentation-toolbar #returnToCameraButton span { display: none; }
  .quiz-presentation-toolbar #returnToCameraButton { width: 36px; padding: 0; justify-content: center; }
  .control-dock { min-height: 62px; }
  .media-control { min-width: 44px; height: 50px; flex-basis: 44px; }
  .media-control small {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .dock-divider { display: none; }
  .end-button { width: 50px; min-height: 50px; }
  .device-settings-header { align-items: flex-start; }
  .device-settings-icon { width: 42px; height: 42px; }
  .device-settings-header h2 { font-size: 18px; }
  .device-settings-actions { grid-template-columns: 1fr; }
  .device-settings-actions .button-primary { order: -1; }
}

@media (max-width: 390px) {
  .brand-editor-card { padding: 15px; }
  .brand-editor-section { padding-top: 20px; }
  .brand-editor-section + .brand-editor-section { margin-top: 20px; }
  .brand-logo-drop { grid-template-columns: 52px minmax(0,1fr); padding: 10px; gap: 10px; }
  .brand-logo-upload-preview { width: 52px; height: 52px; border-radius: 12px; }
  .brand-logo-copy strong { font-size: 11px; }
  .brand-logo-copy small { font-size: 8px; }
  .brand-color-preset { width: 44px; height: 44px; }
  .brand-preview-heading > span { font-size: 7px; }
  .brand-preview-camera { min-height: 184px; }
}

@media (max-width: 360px), (max-height: 740px) {
  body:has(.app-view.active.quiz-stage-active) .app-content { padding-top: 6px; }
  .live-layout.quiz-stage-visible .live-stage-column {
    height: calc(100dvh - 230px - env(safe-area-inset-bottom));
    gap: 6px;
  }
  .quiz-presentation-toolbar { padding: 4px 5px; }
  .quiz-presentation-toolbar button { min-height: 32px; padding-inline: 7px; }
  .quiz-preview-label { display: none; }
  .quiz-stage-copy { padding: 7px; }
  .quiz-question-meta { margin-top: 0; }
  .quiz-stage-copy > h3 { margin-bottom: 5px; font-size: 13px; line-height: 1.22; }
  .quiz-preview li,
  .quiz-live-answers li {
    min-height: 28px;
    padding: 4px 27px 4px 29px;
    font-size: 10px;
    line-height: 1.2;
  }
  .quiz-preview li::before,
  .quiz-live-answers li::before {
    top: 4px;
    left: 5px;
    width: 18px;
    height: 18px;
  }
  .quiz-stage-actions,
  .quiz-round-actions {
    bottom: -7px;
    margin: auto -7px -7px;
    padding: 6px 7px 7px;
  }
  .quiz-stage-actions .button,
  .quiz-round-actions .button { min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
