:root {
  color-scheme: light dark;
  --room-hue: 343;
  --accent-hue: 343;
  --bg: hsl(var(--room-hue) 17% 96%);
  --surface: hsl(var(--room-hue) 14% 99%);
  --ink: hsl(var(--room-hue) 23% 13%);
  --dim: hsl(var(--room-hue) 10% 35%);
  --line: hsl(var(--room-hue) 15% 82%);
  --wash: hsl(var(--accent-hue) 28% 92%);
  --brand: hsl(var(--accent-hue) 40% 27%);
  --accent: hsl(var(--accent-hue) 64% 77%);
  --wa-font-family-body: Inter, system-ui, sans-serif;
  font:
    15px/1.45 Inter,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(var(--room-hue) 13% 8%);
    --surface: hsl(var(--room-hue) 12% 12%);
    --ink: hsl(var(--room-hue) 16% 93%);
    --dim: hsl(var(--room-hue) 10% 72%);
    --line: hsl(var(--room-hue) 11% 25%);
    --wash: hsl(var(--accent-hue) 17% 18%);
    --brand: hsl(var(--accent-hue) 51% 76%);
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body,
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
wa-button {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 550;
  line-height: 1.35;
}
button:hover:enabled {
  background: var(--wash);
  border-color: var(--brand);
}
button:disabled,
input:disabled {
  opacity: 0.55;
  cursor: default;
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
input:not([type='checkbox'], [type='range']),
select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
}
wa-button::part(base) {
  background: var(--accent);
  color: #10291e;
  border: 0;
  border-radius: 8px;
  font:
    650 0.96rem/1.4 Inter,
    system-ui,
    sans-serif;
  min-height: 42px;
}
wa-button:hover::part(base) {
  filter: brightness(1.06);
}
button:has(.icon),
.brand,
.mast-actions,
.media-title,
.room-tools,
.tools,
.empty-actions,
.people-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
}
.shell {
  --rail-width: 320px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.mast {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  padding: 8px clamp(14px, 2vw, 32px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  font-size: 1.45rem;
  font-weight: 780;
  letter-spacing: -0.07em;
  gap: 8px;
  line-height: 1;
}
.brandmark,
.media-symbol {
  display: grid;
  place-items: center;
  flex: none;
}
.brandmark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--dawn, #f8b18d), var(--dusk, #e99dc0));
  color: #382138;
  box-shadow: inset 0 0 0 1px #0e301818;
}
.brandmark .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}
.room-heading {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  min-width: 0;
  flex: 1;
}
h1,
.filename {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
h1 {
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}
.mast-actions {
  margin-left: auto;
  gap: 8px;
  flex: none;
}
.mast-actions button {
  min-height: 35px;
}
.mast-actions button:last-child {
  color: #143629;
  background: var(--accent);
  border-color: transparent;
}
#ready[aria-pressed='true'] {
  background: var(--wash);
  border-color: var(--brand);
  color: var(--brand);
}
.status {
  display: flex;
  align-items: center;
  gap: 7px;
  border-color: transparent;
  color: var(--dim);
  background: transparent;
}
.status:before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
}
.status[data-state='Offline']:before {
  background: var(--dim);
}
.status[data-state='Correcting']:before,
.status[data-state='Buffering']:before,
.status[data-state='Reconnecting']:before {
  background: #bb801e;
}
.layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px var(--rail-width);
  padding: clamp(10px, 1.3vw, 23px);
  gap: 0;
  flex: 1;
  align-items: stretch;
}
.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.screen {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #090e10;
  flex: 1;
  min-height: clamp(250px, 33vw, 60dvh);
}
.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  color: #f4f6ed;
  background: #203d40;
  background-image: var(--room-pattern, none);
}
.empty canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  image-rendering: pixelated;
}
.empty:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 19, 25, 0.32), transparent 74%),
    linear-gradient(0deg, #0b171be8 0%, #0b171b52 39%, transparent 65%);
}
.empty-content {
  padding: clamp(20px, 4vw, 70px);
  width: 100%;
}
.empty h2 {
  max-width: 15ch;
  font-size: clamp(2rem, 4.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.065em;
  font-weight: 660;
  text-wrap: balance;
}
.empty p {
  margin-top: 12px;
  font-size: clamp(0.87rem, 1.15vw, 1.05rem);
  color: #e1e9e3;
  overflow-wrap: anywhere;
  max-width: 52ch;
}
.empty-actions {
  gap: 10px;
  margin-top: 22px;
}
.empty-actions button {
  color: #eff5f0;
  background: #1a302fcd;
  border: 1px solid #e1eee85c;
  min-height: 42px;
}
.empty-actions button:hover:enabled {
  background: #284443;
  color: white;
}
.media-bar,
.room-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.media-bar {
  padding: 16px 2px 13px;
  border-bottom: 1px solid var(--line);
}
.media-title {
  min-width: 0;
  flex: 1 1 155px;
  gap: 11px;
}
.media-title > div {
  min-width: 0;
}
.media-title small {
  font-size: 0.72rem;
  color: var(--dim);
  font-weight: 550;
}
.filename {
  font-size: clamp(1.05rem, 1.65vw, 1.55rem);
  letter-spacing: -0.037em;
  line-height: 1.25;
}
.media-symbol {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--wash);
  color: var(--brand);
}
.tools,
.room-tools {
  gap: 5px;
  flex-wrap: wrap;
}
.tools button,
.room-tools button {
  border-color: transparent;
  background: transparent;
}
.room-tools button {
  font-size: 0.8rem;
  color: var(--dim);
}
.room-strip {
  padding: 8px 0 0;
  align-items: flex-start;
}
.room-tools {
  margin-left: auto;
}
.notice {
  font-size: 0.87rem;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.notice:not(:empty) {
  padding: 8px 3px;
}
.guest-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 8px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 9px;
}
.guest-name label {
  margin-right: auto;
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.guest-name span {
  color: var(--dim);
  font-size: 0.83rem;
}
.guest-name input {
  max-width: 11rem;
}
.rail-splitter {
  cursor: col-resize;
  touch-action: none;
  position: relative;
  border-radius: 6px;
  min-width: 0;
}
.rail-splitter:hover:after,
.rail-splitter:focus-visible:after {
  content: '';
  position: absolute;
  top: 45%;
  height: 36px;
  width: 3px;
  left: calc(50% - 1px);
  border-radius: 3px;
  background: var(--brand);
}
#room-sidebar {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
#room-sidebar nav {
  display: flex;
  gap: 2px;
  margin: 10px 11px 0;
  padding: 3px;
  background: var(--bg);
  border-radius: 8px;
}
#room-sidebar nav button {
  flex: 1;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  font-size: 0.81rem;
  padding: 6px 3px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--dim);
  border-radius: 6px;
}
#room-sidebar nav button .icon {
  width: 15px;
  height: 15px;
}
#room-sidebar nav button.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 1px 3px #142b2410;
}
#room-panels,
.chat-pane,
.discussion {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.chat-head,
.inspector header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
  gap: 8px;
}
.chat-head h2,
.inspector h2,
.panel h3 {
  font-weight: 650;
  font-size: 1.06rem;
  letter-spacing: -0.035em;
}
.people-count {
  gap: 4px;
  color: var(--dim);
  font-size: 0.78rem;
}
.people-count .icon {
  width: 15px;
}
.messages,
.panel,
.inspector-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.messages {
  flex: 1;
  padding: 2px 16px 12px;
  overflow-anchor: none;
}
.messages:has(.hint) {
  display: grid;
  place-items: center;
}
.hint {
  text-align: center;
  max-width: 22ch;
  align-self: center;
}
.chat-art {
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  color: var(--brand);
  background: var(--wash);
  border-radius: 12px;
}
.chat-art .icon {
  width: 23px;
  height: 23px;
}
.hint h3 {
  font-size: 0.97rem;
  font-weight: 620;
}
.hint p,
.member small,
.item small {
  font-size: 0.82rem;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.hint p {
  margin-top: 4px;
}
.message {
  padding: 4px 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.48;
}
.message strong {
  font-weight: 680;
  margin-inline-end: 7px;
  color: hsl(var(--author-hue, 154) 43% 30%);
}
@media (prefers-color-scheme: dark) {
  .message strong {
    color: hsl(var(--author-hue, 154) 55% 76%);
  }
}
.message p {
  display: inline;
  white-space: pre-wrap;
}
.message button {
  margin-left: 4px;
  font-size: 0.78rem;
}
.composer {
  display: flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px;
  padding: 4px;
  background: var(--bg);
}
.composer:focus-within {
  outline: 2px solid var(--brand);
}
.composer input:not([type='range']) {
  width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 0.86rem;
}
.composer button {
  padding: 7px;
  background: var(--accent);
  color: #143529;
  border-color: transparent;
}
#new-messages {
  align-self: center;
  background: var(--wash);
  color: var(--brand);
  margin-top: 4px;
}
.panel,
.inspector-content {
  padding: 10px 15px 16px;
  flex: 1;
}
.panel h3 {
  margin: 6px 0 12px;
}
.member,
.item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.member button,
.item button {
  overflow-wrap: anywhere;
  text-align: left;
}
.queue-actions,
.palette-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.queue-actions button {
  padding: 4px 7px;
  font-size: 0.77rem;
}
.inspector {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.inspector header {
  border-bottom: 1px solid var(--line);
}
.inspector header button {
  padding: 5px;
  background: transparent;
  border: 0;
}
.inspector-content h3 {
  font-size: 0.92rem;
  margin: 10px 0 6px;
}
.inspector label {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  font-size: 0.82rem;
  color: var(--dim);
}
.inspector input,
.inspector select {
  width: 100%;
  font-size: 0.9rem;
  color: var(--ink);
}
.inspector .check {
  display: flex;
  align-items: center;
}
.inspector .check input {
  width: auto;
  accent-color: var(--brand);
}
.inspector-content button,
.inspector-content wa-button {
  margin: 3px 1px;
}
.inspector-content [role='status'],
#sub-suggestions,
#extractor-status {
  font-size: 0.83rem;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.palette-picker {
  padding: 4px 0;
}
#palette-name {
  font-size: 0.84rem;
}
#art-credit {
  font-size: 0.75rem;
}
#art-credit img {
  max-width: 65px;
  max-height: 24px;
}
#candidates button,
#sub-results button {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
}
.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
#overlay-chat-toggle {
  display: none;
}
@media (min-width: 761px) and (min-aspect-ratio: 1/1), (min-width: 1151px) {
  .shell {
    height: 100dvh;
    min-height: 470px;
  }
  .layout {
    min-height: 0;
  }
  .stage {
    overflow: auto;
  }
  .media-bar,
  .room-strip,
  .notice,
  .guest-name {
    flex: none;
  }
  .screen {
    min-height: 180px;
  }
}
@media (max-width: 1000px) {
  .mast {
    gap: 12px;
  }
  .room-heading {
    padding-left: 12px;
  }
  .tools button {
    padding: 6px;
  }
  .media-bar {
    gap: 6px;
  }
}
@media (max-width: 760px), (max-width: 1150px) and (max-aspect-ratio: 1/1) {
  .mast {
    padding: 7px 10px;
    min-height: 52px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 1.2rem;
  }
  .brandmark {
    width: 28px;
    height: 28px;
  }
  .room-heading {
    padding-left: 8px;
  }
  .mast-actions {
    gap: 4px;
  }
  .mast-actions button {
    font-size: 0.78rem;
    padding: 5px 7px;
    gap: 3px;
  }
  .status {
    font-size: 0 !important;
    padding: 5px !important;
  }
  .status:before {
    width: 8px;
    height: 8px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 9px;
  }
  .screen {
    min-height: 0;
    aspect-ratio: 16/9;
    flex: auto;
  }
  .empty-content {
    padding: clamp(15px, 4vw, 28px);
  }
  .empty h2 {
    font-size: clamp(1.55rem, 5vw, 2.4rem);
  }
  .empty p {
    font-size: 0.8rem;
    margin-top: 6px;
  }
  .empty-actions {
    margin-top: 10px;
    gap: 6px;
  }
  .empty-actions wa-button::part(base),
  .empty-actions button {
    min-height: 34px;
    font-size: 0.82rem;
  }
  .rail-splitter {
    display: none;
  }
  .media-bar {
    padding: 8px 0;
    gap: 5px;
  }
  .tools button {
    font-size: 0.78rem;
  }
  .media-title {
    flex-basis: 100%;
  }
  .media-symbol {
    height: 30px;
    width: 30px;
  }
  .room-strip {
    padding: 4px 0 0;
  }
  #room-sidebar {
    flex: 1 0 auto;
    min-height: 240px;
    height: clamp(280px, 49dvh, 580px);
  }
  #room-sidebar nav {
    margin-top: 7px;
  }
  .chat-head {
    padding: 10px 14px;
  }
}
@media (max-width: 430px) {
  .brand {
    font-size: 0;
  }
  .room-heading {
    border: 0;
  }
  .mast h1 {
    font-size: 1rem;
  }
  .mast-actions .icon {
    width: 15px;
  }
  .empty h2 {
    max-width: 20ch;
  }
  .empty p {
    max-width: 40ch;
  }
  .guest-name input {
    max-width: 9rem;
  }
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) {
  height: 100dvh;
  min-height: 0;
  width: 100vw;
  background: #080b0c;
}
#watch-room.theater-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode)
  :is(.mast, .media-bar, .room-strip, .guest-name, .session-note, .notice, .rail-splitter) {
  display: none;
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) .layout {
  display: block;
  position: relative;
  padding: 0;
  min-height: 0;
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) .stage,
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) .screen {
  height: 100%;
  width: 100%;
  border-radius: 0;
  aspect-ratio: auto;
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) #room-sidebar {
  position: absolute;
  z-index: 8;
  inset: 60px 12px 94px auto;
  width: min(var(--rail-width), 82vw);
  height: auto;
  min-height: 0;
  box-shadow: 0 8px 30px #0005;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode).rail-closed #room-sidebar {
  display: none;
}
#watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) #overlay-chat-toggle {
  display: flex;
  position: absolute;
  top: 12px;
  right: 13px;
  z-index: 9;
  color: #fff;
  background: #172223ce;
  border-color: #fff4;
}
@media (max-height: 400px) {
  #watch-room:is(:fullscreen, .theater-fullscreen, .theatre-mode) #room-sidebar {
    inset: 4px 92px 65px auto;
  }
  .chat-head {
    padding-block: 3px;
  }
}
#room-controls {
  font-size: 0.84rem;
  max-width: 100%;
  padding: 5px 0;
}
#room-controls summary,
.inspector summary {
  cursor: pointer;
  font-weight: 630;
  line-height: 1.75;
  color: var(--brand);
}
#room-controls[open] {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
#room-controls p {
  margin: 3px 0;
  color: var(--dim);
}
#room-controls button,
#room-controls select {
  font-size: 0.8rem;
  margin: 2px 3px 2px 0;
}
#room-controls .room-petition {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
#chat-unread {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  padding: 1px 3px;
  border-radius: 4px;
  color: #143629;
  background: var(--accent);
  font-size: 0.7rem;
}

