@font-face {
  font-family: "Vazirmatn";
  src: url("/production/assets/fonts/Vazirmatn.woff2?v=33.197") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.live-page {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--text-dark);
  background: var(--bg-page);
  font-family: "Vazirmatn", sans-serif;
}

.live-page button,
.live-page input,
.live-page textarea {
  font: inherit;
}

.live-page [hidden] { display: none !important; }

.live-page button,
.live-page a,
.live-page label {
  -webkit-tap-highlight-color: transparent;
}

.live-app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  grid-template-rows: 68px minmax(0, 1fr);
  grid-template-areas: "top top" "nav stage";
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  isolation: isolate;
}

.live-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--sky-bg);
}

.live-app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .58;
  background-image:
    linear-gradient(rgba(var(--star-color), .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--star-color), .025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

.live-topbar {
  grid-area: top;
  position: relative;
  z-index: 80;
  min-width: 0;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--nav-bg) 92%, transparent);
  backdrop-filter: blur(20px) saturate(130%);
}

.live-brand,
.session-identity,
.top-status {
  min-width: 0;
  display: flex;
  align-items: center;
}

.live-brand {
  gap: 10px;
  color: var(--text-dark);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 162, 97, .42);
  border-radius: 8px;
  color: #171006;
  background: var(--warm-accent);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 8px 28px rgba(244, 162, 97, .18);
}

.live-brand span:last-child,
.session-identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.live-brand strong,
.session-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.live-brand small,
.session-identity small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-identity {
  justify-self: center;
  justify-content: center;
  gap: 10px;
  max-width: min(100%, 580px);
  text-align: center;
}

.live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(158, 224, 174, .1), 0 0 18px rgba(158, 224, 174, .55);
  animation: livePulse 2.2s ease-in-out infinite;
}

@keyframes livePulse {
  50% { opacity: .58; transform: scale(.88); }
}

.top-status {
  justify-content: flex-end;
  gap: 8px;
}

.quality-pill,
.top-icon,
.top-exit,
.session-clock {
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-dark);
  background: var(--ui-bg);
}

.quality-pill,
.top-icon {
  cursor: pointer;
}

.quality-pill {
  min-width: 92px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
}

.signal-bars {
  height: 14px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.signal-bars i {
  width: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--success);
}

.signal-bars i:nth-child(1) { height: 5px; }
.signal-bars i:nth-child(2) { height: 9px; }
.signal-bars i:nth-child(3) { height: 13px; }

.top-icon {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.top-exit,
.session-clock {
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
}

.top-exit:hover {
  color: var(--danger);
  border-color: rgba(255, 143, 143, .34);
}

.quality-popover {
  position: absolute;
  top: 58px;
  left: 70px;
  z-index: 120;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--nav-bg) 96%, #000 4%);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
}

.quality-popover button {
  width: 100%;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  color: var(--text-dark);
  background: transparent;
  cursor: pointer;
}

.quality-popover button:hover { background: var(--sage-bg); }
.quality-popover small { color: var(--text-muted); font-size: 10px; }

.workspace-nav {
  grid-area: nav;
  min-height: 0;
  padding: 10px 8px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--nav-bg) 74%, transparent);
}

.workspace-tab {
  position: relative;
  min-height: 68px;
  padding: 7px 5px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.workspace-tab:hover {
  color: var(--text-dark);
  background: var(--ui-bg);
  transform: translateY(-1px);
}

.workspace-tab.active {
  color: var(--warm-accent);
  border-color: rgba(244, 162, 97, .28);
  background: rgba(244, 162, 97, .1);
}

.workspace-tab > span { font-size: 20px; line-height: 1; }
.workspace-tab strong { font-size: 11px; font-weight: 900; }
.workspace-tab small { font-size: 8px; color: inherit; opacity: .72; }
.workspace-tab b {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #171006;
  background: var(--warm-accent);
  font-size: 9px;
}

.workspace-stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.workspace {
  display: none;
  min-height: 100%;
  padding: 14px;
  animation: workspaceIn .22s ease both;
}

.workspace.active { display: block; }

@keyframes workspaceIn {
  from { opacity: 0; transform: translateY(6px); }
}

.video-layout {
  min-height: calc(100dvh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 12px;
}

.media-stage {
  position: relative;
  min-width: 0;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #030605;
  box-shadow: var(--card-shadow);
}

.media-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 36px 36px;
}

.media-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  gap: 7px;
}

.media-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: #0b100e;
}

.media-tile.is-screen {
  grid-column: 1 / -1;
  grid-row: 1 / span 2;
}

