@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');
:root {
  --green: #22c55e; --green-dark: #16a34a; --ink: #102117; --muted: #5f6f66;
  --line: #e3eee6; --bg: #f4faf6; --danger: #ef4444;
  --shadow: 0 18px 50px rgba(16, 64, 32, 0.08);
}
* { box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; font-family: Outfit, Inter, system-ui, sans-serif; color: var(--ink); }
body.portal {
  min-height: 100vh;
  background: radial-gradient(900px 420px at 10% -10%, rgba(34,197,94,.18), transparent 60%), var(--bg);
}
a { color: var(--green-dark); text-decoration: none; }
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(34,197,94,.12);
  position: sticky; top: 0; z-index: 5;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.35rem; letter-spacing: -.04em; }
.logo-plain { gap: 0; background: none; box-shadow: none; }
.logo-img { height: 42px; width: auto; max-width: 168px; object-fit: contain; display: block; background: none; border: 0; box-shadow: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--green), var(--green-dark)); box-shadow: 0 8px 18px rgba(34,197,94,.35);
}
.logo-preview { min-height: 42px; display: flex; align-items: center; background: none; }
.favicon-preview { width: 32px; height: 32px; object-fit: contain; background: none; }
.admin-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.admin-tab.active { background: #dcfce7; color: #166534; border-color: transparent; }
.api-catalog { display: flex; flex-direction: column; gap: 18px; }
.api-group h3 { margin: 0 0 4px; font-size: 1.05rem; }
.api-group .lede { margin: 0 0 8px; }
.api-table { width: 100%; border-collapse: collapse; }
.api-table th, .api-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
.api-method { font-weight: 800; font-size: .72rem; letter-spacing: .04em; }
.api-method.get { color: #166534; }
.api-method.post { color: #1d4ed8; }
.api-method.put { color: #b45309; }
.api-method.delete { color: #b91c1c; }
.api-path { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; word-break: break-all; }
.join-admin, .settings-grid { display: grid; gap: 14px; }
.settings-grid { grid-template-columns: 1fr 1fr; align-items: start; }
.settings-grid > div { display: flex; flex-direction: column; gap: 14px; }
.top-link, .who { color: var(--ink); font-weight: 600; }
.top-link { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); cursor: pointer; font: inherit; }
.icon-logout { display: inline-flex; align-items: center; gap: 8px; }
.icon-logout i { font-size: 1.05rem; line-height: 1; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.hero, .lobby { display: flex; justify-content: center; gap: 24px; padding: 48px 20px 64px; align-items: stretch; }
.join-card, .side-card, .panel { background: #fff; border: 1px solid rgba(34,197,94,.14); border-radius: 24px; box-shadow: var(--shadow); }
.join-card { width: min(460px, 100%); padding: 32px 28px; }
.admin { width: min(980px, calc(100% - 32px)); margin: 28px auto 56px; }
.panel { padding: 22px; margin-bottom: 18px; }
h1 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.04em; }
h2 { margin: 0 0 8px; }
.lede, .hint, .sub { color: var(--muted); }
.lede { margin: 0 0 16px; line-height: 1.5; }
.stack, .create-grid { display: flex; flex-direction: column; gap: 14px; }
.create-grid { display: grid; grid-template-columns: 1fr 1fr; }
label span { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #3d5c49; }
label { display: flex; flex-direction: column; gap: 6px; }
input, textarea {
  width: 100%; border: 1px solid #d7e7dc; border-radius: 14px; padding: 13px 14px; font: inherit; color: var(--ink); background: #fbfefc;
}
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(34,197,94,.16); }
.btn-primary, .btn-ghost, .btn-small { border: 0; cursor: pointer; font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; border-radius: 14px; padding: 13px 16px; box-shadow: 0 10px 24px rgba(34,197,94,.28); }
.btn-ghost { background: #fff; color: #052e16; border: 1px solid rgba(34,197,94,.35); border-radius: 14px; padding: 11px 14px; }
.btn-small { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: .8rem; }
.btn-small.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-small.danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.alert-error { background: #fef2f2; color: #9f1239; }
.check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 600; }
.check input { width: auto; accent-color: var(--green); }
.home-actions, .join-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.join-inline { margin-left: auto; }
.join-inline input { width: 180px; }
.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meet-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.meet-row strong { display: block; }
.pill { font-size: .72rem; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; }
.pill-live, .pill-active { background: #dcfce7; color: #166534; }
.pill-scheduled { background: #ecfdf3; color: #15803d; }
.pill-ended, .pill-off { background: #f4f4f5; color: #52525b; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.preview-wrap { width: min(680px, 100%); background: #0f1f16; border-radius: 28px; min-height: 420px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.preview-wrap video { width: 100%; height: 100%; min-height: 420px; object-fit: cover; transform: scaleX(-1); background: #102117; }
.preview-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #fff; font-size: 3rem; }
.preview-wrap.cam-off video { opacity: 0; }
.preview-wrap.cam-off .preview-fallback { display: flex; }
.preview-controls { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 12px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; background: #fff; color: #052e16; font-size: 1.15rem; }
.round.off { background: var(--danger); color: #fff; }

body.room-body { background: #eef6f1; overflow: hidden; }
#app {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; color: var(--ink);
  background: radial-gradient(700px 240px at 50% -40px, rgba(34,197,94,.16), transparent 70%), #eef6f1;
}
.room-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(34,197,94,.12); gap: 12px; }
.sound-unlock {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px 12px 0; border: 0; border-radius: 999px; padding: 10px 14px;
  background: #16a34a; color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.room-id, .room-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
#roomTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.code-btn, .text-btn, .icon-btn, .nav-icon { background: #f4faf6; color: var(--ink); border: 1px solid var(--line); cursor: pointer; font: inherit; border-radius: 999px; padding: 6px 10px; }
.nav-icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 1.05rem; }
.nav-leave { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.timer, .count { color: var(--muted); font-weight: 600; }
.room-main { flex: 1; min-height: 0; display: flex; }
.stage { flex: 1; min-width: 0; min-height: 0; position: relative; }
.view-pager { height: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.view-pager::-webkit-scrollbar { display: none; }
.view-page { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; min-width: 100%; }
.host-stage { position: absolute; inset: 12px 12px 18px; }
.host-stage .tile { width: 100%; height: 100%; }
.self-pip { position: absolute; top: 22px; right: 22px; width: 168px; height: 112px; z-index: 4; filter: drop-shadow(0 12px 24px rgba(16,33,23,.28)); }
.self-pip .tile { width: 100%; height: 100%; border-radius: 16px; border: 2px solid #fff; }
.slide-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 4;
  border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: .78rem;
  background: rgba(255,255,255,.92); color: #052e16; border-radius: 999px; padding: 8px 14px;
  box-shadow: 0 8px 20px rgba(16,33,23,.12);
}
.all-head { padding: 14px 16px 0; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #3d5c49; }
.view-all { display: flex; flex-direction: column; min-height: 0; }
.view-all .gallery { flex: 1; }
.tile-tray { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.gallery { height: 100%; display: grid; gap: 12px; padding: 14px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(140px, 1fr); }
.gallery[data-n="2"] { --cols: 2; }
.gallery[data-n="3"], .gallery[data-n="4"] { --cols: 2; }
.gallery[data-n="5"], .gallery[data-n="6"], .gallery[data-n="7"], .gallery[data-n="8"], .gallery[data-n="9"] { --cols: 3; }
.tile { position: relative; background: #fff; border-radius: 20px; overflow: hidden; min-height: 0; border: 1px solid rgba(34,197,94,.12); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #dfeee4; }
.tile.local video.cam { transform: scaleX(-1); }
.tile.cam-off video, .tile.no-cam video { opacity: 0; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--green); }
.avatar { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: #fff; }
.tile.cam-off .avatar, .tile.no-cam .avatar { display: flex; }
.nameplate { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); background: rgba(255,255,255,.92); border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 700; }
.nameplate .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nameplate .mic-ico { color: var(--green-dark); }
.stage { overflow: hidden; }
.share-layout {
  position: absolute; inset: 0; z-index: 6; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 168px; grid-template-rows: minmax(0, 1fr);
  gap: 12px; padding: 12px; background: #eef6f1;
}
.share-layout.content-only {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: 8px;
}
.share-layout.content-only .filmstrip,
.share-layout.content-only .share-label { display: none !important; }
.share-stage { position: relative; min-height: 0; height: 100%; background: #0f1f16; border-radius: 20px; overflow: hidden; }
.share-stage video, .share-stage img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; max-width: none; object-fit: contain; background: #0f1f16; }
.pdf-stage {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; background: #eef2f7;
}
.pdf-scroll { flex: 1; min-height: 0; overflow: hidden; padding: 8px; display: flex; align-items: center; justify-content: center; }
.pdf-scroll canvas { display: block; margin: auto; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.pdf-loading {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  background: rgba(15, 31, 22, .72); color: #fff;
}
.pdf-loading[hidden] { display: none !important; }
.pdf-loading-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 26px; border-radius: 18px; background: rgba(255,255,255,.96);
  color: #14532d; box-shadow: 0 16px 40px rgba(0,0,0,.22); min-width: 180px; text-align: center;
}
.pdf-loading-inner .spinner { margin: 0 auto; }
.pdf-loading-inner strong { font-size: .95rem; letter-spacing: .01em; }
.pdf-loading-inner span { font-size: .78rem; color: #5f6f66; font-weight: 600; }
.pdf-bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(15,31,22,.92); color: #fff;
}
.pdf-stage.viewer-only .pdf-bar { display: none !important; }
.pdf-stage.viewer-only .pdf-scroll { padding: 0; }
.pdf-nav {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff;
  cursor: pointer; display: grid; place-items: center; font-size: 1.1rem;
}
.pdf-nav:disabled { opacity: .35; cursor: default; }
#pdfPageLabel { font-size: .82rem; font-weight: 700; min-width: 72px; text-align: center; }
.board-wrap {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: #15251c; touch-action: none; overflow: hidden;
}
.board-wrap canvas {
  touch-action: none; display: block; background: #fff;
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.28);
  cursor: crosshair; max-width: 100%; max-height: 100%;
}
.board-wrap.view-only canvas { cursor: default; }
.share-layout.board-on .share-label { display: none; }
.share-layout.board-on { padding: 0 !important; gap: 0; background: #fff; }
.share-layout.board-on .share-stage { border-radius: 0; background: #fff; }
.share-layout.board-on .board-wrap { background: #fff; }
.share-layout.board-on .board-wrap canvas { border-radius: 0; box-shadow: none; max-width: none; max-height: none; }
.board-tools {
  position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 10px 24px rgba(16,64,32,.12);
}
.board-swatch, .board-tool {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; display: grid; place-items: center; padding: 0; font: inherit;
}
.board-swatch { border-width: 2px; }
.board-swatch.on, .board-tool.on { outline: 2px solid var(--green); outline-offset: 1px; }
.board-swatch[data-color="#111827"] { background: #111827; }
.board-swatch[data-color="#dc2626"] { background: #dc2626; }
.board-swatch[data-color="#2563eb"] { background: #2563eb; }
.board-swatch[data-color="#16a34a"] { background: #16a34a; }
.ctrl-wrap { position: relative; }
.board-menu { display: none !important; }
.board-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; color: #fff;
  font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.board-menu button:hover, .board-menu button:focus { background: rgba(255,255,255,.12); }
.stop-image { position: absolute; top: 12px; right: 12px; z-index: 2; background: #fff; }
.person-actions { display: flex; gap: 6px; align-items: center; }
.person-actions .cohost-btn { width: auto; padding: 0 10px; font-size: .72rem; font-weight: 800; }
.share-label { position: absolute; left: 12px; bottom: 12px; background: #fff; border-radius: 999px; padding: 5px 10px; font-size: .75rem; font-weight: 700; }
.filmstrip {
  display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.filmstrip .tile { min-height: 96px; height: 96px; flex: 0 0 96px; }
.side { width: min(340px, 100%); background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-tabs { display: flex; align-items: center; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; color: var(--muted); border: 0; font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.tab.active { background: #ecfdf3; color: #052e16; }
.icon-btn { margin-left: auto; width: 34px; height: 34px; padding: 0; }
.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.host-tools, .waiting-box { padding: 10px 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.host-tools button, .admit { border: 0; border-radius: 999px; background: #ecfdf3; color: #052e16; padding: 7px 10px; cursor: pointer; font: inherit; font-size: .75rem; font-weight: 700; }
.waiting-title { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--green-dark); margin-bottom: 6px; }
.person, .wait-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.person-name { font-weight: 700; }
.person-meta { color: var(--muted); font-size: .72rem; }
.person-actions button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.people-list, .chat-log { overflow: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.chat-log { padding: 12px; }
.chat-msg { margin-bottom: 12px; }
.chat-msg b { display: block; color: var(--green-dark); font-size: .75rem; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form button { width: 44px; border: 0; border-radius: 14px; background: var(--green); color: #fff; cursor: pointer; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .68rem; }
.dock {
  display: flex; justify-content: flex-start; align-items: flex-end; gap: 6px; margin: 0 auto 14px; padding: 10px 14px;
  width: max-content; max-width: calc(100% - 24px);
  overflow: visible;
  background: #fff; border: 1px solid rgba(34,197,94,.14); border-radius: 24px; box-shadow: var(--shadow);
  position: relative; z-index: 10;
}
.ctrl { background: transparent; border: 0; color: var(--ink); cursor: pointer; font: inherit; width: 78px; }
.ctrl .bubble { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; background: #f3f7f4; display: grid; place-items: center; border: 1px solid var(--line); }
.ctrl small { display: block; margin-top: 4px; font-size: .68rem; color: var(--muted); }
.ctrl.off .bubble { background: #fef2f2; color: var(--danger); }
.ctrl.on .bubble { background: #dcfce7; color: #052e16; }
.leave { margin-left: 8px; align-self: center; background: var(--danger); color: #fff; border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 800; cursor: pointer; }
.hold { position: fixed; inset: 0; z-index: 20; background: #f4faf6; display: flex; align-items: center; justify-content: center; padding: 24px; }
.hold-card { text-align: center; max-width: 440px; background: #fff; border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow); }
.hold-card p { color: var(--muted); }
.spinner { width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; border: 3px solid #dcfce7; border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal { position: fixed; inset: 0; background: rgba(16,33,23,.35); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(460px, 100%); background: #fff; border-radius: 22px; padding: 22px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--dock-space, 96px) + 14px);
  width: max-content; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: rgba(255,255,255,.96); color: var(--ink); border: 1px solid rgba(34,197,94,.22);
  border-radius: 14px; padding: 10px 14px; font-size: .9rem; font-weight: 600; line-height: 1.3;
  box-shadow: 0 12px 30px rgba(16,64,32,.16); backdrop-filter: blur(10px);
  animation: toastIn .18s ease-out; transition: opacity .3s, transform .3s;
}
.toast i { color: var(--green-dark); font-size: 1rem; flex: 0 0 auto; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hand-emoji {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1;
  transform-origin: 70% 80%;
}
.ctrl.on .hand-emoji,
.hand-ico,
.hand-alert .hand-emoji {
  animation: handWave .7s ease-in-out infinite;
}
@keyframes handWave {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(22deg) scale(1.08); }
  50% { transform: rotate(-12deg) scale(1); }
  75% { transform: rotate(16deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}
.nameplate .hand-ico { font-size: 1rem; }
#handAlerts {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.hand-alert {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.97);
  color: var(--ink);
  border: 1px solid rgba(34,197,94,.28);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  box-shadow: 0 14px 32px rgba(16,64,32,.18);
  animation: toastIn .2s ease-out;
  cursor: pointer;
}
.hand-alert strong { display: block; font-size: .9rem; font-weight: 800; line-height: 1.1; }
.hand-alert span:not(.hand-emoji) { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.hand-alert.out { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
body.room-body.content-fs #handAlerts { top: calc(8px + env(safe-area-inset-top, 0px)); }
.home { width: min(1120px, calc(100% - 48px)); margin: 28px auto 64px; }
.home .panel { margin-bottom: 0; }
.home-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.home-intro h1 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 2.6rem); }
.home-intro .lede { margin: 0; max-width: 46ch; }
.eyebrow, .panel-kicker { margin: 0 0 6px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--green-dark); }
.start-btn {
  border: 0; cursor: pointer; color: #fff; font: inherit; font-weight: 800; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 16px 22px; border-radius: 16px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 14px 28px rgba(22, 163, 74, .28);
}
.start-btn:hover { filter: brightness(1.03); }
.start-btn:disabled { opacity: .7; cursor: wait; }
.home-tools { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.tool-card h2, .list-head h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.03em; }
.join-row { display: flex; gap: 10px; }
.join-row input { flex: 1; min-width: 0; }
.join-row .btn-primary { flex: 0 0 auto; }
.sched-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(140px, .8fr) auto; gap: 12px; align-items: end; }
.sched-grid .btn-primary { height: 48px; padding-inline: 18px; white-space: nowrap; }
.option-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  flex-direction: row; align-items: center; gap: 8px; width: auto;
  border: 1px solid #d7e7dc; background: #f7fbf8; border-radius: 999px;
  padding: 8px 12px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip span { font-size: .86rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.chip input { width: auto; accent-color: var(--green); }
.user-pill { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.avatar-dot, .meet-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: #dcfce7; color: #166534; font-weight: 800;
}
.list-head { margin-bottom: 4px; }
.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meet-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: #f7fbf8; border: 1px solid #e5f3ea;
}
.meet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-note { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
#joinUrl { width: 100%; margin-bottom: 10px; }
.meet-mark { width: 44px; height: 44px; border-radius: 14px; }
@media (max-width: 980px) {
  .home-tools { grid-template-columns: 1fr; }
  .sched-grid { grid-template-columns: 1fr 1fr; }
  .sched-grid .btn-primary { grid-column: 1 / -1; height: auto; }
}
.meet-copy { min-width: 0; }
.meet-copy strong, .meet-copy .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; }
.pill-live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(22,163,74,.55); animation: livepulse 1.6s infinite;
}
@keyframes livepulse { 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.empty-meet { text-align: center; color: var(--muted); padding: 36px 12px 18px; }
body.auth-body {
  min-height: 100vh;
  background: #f3faf6;
}
.auth-stage { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 36px 48px 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background:
    radial-gradient(520px 280px at 12% 0%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(420px 320px at 90% 100%, rgba(5,46,22,.45), transparent 55%),
    linear-gradient(160deg, #4ade80 0%, #16a34a 42%, #14532d 100%);
}
.auth-art::after {
  content: ""; position: absolute; width: 280px; height: 280px; right: -80px; top: 18%;
  border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none;
}
.logo.light { color: #fff; position: relative; z-index: 1; }
.art-copy, .float-board, .art-points { position: relative; z-index: 1; }
.art-kicker { margin: 0 0 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .75rem; color: rgba(255,255,255,.82); }
.art-copy h2 { margin: 0 0 12px; font-size: clamp(2rem, 3.4vw, 3.1rem); letter-spacing: -.045em; line-height: 1.05; max-width: 12ch; }
.art-copy p { margin: 0; max-width: 36ch; color: rgba(255,255,255,.88); font-size: 1.05rem; line-height: 1.5; }
.float-board { display: grid; gap: 12px; max-width: 340px; }
.float-tile {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(10px); box-shadow: 0 16px 30px rgba(6,40,18,.12);
}
.float-tile span, .float-tile > i {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: #fff; color: #15803d; font-weight: 800; flex: 0 0 auto;
}
.float-tile strong, .float-tile small { display: block; }
.float-tile small { color: rgba(255,255,255,.78); font-size: .78rem; }
.tile-a { transform: translateX(8px); }
.tile-b { transform: translateX(36px); }
.tile-c { transform: translateX(16px); }
.art-points { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.art-points li {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); font-weight: 700; font-size: .86rem;
}
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid rgba(34,197,94,.14); border-radius: 28px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-card h1 { font-size: 2rem; }
.field-pass { position: relative; display: block; }
.field-pass input { padding-right: 46px; }
.peek {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: #3d5c49; cursor: pointer;
}
.switch { margin: 16px 0 0; font-weight: 600; }
.switch a { font-weight: 800; }
.art-admin { background: linear-gradient(160deg, #166534 0%, #14532d 55%, #052e16 100%); }
.empty-meet i { display: block; font-size: 1.8rem; color: var(--green); margin-bottom: 8px; }
@media (max-width: 800px) {
  .topbar { height: auto; min-height: 60px; padding: 10px 14px; gap: 8px; }
  .logo { font-size: 1.12rem; }
  .top-actions { min-width: 0; gap: 8px; }
  .user-pill { min-width: 0; }
  #whoChip, .who, .logout-label { display: none; }
  .icon-logout {
    width: 44px; height: 44px; padding: 0; justify-content: center;
    border: 0; border-radius: 14px; background: #dcfce7; color: #166534; font-size: 1.2rem;
  }
  .settings-grid { grid-template-columns: 1fr; }
  .home { width: min(1120px, calc(100% - 20px)); margin: 16px auto 36px; }
  .admin { width: min(980px, calc(100% - 20px)); margin: 16px auto 36px; }
  h1, .home-intro h1, .auth-card h1 { font-size: 1.7rem; }
  .hero, .lobby, .create-grid { display: flex; flex-direction: column; }
  .lobby { padding: 16px 12px 32px; }
  .home-intro, .home-tools, .join-row, .sched-grid { display: flex; flex-direction: column; align-items: stretch; }
  .start-btn, .sched-grid .btn-primary, .join-row .btn-primary, .create-grid .btn-primary { width: 100%; }
  .meet-card { grid-template-columns: 44px minmax(0, 1fr); }
  .meet-card .pill, .meet-card .meet-actions { grid-column: 2; justify-self: start; }
  .join-inline { margin-left: 0; width: 100%; }
  .join-inline input { width: 100%; flex: 1; }
  .preview-wrap, .preview-wrap video { min-height: 220px; width: 100%; }
  .join-card { width: 100%; padding: 22px 16px; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  #rows tr, table tr { background: #f7fbf8; border: 1px solid #e5f3ea; border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
  td { border: 0; padding: 4px 0; word-break: break-word; }
  td.actions { justify-content: flex-start; flex-wrap: wrap; }
  .auth-stage { grid-template-columns: 1fr; min-height: 100dvh; }
  .auth-art { padding: 22px 16px 20px; gap: 16px; }
  .float-board, .tile-b, .tile-c { display: none; }
  .art-copy h2 { max-width: none; font-size: 1.8rem; }
  .auth-panel { padding: 16px 12px 28px; }
  .auth-card { padding: 22px 16px; border-radius: 22px; }
  .room-top { padding: 8px 10px; gap: 8px; }
  #roomTitle { max-width: 34vw; }
  .code-btn, .text-btn { padding: 6px 8px; }
  .share-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 86px;
    gap: 8px; padding: 8px;
  }
  .share-layout.content-only {
    grid-template-rows: minmax(0, 1fr);
    padding: 6px;
  }
  .board-tools {
    left: 8px; right: 8px; top: auto; bottom: 8px;
    justify-content: center;
    max-width: calc(100% - 16px);
  }
  .share-layout.board-on .stop-image { top: 8px; right: 8px; }
  .filmstrip { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 8px; touch-action: pan-x; }
  .filmstrip .tile { width: 116px; min-width: 116px; height: 74px; min-height: 74px; flex: 0 0 116px; }
  .host-stage { inset: 8px; }
  .self-pip { width: 108px; height: 74px; top: 12px; right: 12px; }
  .slide-hint { bottom: 10px; max-width: calc(100% - 24px); white-space: nowrap; }
  .gallery { overflow: auto; align-content: start; gap: 8px; padding: 8px; grid-auto-rows: minmax(120px, 1fr); -webkit-overflow-scrolling: touch; }
  .gallery[data-n="3"], .gallery[data-n="4"], .gallery[data-n="5"], .gallery[data-n="6"], .gallery[data-n="7"], .gallery[data-n="8"], .gallery[data-n="9"] { --cols: 2; }
  input, textarea, select { font-size: 16px; }
  button, .ctrl, .leave, .text-btn, .code-btn { touch-action: manipulation; }
  .side {
    position: fixed; inset: 0 0 var(--panel-bottom, 150px) 0; z-index: 17;
    width: 100%; border-left: 0;
  }
  .person { align-items: flex-start; flex-wrap: wrap; }
  .person-actions { flex-wrap: wrap; }
  .person-actions button, .cohost-btn, .admit { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .chat-form input { font-size: 16px; }
  .dock {
    width: calc(100% - 16px); max-width: calc(100% - 16px);
    margin: 0 auto calc(8px + env(safe-area-inset-bottom));
    padding: 8px 8px 10px; gap: 4px 2px; border-radius: 18px;
    flex-wrap: wrap; justify-content: center; overflow: visible; touch-action: manipulation;
  }
  .ctrl { width: auto; flex: 1 1 64px; max-width: 84px; }
  .ctrl small { display: block; font-size: .62rem; line-height: 1.1; }
  .ctrl .bubble { width: 44px; height: 44px; }
  .modal-card, .hold-card { padding: 22px 16px; width: min(460px, calc(100% - 24px)); }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1 1 120px; }
}
@media (max-width: 480px) {
  .logo-mark { width: 32px; height: 32px; border-radius: 10px; }
  .timer { display: none; }
  .share-label { max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Phone landscape: PDF/image/board go true fullscreen. Footer is hidden until tap. */
body.room-body.content-fs .room-top { display: none !important; }
body.room-body.content-fs .room-main { flex: 1; min-height: 0; }
body.room-body.content-fs .share-layout,
body.room-body.content-fs .share-layout.content-only {
  padding: 0; gap: 0;
}
body.room-body.content-fs .share-stage {
  border-radius: 0; height: 100%;
}
body.room-body.content-fs .pdf-stage { background: #0b1510; }
body.room-body.content-fs .pdf-scroll { padding: 0; }
body.room-body.content-fs .pdf-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding-bottom: 8px;
}
body.room-body.content-fs .dock {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 26;
  margin: 0;
  width: max-content;
  max-width: calc(100% - 16px);
  transform: translate(-50%, 140%);
  transition: transform .22s ease;
  pointer-events: none;
}
body.room-body.content-fs.dock-open .dock {
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.legal { width: min(820px, calc(100% - 32px)); margin: 28px auto 40px; }
.legal-card { background: #fff; border: 1px solid rgba(34,197,94,.14); border-radius: 24px; box-shadow: var(--shadow); padding: 32px 28px 36px; }
.legal-card h1 { font-size: 2rem; }
.legal-card h2 { font-size: 1.15rem; margin: 22px 0 8px; }
.legal-card p, .legal-card li { line-height: 1.65; }
.legal-card ul { margin: 8px 0 0; padding-left: 1.2rem; }
.legal-card .btn-primary { margin: 8px 0 14px; }
.legal-meta { color: var(--muted); margin: 0 0 16px; }
.legal-foot, .auth-legal { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; }
.legal-foot { padding: 0 20px 40px; }
.legal-foot a, .auth-legal a { color: var(--muted); font-weight: 600; font-size: .88rem; }
.auth-legal { width: min(440px, 100%); margin-top: 16px; }