#library-entries > div { display:grid; grid-template-columns: minmax(0,1fr) auto auto; align-items:center; gap:.4rem; padding:.45rem 0; border-bottom:1px solid var(--line); }
#library-entries span { overflow-wrap:anywhere; }
.screen:is(.file-drop,.link-drop)::after { content:"Drop videos, subtitles or folders"; position:absolute; inset:.5rem; display:grid; place-items:center; border:3px dashed currentColor; border-radius:1rem; color:white; background:#271d3de8; z-index:12; pointer-events:none; }
.screen.link-drop::after { content:"Drop to review this video link"; }

.session-entry { display: flex; align-items: center; gap: .3rem; }
.session-entry > :first-child { color: var(--accent); }
.session-note { padding: .5rem .85rem; border-inline-start: .2rem solid var(--accent); }
.session-note p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .15rem 0 0; max-height: 7em; overflow-y: auto; }
.session-editor { display: grid; gap: .5rem; }
.session-editor textarea { width: 100%; resize: vertical; font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: .4rem; padding: .45rem; }
.screen-avatar { display: inline-block; vertical-align: middle; width: 1.25em; height: 1.25em; margin-inline-end: .35em; border-radius: .28em; background: hsl(var(--avatar-hue) 16% 24%); }
.tv-screen { min-height:100dvh; display:flex; flex-wrap:wrap; align-content:center; align-items:center; justify-content:center; gap:clamp(2rem,7vw,7rem); padding:clamp(1.5rem,5vw,5rem); background:var(--surface); color:var(--ink); }
.tv-screen > div { max-width:32rem; }
.tv-screen h1 { font-size:clamp(2.5rem,6vw,5rem); line-height:1; margin:.4em 0; }
#tv-display-code { font-size:clamp(2.3rem,6vw,5rem); font-variant-numeric:tabular-nums; letter-spacing:.06em; white-space:nowrap; }
#tv-qr { width:min(65vw,32vh,20rem); height:auto; image-rendering:pixelated; border-radius:.6rem; }
#tv-play { position:absolute; top:1rem; left:1rem; z-index:8; }

#screening-check { margin-block: .4rem; }
#screening-check ul { padding: 0; margin: .35rem 0; list-style: none; }
#screening-check li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .8rem; }
#screening-check li span { color: var(--dim); }
#invite-preview { padding-block: .45rem; }
#invite-card { display: grid; grid-template-columns: minmax(4rem, 26%) 1fr; gap: .6rem; align-items: center; margin-block: .5rem; }
#invite-card[hidden], #invite-card-status:empty { display: none; }
#invite-art { width: 100%; aspect-ratio: 1.6; object-fit: cover; border-radius: .35rem; }
#invite-card p { margin: .2rem 0 0; }
#invite-card strong, #invite-card p { overflow-wrap: anywhere; }