.media-tile video,
.media-tile audio {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-tile.is-screen video { object-fit: contain; background: #050706; }
.media-tile.is-speaking { border-color: rgba(158, 224, 174, .62); box-shadow: inset 0 0 0 1px rgba(158, 224, 174, .24); }

.tile-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: #fff;
  background: rgba(4, 7, 6, .7);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.media-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: #f3f5f2;
}

.media-placeholder strong { font-size: 14px; }
.media-placeholder small { color: #a8b0aa; font-size: 11px; line-height: 1.8; }

.placeholder-orbit {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 162, 97, .3);
  border-radius: 50%;
  background: rgba(244, 162, 97, .08);
  box-shadow: 0 0 0 16px rgba(244, 162, 97, .025), 0 0 0 32px rgba(156, 179, 158, .018);
}

.placeholder-orbit span { color: var(--warm-accent); font-weight: 950; }

.stage-hud {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.stage-hud-top { top: 14px; right: 14px; left: 14px; }

.hud-chip {
  min-height: 30px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: #e9efeb;
  background: rgba(5, 9, 7, .7);
  font-size: 10px;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.hud-chip.success { color: var(--success); }
.hud-chip.warn { color: var(--warm-accent); }
.hud-chip.danger { color: var(--danger); }
.hud-chip.record { color: #fff; border-color: rgba(255, 143, 143, .4); background: rgba(135, 22, 22, .68); }

.join-class-button {
  position: absolute;
  right: 50%;
  bottom: 26px;
  z-index: 8;
  min-width: 245px;
  min-height: 60px;
  padding: 8px 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 162, 97, .45);
  border-radius: 8px;
  color: #171006;
  background: var(--warm-accent);
  box-shadow: 0 14px 42px rgba(244, 162, 97, .22);
  transform: translateX(50%);
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

.join-class-button:hover { transform: translateX(50%) translateY(-2px); filter: brightness(1.04); }
.join-class-button span { font-size: 14px; font-weight: 950; }
.join-class-button small { font-size: 9px; opacity: .72; }
.join-class-button.connected { display: none; }

.screen-annotation {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.caption-strip {
  position: absolute;
  right: 50%;
  bottom: 20px;
  z-index: 7;
  width: min(720px, calc(100% - 40px));
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #fff;
  background: rgba(3, 6, 5, .78);
  transform: translateX(50%);
  backdrop-filter: blur(10px);
}

.caption-strip span { color: var(--warm-accent); font-size: 10px; font-weight: 900; }
.caption-strip p { margin: 0; font-size: 12px; line-height: 1.8; }

.lesson-rail,
.chat-panel,
.question-panel,
.summary-editor,
.transcript-panel {
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--card-shadow);
}

.lesson-rail {
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
}

.rail-head,
.workspace-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rail-head > div,
.workspace-head > div,
.dialog-head > div { min-width: 0; display: grid; gap: 2px; }
.rail-head small,
.workspace-head small,
.dialog-head small { color: var(--warm-accent); font-size: 9px; font-weight: 800; }
.rail-head strong { font-size: 14px; }
.workspace-head h2,
.dialog-head h2 { margin: 0; font-size: 17px; font-weight: 950; }

.mini-button,
.count-pill,
.preview-label {
  min-height: 30px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  background: var(--ui-bg);
  font-size: 9px;
  font-weight: 850;
}

button.mini-button { cursor: pointer; }
button.mini-button:hover { border-color: rgba(244, 162, 97, .35); color: var(--warm-accent); }

.timeline-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
}

.timeline-item {
  position: relative;
  padding: 10px 40px 10px 10px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--ui-bg);
  cursor: pointer;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 14px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--warm-accent);
  border-radius: 50%;
}

.timeline-item time { color: var(--warm-accent); font-size: 9px; font-weight: 900; }
.timeline-item strong { font-size: 11px; }
.timeline-item p { margin: 0; color: var(--text-muted); font-size: 9px; line-height: 1.7; }

.empty-state {
  min-height: 120px;
  padding: 18px;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: 7px;
  font-size: 10px;
}

.rail-action {
  width: 100%;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  text-align: right;
  border: 1px solid rgba(244, 162, 97, .25);
  border-radius: 7px;
  color: var(--text-dark);
  background: rgba(244, 162, 97, .08);
  cursor: pointer;
}

.rail-action > span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--warm-accent);
  background: rgba(244, 162, 97, .12);
}

.rail-action > span:last-child { display: grid; gap: 1px; }
.rail-action strong { font-size: 10px; }
.rail-action small { color: var(--text-muted); font-size: 8px; }

.lesson-snapshot,
.attendance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.lesson-snapshot div,
.attendance-strip article {
  min-width: 0;
  padding: 9px 6px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  text-align: center;
  background: var(--ui-bg);
}

.lesson-snapshot small,
.attendance-strip span { color: var(--text-muted); font-size: 8px; }
.lesson-snapshot strong,
.attendance-strip strong { font-size: 14px; }

.board-shell {
  min-height: calc(100dvh - 176px);
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  grid-template-rows: minmax(430px, 1fr) auto;
  gap: 10px;
}

.board-toolbar {
  grid-row: 1 / span 2;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
}

.board-toolbar button,
.board-color {
  min-height: 49px;
  padding: 5px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 17px;
}

.board-toolbar button small { font-size: 8px; }
.board-toolbar button:hover,
.board-toolbar button.active { color: var(--warm-accent); border-color: rgba(244, 162, 97, .3); background: rgba(244, 162, 97, .09); }
.board-color { position: relative; overflow: hidden; }
.board-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.board-color span { width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%; background: var(--board-color, #f4a261); }

.board-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f6f8f5;
  touch-action: none;
}

.board-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(38, 48, 42, .18) 1px, transparent 1px);
  background-size: 24px 24px;
}

#whiteboardCanvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; cursor: crosshair; }
.board-status { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: flex; gap: 6px; }
.board-status span,
.board-status button {
  min-height: 27px;
  padding: 5px 8px;
  border: 1px solid rgba(38, 48, 42, .12);
  border-radius: 6px;
  color: #26302a;
  background: rgba(255, 255, 255, .82);
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
}
.board-status button { cursor: pointer; }
.board-status button:hover { color: #d8732e; border-color: rgba(244, 162, 97, .45); }

.board-filebar {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
}

.file-action input,
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-action,
.board-filebar button { padding: 8px 11px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-dark); background: var(--ui-bg); cursor: pointer; font-size: 10px; font-weight: 800; }

.board-tool-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-formula-icon {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1;
}

.board-toolbar button:disabled,
.board-filebar button:disabled,
.board-color.is-disabled,
.file-action.is-disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: grayscale(1);
}

.board-canvas-wrap.is-file-over {
  border-color: #f4a261;
  box-shadow: inset 0 0 0 3px rgba(244, 162, 97, .18);
}

.board-canvas-wrap.is-select-mode #whiteboardCanvas { pointer-events: none; cursor: default; }
.board-canvas-wrap:not(.is-select-mode) .board-object { pointer-events: none; }
.board-canvas-wrap.is-pan-mode .board-object { pointer-events: none; }

