: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: #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 both; }
@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: #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: #fff;
  background: linear-gradient(125deg, #b9141a, var(--brand) 55%, #ef4545);
  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 {
  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; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: stretch; gap: 17px; }
.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: 1fr 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: #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: #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: #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; }

.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; }
.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: #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; }

.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; }
  .generated-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .app-header { grid-template-columns: auto 1fr; min-height: 70px; }
  .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: 100px; }
  .page-heading h1, .live-heading h1 { font-size: 29px; }
  .simple-flow { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .video-stage, .teacher-video-room, .teacher-video-room.rost-live-room { min-height: 520px; }
  .communication-panel { min-height: 390px; }
  .participant-list, .chat-messages { max-height: 340px; }
  .token-grid { grid-template-columns: 1fr; }
  .generated-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@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%; }
  .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: sticky; z-index: 20; bottom: 78px; width: 100%; padding-inline: 5px; }
  .media-control { min-width: 0; flex: 1; 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; }
  .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) {
  .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 (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