.board-object-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

.board-object {
  position: absolute;
  min-width: 120px;
  min-height: 80px;
  overflow: visible;
  border: 1px solid rgba(38, 48, 42, .16);
  border-radius: 8px;
  color: #26302a;
  background: #fff;
  box-shadow: 0 9px 28px rgba(38, 48, 42, .12);
  pointer-events: auto;
  transform-origin: center;
  transition: border-color .18s ease, box-shadow .18s ease, filter .18s ease;
  user-select: none;
}

.board-object:hover {
  border-color: rgba(244, 162, 97, .55);
  box-shadow: 0 12px 34px rgba(38, 48, 42, .16);
}

.board-object.is-selected {
  border-color: #f4a261;
  box-shadow: 0 0 0 3px rgba(244, 162, 97, .2), 0 16px 38px rgba(38, 48, 42, .18);
}

.board-object.is-manipulating {
  border-color: #e48b45;
  box-shadow: 0 0 0 4px rgba(244, 162, 97, .2), 0 20px 42px rgba(38, 48, 42, .2);
  animation: board-object-float .8s ease-in-out infinite alternate;
}

@keyframes board-object-float {
  from { translate: 0 -1px; }
  to { translate: 0 2px; }
}

.board-object-grab {
  height: 34px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(38, 48, 42, .1);
  border-radius: 8px 8px 0 0;
  background: rgba(247, 248, 246, .94);
  cursor: grab;
  touch-action: none;
}

.board-object-grab:active { cursor: grabbing; }
.board-object-grab strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.board-object-grab span {
  min-width: 0;
  overflow: hidden;
  color: #6e7972;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-object-content {
  position: absolute;
  inset: 34px 0 0;
  overflow: hidden;
  border-radius: 0 0 7px 7px;
}

.board-object-content > img,
.board-object-content > video,
.board-object-content > iframe,
.board-object-content > object {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
  background: #111;
}

.board-object.kind-image .board-object-content { background: #eef1ed; }
.board-object.kind-image img { object-fit: contain; background: #eef1ed; }
.board-object.kind-video video { object-fit: contain; }
.board-object.kind-pdf .board-object-content { background: #f1f3ef; }

.board-object-copy {
  height: 100%;
  padding: 18px;
  overflow: auto;
  color: #26302a;
  background: #fff;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.9;
  text-align: right;
  white-space: pre-wrap;
  user-select: text;
}

.board-object.variant-sticky .board-object-copy {
  background: #fff1a8;
  font-size: 16px;
}

.board-object-copy[contenteditable="true"] {
  outline: 0;
  box-shadow: inset 0 0 0 2px rgba(244, 162, 97, .4);
  cursor: text;
}

.board-math-content {
  height: 100%;
  padding: 16px;
  display: grid;
  place-items: center;
  overflow: auto;
  direction: ltr;
  background: #fff;
  font-size: 22px;
}

.board-math-content .katex-display { margin: 0; overflow: auto hidden; }

.board-question-content {
  height: 100%;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 9px;
  background: linear-gradient(145deg, #fff 0%, #fff8f1 100%);
}

.board-question-content small { color: #d8732e; font-size: 10px; font-weight: 900; }
.board-question-content strong { font-size: 18px; line-height: 1.75; }
.board-question-content span { color: #6e7972; font-size: 10px; }

.board-file-object {
  height: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 14px;
  background: linear-gradient(145deg, #fff 0%, #fff7ef 100%);
}

.board-file-object > b {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 162, 97, .3);
  border-radius: 8px;
  color: #d8732e;
  background: rgba(244, 162, 97, .12);
  font-size: 12px;
}

.board-file-object > span { min-width: 0; display: grid; gap: 5px; }
.board-file-object strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.board-file-object small { color: #6e7972; font-size: 9px; }
.board-file-object a { width: fit-content; color: #d8732e; font-size: 10px; font-weight: 900; }

.board-live-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #5d6962;
  background: radial-gradient(circle at 50% 40%, rgba(244, 162, 97, .18), transparent 42%), #eef1ed;
  text-align: center;
}

.board-live-placeholder .ui-icon { width: 34px; height: 34px; fill: none; stroke: #d8732e; stroke-width: 1.6; }
.board-live-placeholder strong { font-size: 12px; }
.board-live-placeholder small { font-size: 9px; }
.board-object.kind-live video { object-fit: cover; transform: scaleX(-1); }
.board-object.kind-live.is-screen-feed video { object-fit: contain; transform: none; }

.board-object-tools {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: 4;
  padding: 4px;
  display: none;
  gap: 4px;
  border: 1px solid rgba(38, 48, 42, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 8px 22px rgba(38, 48, 42, .14);
  transform: scale(var(--board-control-scale, 1));
  transform-origin: left bottom;
}

.board-object.is-selected .board-object-tools { display: flex; }
.board-object-tools button {
  min-width: 30px;
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  color: #435047;
  background: #f1f3ef;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
}
.board-object-tools button:hover { color: #d8732e; background: #fff2e7; }
.board-object-tools .danger:hover { color: #bd3e3e; background: #fff0f0; }

.board-resize-handle {
  position: absolute;
  left: -11px;
  bottom: -11px;
  z-index: 5;
  width: 25px;
  height: 25px;
  display: none;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f4a261;
  box-shadow: 0 3px 10px rgba(38, 48, 42, .24);
  cursor: nesw-resize;
  touch-action: none;
  transform: scale(var(--board-control-scale, 1));
}

.board-object.is-selected .board-resize-handle { display: block; }

.board-empty-hint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  gap: 5px;
  color: rgba(38, 48, 42, .48);
  text-align: center;
  pointer-events: none;
  transition: opacity .2s ease;
}

.board-empty-hint span { font-size: 15px; font-weight: 950; }
.board-empty-hint small { max-width: 340px; font-size: 10px; line-height: 1.8; }
.board-empty-hint.has-content { opacity: 0; }

.board-permission-banner {
  position: absolute;
  top: 10px;
  right: 50%;
  z-index: 7;
  width: min(560px, calc(100% - 24px));
  padding: 8px 9px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(244, 162, 97, .38);
  border-radius: 8px;
  color: #26302a;
  background: rgba(255, 251, 246, .94);
  box-shadow: 0 10px 30px rgba(38, 48, 42, .12);
  backdrop-filter: blur(12px);
  transform: translateX(50%);
}

.board-permission-banner > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.board-permission-banner .ui-icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: #d8732e; stroke-width: 1.8; }
.board-permission-banner span { min-width: 0; display: grid; gap: 1px; }
.board-permission-banner strong { font-size: 10px; }
.board-permission-banner small { overflow: hidden; color: #6e7972; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.board-permission-banner button {
  min-height: 34px;
  padding: 6px 10px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #d8732e;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
}

.board-edit-guide {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 162, 97, .35);
  border-radius: 7px;
  color: #26302a;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(38, 48, 42, .12);
  pointer-events: none;
}
.board-edit-guide strong { font-size: 9px; }
.board-edit-guide span { color: #d8732e; font-size: 9px; font-weight: 900; direction: ltr; }

.board-status { z-index: 7; }

.board-filebar { flex-wrap: wrap; }
.board-file-actions { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.board-filebar button,
.board-filebar .file-action { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; }
.board-filebar .ui-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.board-primary-action { color: #fff; border-color: #d8732e; background: #d8732e; }
.board-filebar button:hover,
.board-filebar .file-action:hover { border-color: rgba(244, 162, 97, .55); color: #d8732e; background: rgba(244, 162, 97, .08); }
.board-primary-action:hover { color: #fff; border-color: #c96524; background: #c96524; }
#boardAccessBtn { position: relative; }
#boardAccessBadge {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #d8732e;
  font-size: 8px;
}

.board-upload-flow {
  width: 100%;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(244, 162, 97, .24);
  border-radius: 8px;
  background: rgba(244, 162, 97, .06);
}

.board-upload-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.board-upload-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: #d8732e; background: rgba(244, 162, 97, .15); font-size: 8px; font-weight: 950; }
.board-upload-meta > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.board-upload-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.board-upload-meta small { color: var(--text-muted); font-size: 8px; }
.board-upload-meta > b { color: var(--warm-accent); font-size: 10px; direction: ltr; }
.board-upload-track { height: 7px; overflow: hidden; border-radius: 6px; background: var(--ui-bg); }
.board-upload-track i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #e9873d, #f4a261); transition: width .2s ease; }
.board-upload-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.board-upload-steps span { padding: 4px; border-radius: 5px; color: var(--text-muted); background: var(--ui-bg); text-align: center; font-size: 7px; font-weight: 800; transition: color .18s ease, background .18s ease; }
.board-upload-steps span.active { color: #d8732e; background: rgba(244, 162, 97, .15); }
.board-upload-steps span.done { color: #3f7454; background: rgba(76, 139, 99, .12); }
.board-upload-flow.has-error { border-color: rgba(189, 62, 62, .3); background: rgba(189, 62, 62, .06); }
.board-upload-flow.has-error .board-upload-track i { background: #bd3e3e; }

.question-to-board {
  min-height: 34px;
  padding: 6px 9px;
  align-self: center;
  border: 1px solid rgba(244, 162, 97, .34);
  border-radius: 6px;
  color: #d8732e;
  background: rgba(244, 162, 97, .08);
  cursor: pointer;
  font-family: inherit;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.question-to-board:hover { color: #fff; background: #d8732e; }
.question-card-with-action { grid-template-columns: 28px minmax(0, 1fr) auto; }
.question-card-with-action > div { min-width: 0; display: grid; gap: 4px; }

.math-dialog { width: min(620px, calc(100% - 24px)); }
.math-preview {
  min-height: 110px;
  padding: 16px;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 1px solid rgba(244, 162, 97, .25);
  border-radius: 8px;
  color: #26302a;
  background: #fff;
  direction: ltr;
  font-size: 22px;
}
.math-symbols { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; direction: ltr; }
.math-symbols button {
  min-height: 38px;
  padding: 5px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  background: var(--ui-bg);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 800;
}
.math-symbols button:hover { color: #d8732e; border-color: rgba(244, 162, 97, .55); background: rgba(244, 162, 97, .09); }

.board-access-dialog { width: min(620px, calc(100% - 24px)); }
.board-access-intro { padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(244, 162, 97, .24); border-radius: 8px; background: rgba(244, 162, 97, .07); }
.board-access-intro .ui-icon { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: #d8732e; stroke-width: 1.8; }
.board-access-intro p { margin: 0; color: var(--text-muted); font-size: 9px; line-height: 1.8; }
.board-access-list { display: grid; gap: 8px; }
.board-access-row {
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--ui-bg);
}
.board-access-row > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #d8732e; background: rgba(244, 162, 97, .14); font-size: 12px; font-weight: 950; }
.board-access-row > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.board-access-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.board-access-row small { color: var(--text-muted); font-size: 8px; }
.board-access-actions { display: flex; gap: 5px; }
.board-access-actions button,
.board-access-request,
.board-access-close {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  background: var(--ui-bg);
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
}
.board-access-actions .grant,
.board-access-request { color: #fff; border-color: #d8732e; background: #d8732e; }
.board-access-actions .revoke { color: #b54444; }
.board-access-student-state { min-height: 120px; padding: 18px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed var(--border-color); border-radius: 8px; text-align: center; }
.board-access-student-state strong { font-size: 14px; }
.board-access-student-state span { color: var(--text-muted); font-size: 9px; line-height: 1.8; }
.board-access-request { width: 100%; margin-top: 8px; }
.board-access-close { width: 100%; }

.communication-layout {
  min-height: calc(100dvh - 176px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.chat-panel,
.question-panel {
  min-height: 0;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.chat-panel { grid-template-rows: auto minmax(320px, 1fr) auto auto; }
.question-panel { grid-template-rows: auto auto minmax(240px, 1fr) auto; }

.message-list,
.question-list,
.transcript-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.message {
  max-width: min(82%, 720px);
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--border-color);
  border-radius: 8px 8px 2px 8px;
  background: var(--ui-bg);
}

.message.own { margin-right: auto; border-radius: 8px 8px 8px 2px; color: var(--btn-text); background: var(--sage-main); }
.message header { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; font-weight: 900; }
.message time { opacity: .62; }
.message p { margin: 0; font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }

.reaction-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.reaction-row button { min-width: 37px; height: 34px; padding: 0 9px; border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-dark); background: var(--ui-bg); cursor: pointer; white-space: nowrap; }
.reaction-row .confusion-button { margin-right: auto; color: var(--warm-accent); border-color: rgba(244, 162, 97, .34); font-size: 10px; font-weight: 850; }

.floating-reaction {
  position: absolute;
  bottom: 34px;
  z-index: 20;
  pointer-events: none;
  font-size: 34px;
  animation: reactionFloat 1.8s ease-out both;
}

@keyframes reactionFloat {
  from { opacity: 0; transform: translateY(10px) scale(.7); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translateY(-190px) scale(1.12); }
}

.message-form {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 74px;
  gap: 7px;
}

.message-form input,
.question-form textarea,
.summary-editor textarea,
.archive-search input,
.class-dialog input,
.class-dialog textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-dark);
  background: var(--ui-bg);
  outline: none;
}

.message-form input,
.archive-search input,
.class-dialog input { min-height: 44px; padding: 8px 12px; }
.message-form button,
.question-form button,
.host-actions button,
.assistant-actions button,
.archive-search button,
.dialog-actions button { border: 1px solid var(--border-color); border-radius: 7px; color: var(--btn-text); background: var(--sage-main); cursor: pointer; font-size: 10px; font-weight: 900; }
.message-form .attach-button { color: var(--text-dark); background: var(--ui-bg); font-size: 18px; }

.question-form { display: grid; gap: 7px; }
.question-form textarea { min-height: 96px; padding: 10px; resize: vertical; }
.question-form button { min-height: 40px; }

.question-card {
  padding: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--ui-bg);
}

.question-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--warm-accent); background: rgba(244, 162, 97, .1); font-size: 10px; font-weight: 900; }
.question-card div:last-child { min-width: 0; display: grid; gap: 4px; }
.question-card strong { font-size: 10px; overflow-wrap: anywhere; }
.question-card small { color: var(--text-muted); font-size: 8px; }

.activity-options {
  margin-top: 5px;
  display: grid;
  gap: 5px;
}

.activity-options button {
  min-height: 33px;
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  background: var(--ui-bg);
  text-align: right;
  cursor: pointer;
  font-size: 9px;
}

.activity-options button:hover,
.activity-options button.active {
  color: var(--warm-accent);
  border-color: rgba(244, 162, 97, .38);
  background: rgba(244, 162, 97, .08);
}

.host-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.host-actions button { min-height: 40px; color: var(--text-dark); background: var(--ui-bg); }

.assistant-layout,
.resources-layout,
.students-layout,
.archive-layout {
  width: min(1200px, 100%);
  min-height: calc(100dvh - 176px);
  margin-inline: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.assistant-hero {
  min-height: 220px;
  padding: 28px;
  display: grid;
  align-content: center;
  justify-items: start;
  border-block: 1px solid var(--border-color);
  background: linear-gradient(90deg, rgba(156, 179, 158, .08), transparent 56%, rgba(244, 162, 97, .06));
}

.assistant-kicker { color: var(--warm-accent); font-size: 10px; font-weight: 900; }
.assistant-hero h2 { margin: 8px 0; font-size: 34px; font-weight: 950; }
.assistant-hero p { max-width: 680px; margin: 0; color: var(--text-muted); line-height: 2; }
.assistant-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-actions button { min-height: 42px; padding: 8px 14px; }
.assistant-actions button:last-child { color: var(--text-dark); background: var(--ui-bg); }
.assistant-actions button:disabled { opacity: .45; cursor: not-allowed; }

.insight-grid,
.resource-grid,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.insight-grid article,
.resource-card,
.archive-card,
.recording-item,
.student-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--card-shadow);
}

.insight-grid article { min-height: 140px; display: grid; align-content: start; gap: 8px; }
.insight-grid span { color: var(--warm-accent); font-size: 9px; font-weight: 850; }
.insight-grid strong { font-size: 15px; }
.insight-grid p { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.9; }

.summary-editor,
.transcript-panel { padding: 14px; display: grid; gap: 12px; }
.summary-editor textarea { min-height: 230px; padding: 14px; resize: vertical; line-height: 2; }

.transcript-item { padding: 10px 12px; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; border-right: 2px solid var(--warm-accent); background: var(--ui-bg); }
.transcript-item time { color: var(--warm-accent); font-size: 9px; font-weight: 900; }
.transcript-item p { margin: 0; font-size: 10px; line-height: 1.9; }

.drop-zone {
  position: relative;
  min-height: 230px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px dashed rgba(244, 162, 97, .38);
  border-radius: 8px;
  text-align: center;
  background: rgba(244, 162, 97, .035);
  cursor: pointer;
}

.drop-zone.dragging { border-style: solid; background: rgba(244, 162, 97, .09); }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; color: var(--warm-accent); background: rgba(244, 162, 97, .1); font-size: 25px; }
.drop-zone strong { font-size: 16px; }
.drop-zone small { color: var(--text-muted); font-size: 10px; }
.drop-zone button { margin-top: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: 7px; color: var(--text-dark); background: var(--ui-bg); pointer-events: none; }

.upload-progress { display: grid; gap: 5px; }
.upload-progress > span { height: 8px; overflow: hidden; border-radius: 6px; background: var(--ui-bg); }
.upload-progress i { display: block; width: 0; height: 100%; background: var(--warm-accent); transition: width .18s ease; }
.upload-progress small { color: var(--text-muted); font-size: 9px; }

.resource-card { min-height: 150px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: start; gap: 10px; }
.resource-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 7px; color: var(--warm-accent); background: rgba(244, 162, 97, .1); font-size: 11px; font-weight: 950; }
.resource-card > div:last-child { min-width: 0; display: grid; align-content: start; gap: 5px; }
.resource-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.resource-card small { color: var(--text-muted); font-size: 9px; }
.resource-card a { width: fit-content; margin-top: 5px; color: var(--warm-accent); font-size: 9px; font-weight: 850; text-decoration: none; }

.student-filters,
.status-broadcast { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.student-filters button,
.status-broadcast button { min-height: 32px; padding: 5px 9px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-muted); background: var(--ui-bg); cursor: pointer; white-space: nowrap; font-size: 9px; font-weight: 800; }
.student-filters button.active,
.status-broadcast button.active { color: var(--warm-accent); border-color: rgba(244, 162, 97, .34); background: rgba(244, 162, 97, .08); }
.status-broadcast { padding: 10px; border-block: 1px solid var(--border-color); }
.status-broadcast > span { color: var(--text-muted); font-size: 9px; white-space: nowrap; }

.attendance-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.attendance-strip article { min-height: 84px; align-content: center; }
.attendance-strip strong { font-size: 20px; }

.student-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.student-card { min-height: 142px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-content: start; gap: 10px; }
.student-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #171006; background: var(--warm-accent); font-size: 13px; font-weight: 950; }
.student-card > div:last-child { min-width: 0; display: grid; align-content: start; gap: 4px; }
.student-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.student-card small { color: var(--text-muted); font-size: 8px; }
.student-state { width: fit-content; padding: 3px 6px; border-radius: 5px; color: var(--success); background: rgba(158, 224, 174, .1); font-size: 8px; font-weight: 850; }
.student-state.warn { color: var(--warm-accent); background: rgba(244, 162, 97, .1); }
.student-network { height: 5px; overflow: hidden; border-radius: 4px; background: var(--ui-bg); }
.student-network i { display: block; width: var(--network, 90%); height: 100%; background: var(--sage-main); }

.archive-search { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
.archive-search button { min-height: 44px; }
.search-results { padding: 12px; display: grid; gap: 7px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); }
.search-result { padding: 9px; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--ui-bg); cursor: pointer; }
.search-result span { color: var(--warm-accent); font-size: 9px; font-weight: 900; }
.search-result div { min-width: 0; display: grid; gap: 2px; }
.search-result strong { font-size: 10px; }
.search-result small { overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.archive-card { min-height: 170px; display: grid; align-content: start; gap: 8px; }
.archive-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-card time { color: var(--warm-accent); font-size: 9px; font-weight: 850; }
.archive-card strong { font-size: 12px; }
.archive-card p { margin: 0; color: var(--text-muted); font-size: 9px; line-height: 1.8; }
.archive-stats { margin-top: auto; display: flex; gap: 6px; }
.archive-stats span { padding: 4px 6px; border-radius: 5px; color: var(--text-muted); background: var(--ui-bg); font-size: 8px; }

.recording-list { display: grid; gap: 8px; }
.recording-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.recording-play { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; color: #171006; background: var(--warm-accent); }
.recording-item div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.recording-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.recording-item small { color: var(--text-muted); font-size: 8px; }
.recording-item a { padding: 6px 9px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-dark); text-decoration: none; font-size: 9px; }

.class-controls {
  position: fixed;
  right: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
  width: min(760px, calc(100% - 32px));
  min-height: 62px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--nav-bg) 95%, transparent);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .42);
  transform: translateX(50%);
  backdrop-filter: blur(20px) saturate(130%);
}

.control-button {
  min-width: 0;
  min-height: 48px;
  padding: 5px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.control-button:hover { color: var(--text-dark); background: var(--ui-bg); }
.control-button.active { color: var(--success); background: rgba(158, 224, 174, .08); }
.control-button.priority { color: var(--warm-accent); border-color: rgba(244, 162, 97, .22); background: rgba(244, 162, 97, .07); }
.control-button.leave { color: var(--danger); background: rgba(255, 143, 143, .08); }
.control-button span { font-size: 16px; line-height: 1; }
.control-button small { overflow: hidden; max-width: 100%; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.toast-region {
  position: fixed;
  top: 78px;
  left: 14px;
  z-index: 200;
  width: min(340px, calc(100% - 28px));
  display: grid;
  gap: 7px;
  pointer-events: none;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-dark);
  background: color-mix(in srgb, var(--nav-bg) 96%, #000 4%);
  box-shadow: var(--card-shadow);
  font-size: 10px;
  line-height: 1.8;
  animation: toastIn .2s ease both;
  backdrop-filter: blur(16px);
}
.toast.success { border-color: rgba(158, 224, 174, .3); }
.toast.warn { border-color: rgba(244, 162, 97, .35); }
.toast.error { border-color: rgba(255, 143, 143, .35); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-8px); } }

.class-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-dark);
  background: var(--bg-page);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .58);
}
.class-dialog::backdrop { background: rgba(0, 0, 0, .64); backdrop-filter: blur(5px); }
.class-dialog form { padding: 18px; display: grid; gap: 13px; }
.dialog-head > button { width: 34px; height: 34px; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-dark); background: var(--ui-bg); cursor: pointer; }
.class-dialog label { display: grid; gap: 6px; }
.class-dialog label > span { color: var(--text-muted); font-size: 10px; }
.class-dialog textarea { min-height: 120px; padding: 10px; resize: vertical; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-actions button { min-height: 42px; }
.dialog-actions .secondary { color: var(--text-dark); background: var(--ui-bg); }

.host-only[hidden] { display: none !important; }

@media (max-width: 1100px) {
  .video-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .communication-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .student-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .live-page { overflow: auto; }
  .live-app {
    min-height: 100dvh;
    display: block;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
  .live-topbar {
    position: sticky;
    top: 0;
    min-height: 62px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 8px 10px;
    gap: 9px;
  }
  .live-brand { width: auto; }
  .live-brand > span:last-child { display: none; }
  .session-identity { justify-self: stretch; justify-content: flex-start; text-align: right; }
  .session-clock,
  .quality-pill { display: none; }
  .quality-popover { position: fixed; top: 70px; left: 10px; }
  .workspace-nav {
    position: sticky;
    top: 62px;
    z-index: 70;
    padding: 7px 8px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--border-color);
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .workspace-tab { min-width: 82px; min-height: 56px; padding: 5px 7px; }
  .workspace-tab > span { font-size: 17px; }
  .workspace-tab small { display: none; }
  .workspace-stage { min-height: 0; overflow: visible; }
  .workspace { min-height: 0; padding: 10px; }
  .video-layout,
  .communication-layout { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .media-stage { min-height: 56svh; }
  .lesson-rail { min-height: 460px; }
  .board-shell { min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(58svh, 1fr) auto; }
  .board-toolbar { grid-row: auto; display: flex; overflow-x: auto; }
  .board-toolbar button,
  .board-color { min-width: 58px; min-height: 48px; }
  .board-canvas-wrap { min-height: 58svh; }
  .assistant-layout,
  .resources-layout,
  .students-layout,
  .archive-layout { min-height: 0; }
  .student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-controls {
    right: 8px;
    left: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 68px;
    grid-template-columns: repeat(7, minmax(58px, 1fr));
    overflow-x: auto;
    transform: none;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .class-controls::-webkit-scrollbar { display: none; }
  .control-button { min-width: 58px; }
}

@media (max-width: 620px) {
  .brand-mark { width: 34px; height: 34px; }
  .session-identity small { display: none; }
  .top-exit { display: none; }
  .media-stage { min-height: 58svh; }
  .media-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(180px, 1fr); }
  .media-grid:has(.media-tile:nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-tile.is-screen { grid-column: 1 / -1; min-height: 52svh; }
  .stage-hud-top { top: 8px; right: 8px; left: 8px; }
  .hud-chip:nth-child(2) { display: none; }
  .join-class-button { bottom: 18px; min-width: min(240px, calc(100% - 32px)); }
  .lesson-snapshot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .assistant-hero { padding: 22px 14px; }
  .assistant-hero h2 { font-size: 26px; }
  .insight-grid,
  .resource-grid,
  .archive-grid,
  .attendance-strip,
  .student-grid { grid-template-columns: minmax(0, 1fr); }
  .attendance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message { max-width: 94%; }
  .message-form { grid-template-columns: 38px minmax(0, 1fr) 62px; }
  .reaction-row .confusion-button { margin-right: 0; }
  .board-filebar { align-items: stretch; flex-direction: column; }
  .board-filebar > * { text-align: center; }
  .archive-search { grid-template-columns: minmax(0, 1fr); }
  .recording-item { grid-template-columns: 42px minmax(0, 1fr); }
  .recording-item a { grid-column: 1 / -1; text-align: center; }
  .toast-region { top: 126px; }
}

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

/* Class chrome refinement - whiteboard intentionally excluded. */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon .icon-fill {
  fill: currentColor;
  stroke: none;
}

.live-app {
  grid-template-columns: 124px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
}

.live-topbar {
  min-height: 72px;
  grid-template-columns: 218px minmax(0, 1fr) auto;
  padding: 10px 14px;
  box-shadow: 0 8px 28px rgba(18, 29, 22, .05);
}

.live-brand {
  gap: 9px;
}

.brand-mark {
  width: 126px;
  height: 44px;
  padding: 3px 6px;
  overflow: hidden;
  border-color: rgba(29, 37, 32, .1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 30, 25, .1);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.live-brand-copy strong {
  font-size: 12px;
}

.live-brand-copy small {
  font-size: 9px;
}

.top-icon {
  width: 40px;
  height: 40px;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.top-icon:hover {
  color: var(--warm-accent);
  border-color: rgba(244, 162, 97, .32);
  background: rgba(244, 162, 97, .08);
  transform: translateY(-1px);
}

.theme-glyph {
  display: none;
  width: 19px;
  height: 19px;
}

:root:not([data-theme="dark"]) .theme-glyph-moon,
:root[data-theme="dark"] .theme-glyph-sun {
  display: block;
}

.workspace-nav {
  padding: 12px 9px;
  gap: 8px;
  border-left-color: color-mix(in srgb, var(--border-color) 84%, var(--warm-accent) 16%);
  box-shadow: -8px 0 24px rgba(13, 21, 16, .035);
}

.workspace-tab {
  min-height: 76px;
  padding: 8px 5px;
  gap: 3px;
}

.workspace-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--ui-bg);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.workspace-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.workspace-tab:hover .workspace-icon {
  border-color: rgba(156, 179, 158, .34);
  transform: translateY(-1px);
}

.workspace-tab.active .workspace-icon {
  border-color: rgba(244, 162, 97, .38);
  background: rgba(244, 162, 97, .12);
  box-shadow: 0 8px 22px rgba(244, 162, 97, .1);
}

.workspace-tab strong {
  font-size: 12px;
  line-height: 1.45;
}

.workspace-tab small {
  font-size: 9px;
  line-height: 1.4;
}

.class-controls {
  width: min(790px, calc(100% - 32px));
  min-height: 72px;
  padding: 7px;
  display: flex;
  align-items: stretch;
  gap: 6px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .05);
}

.control-button {
  min-width: 0;
  min-height: 56px;
  flex: 1 1 0;
  padding: 5px 3px;
  gap: 3px;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.control-button:hover {
  transform: translateY(-1px);
}

.control-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-bg) 88%, transparent);
}

.control-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.control-button.active .control-icon {
  border-color: rgba(158, 224, 174, .3);
  background: rgba(158, 224, 174, .1);
}

.control-button.priority .control-icon {
  border-color: rgba(244, 162, 97, .34);
  background: rgba(244, 162, 97, .11);
}

.control-button.leave .control-icon {
  border-color: rgba(255, 143, 143, .28);
  background: rgba(255, 143, 143, .1);
}

.control-button span {
  font-size: inherit;
}

.control-button small {
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .live-app {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .live-topbar {
    min-height: 68px;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

  .brand-mark {
    width: 100px;
    height: 38px;
    padding: 3px 4px;
  }

  .live-brand-copy {
    display: none;
  }

  .workspace-nav {
    top: 68px;
    padding: 8px;
    gap: 7px;
    background: color-mix(in srgb, var(--nav-bg) 94%, transparent);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
  }

  .workspace-tab {
    min-width: 92px;
    min-height: 64px;
    padding: 6px 7px;
  }

  .workspace-icon {
    width: 30px;
    height: 30px;
  }

  .workspace-icon .ui-icon {
    width: 18px;
    height: 18px;
  }

  .workspace-tab strong {
    font-size: 12px;
  }

  .class-controls {
    right: 8px;
    left: 8px;
    width: auto;
    min-height: 76px;
    padding: 6px;
    gap: 3px;
    overflow: hidden;
  }

  .control-button {
    min-width: 0;
    min-height: 62px;
  }

  .control-button small {
    font-size: 9.5px;
  }
}

@media (max-width: 420px) {
  .live-topbar {
    grid-template-columns: 92px minmax(0, 1fr) 38px;
    gap: 7px;
    padding-inline: 8px;
  }

  .brand-mark {
    width: 90px;
    height: 36px;
  }

  .session-identity {
    gap: 7px;
  }

  .session-identity strong {
    font-size: 12px;
  }

  .top-status {
    gap: 0;
  }

  .top-icon {
    width: 38px;
    height: 38px;
  }

  .class-controls {
    right: 4px;
    left: 4px;
    padding: 5px 3px;
    gap: 2px;
  }

  .control-icon {
    width: 28px;
    height: 28px;
  }

  .control-icon .ui-icon {
    width: 19px;
    height: 19px;
  }

  .control-button small {
    font-size: 9px;
  }
}

@media (max-width: 900px) {
  .board-toolbar {
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .board-toolbar::-webkit-scrollbar { display: none; }
  .board-shell { grid-template-rows: auto auto minmax(440px, 1fr); }
  .board-toolbar { grid-row: 1; }
  .board-filebar {
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 7px;
    margin-bottom: 0;
    overflow: hidden;
  }
  .board-canvas-wrap {
    grid-row: 3;
    min-height: max(420px, calc(100svh - 396px));
  }
  .board-file-actions {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .board-file-actions::-webkit-scrollbar { display: none; }
  .board-file-actions > * { min-width: 126px; min-height: 42px; }
  #boardExportBtn {
    width: 44px;
    min-width: 44px;
    min-height: 42px;
    padding: 0;
  }
  #boardExportBtn span { display: none; }
  .board-upload-flow { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .board-canvas-wrap { min-height: max(420px, calc(100svh - 396px)); }
  .board-filebar { padding: 9px; }
  .board-file-actions {
    width: 100%;
    display: flex;
    gap: 7px;
  }

  .board-file-actions > * {
    width: auto;
    min-width: 126px;
    min-height: 43px;
  }
  #boardExportBtn { width: 44px; min-width: 44px; }

  .board-filebar button span,
  .board-filebar .file-action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-upload-flow { text-align: initial; }
  .board-upload-steps { gap: 3px; }
  .board-upload-steps span { padding-inline: 2px; font-size: 6.5px; }
  .board-permission-banner {
    top: 8px;
    padding: 7px;
    align-items: stretch;
  }
  .board-permission-banner > div { min-width: 0; }
  .board-permission-banner small { max-width: 180px; }
  .board-permission-banner button { max-width: 112px; }
  .board-edit-guide { top: auto; right: 8px; bottom: 44px; left: auto; }
  .board-status { left: 8px; bottom: 8px; }
  .board-object-tools { top: -38px; }
  .math-symbols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .math-preview { min-height: 92px; font-size: 18px; }
  .board-access-row { grid-template-columns: 36px minmax(0, 1fr); }
  .board-access-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-access-actions button { width: 100%; }
}

@media (max-width: 360px) {
  .board-permission-banner small { display: none; }
  .board-permission-banner button { max-width: 104px; padding-inline: 7px; }
}

@media (max-height: 620px) {
  .math-dialog {
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }
  .math-dialog form { padding: 11px; gap: 7px; }
  .math-dialog .dialog-head > button { width: 32px; height: 32px; }
  .math-preview { min-height: 70px; padding: 8px; font-size: 17px; }
  .math-dialog textarea { min-height: 82px; }
  .math-symbols { gap: 4px; }
  .math-symbols button { min-height: 31px; padding: 3px; }
  .math-dialog .dialog-actions button { min-height: 36px; }
}
