/* Layout language adapted from Cinny's AGPL-3.0 UI structure for this LiveKit client. */
:root {
  color-scheme: light;
  --background: #dedede;
  --background-hover: #d3d3d3;
  --background-active: #c7c7c7;
  --background-line: #bbbbbb;
  --surface: #eaeaea;
  --surface-hover: #dedede;
  --surface-active: #d3d3d3;
  --surface-line: #c7c7c7;
  --surface-variant: #dedede;
  --surface-variant-hover: #d3d3d3;
  --surface-variant-active: #c7c7c7;
  --surface-variant-line: #bbbbbb;
  --primary: #1245a8;
  --primary-hover: #103e97;
  --primary-container: #c4d0e9;
  --success: #017343;
  --success-container: #bfdcd0;
  --critical: #9d0f0f;
  --critical-container: #e7c3c3;
  --text: #000000;
  --muted: #5c5c5c;
  --soft-muted: #747474;
  --inverse: #ffffff;
  --screen-bg: #080b10;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  --r400: 8px;
  --r500: 12px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
}

body.auth-locked .client-shell {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input {
  min-width: 0;
  width: 100%;
  outline: none;
}

h1,
h2,
p {
  margin: 0;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(222, 222, 222, 0.86);
  backdrop-filter: blur(10px);
  padding: 20px;
}

body:not(.auth-locked) .auth-gate {
  display: none;
}

.auth-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  border-radius: var(--r500);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line), var(--shadow);
  padding: 24px;
  text-align: center;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: var(--r400);
  background: var(--primary-container);
  color: var(--primary);
  font-size: 24px;
  font-weight: 850;
}

.auth-panel h1 {
  font-size: 22px;
}

.auth-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.telegram-widget {
  min-height: 42px;
}

.auth-button {
  min-height: 38px;
  border-radius: var(--r400);
  background: var(--primary);
  color: var(--inverse);
  padding: 0 14px;
  font-weight: 750;
}

.auth-button:hover:not(:disabled) {
  background: var(--primary-hover);
}

.auth-button:disabled {
  opacity: 0.55;
}

.auth-button.secondary {
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-variant-line);
  color: var(--text);
}

.auth-button.secondary:hover:not(:disabled) {
  background: var(--surface-variant-hover);
}

.bot-login-box {
  display: grid;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.bot-login-code {
  display: block;
  width: 100%;
  border-radius: var(--r400);
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-variant-line);
  color: var(--primary);
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  word-break: break-all;
}

.auth-status {
  min-height: 20px;
}

.client-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 266px;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.rail {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 66px;
  min-width: 66px;
  background: var(--background);
  color: var(--text);
  border-right: 1px solid var(--background-line);
}

.rail-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
}

.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  background: transparent;
  color: inherit;
  transition: transform 200ms cubic-bezier(0, 0.8, 0.67, 0.97);
}

.rail-item:hover {
  transform: translateX(2px);
}

.rail-item::before {
  content: "";
  position: absolute;
  left: -13.5px;
  display: none;
  width: 5px;
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: currentColor;
  transition: height 200ms linear;
}

.rail-item:hover::before {
  display: block;
  width: 3px;
}

.rail-item.active::before {
  display: block;
  height: 24px;
}

.space-avatar,
.voice-avatar,
.mini-avatar,
.message-avatar,
.room-user-avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r400);
  background: var(--primary-container);
  color: var(--primary);
  font-weight: 750;
}

.avatar-photo,
.avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.avatar-photo {
  display: block;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: inherit;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.avatar-photo[hidden],
.avatar-fallback[hidden] {
  display: none;
}

.space-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.space-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--background-line);
}

.rail-presence {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-container);
}

.rooms-pane,
.people-pane {
  min-width: 0;
  background: var(--background);
}

.rooms-pane {
  display: flex;
  flex-direction: column;
  width: 256px;
  overflow-x: hidden;
  border-right: 1px solid var(--background-line);
}

.workspace-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--background-line);
}

.workspace-copy {
  min-width: 0;
}

.workspace-head h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 750;
}

.workspace-head p,
.section-head,
.status-label,
.person-row small,
.voice-card small,
.message-meta span,
.room-topic,
.room-title p {
  color: var(--muted);
  font-size: 12px;
}

.server-state {
  display: none;
  flex-shrink: 0;
  min-width: 52px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--background-line);
  color: var(--muted);
  padding: 5px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}

.room-title p,
.status-panel {
  display: none;
}

.identity-form {
  display: grid;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--background-line);
}

.profile-form {
  display: block;
}

.profile-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border-radius: var(--r400);
  background: var(--background-hover);
  box-shadow: inset 0 0 0 1px var(--background-line);
  padding: 6px;
}

.profile-photo,
.profile-fallback {
  width: 34px;
  height: 34px;
  border-radius: var(--r400);
}

.profile-photo {
  display: none;
  object-fit: cover;
}

.profile-photo[src] {
  display: block;
}

.profile-photo[src] + .profile-fallback {
  display: none;
}

.profile-fallback {
  display: grid;
  place-items: center;
  background: var(--primary-container);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.profile-copy {
  display: grid;
  min-width: 0;
}

.profile-copy strong,
.profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy small {
  color: var(--muted);
  font-size: 12px;
}

.profile-logout {
  width: 38px;
  height: 32px;
  border-radius: var(--r400);
  background: var(--background);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-logout:hover {
  background: var(--critical-container);
  color: var(--critical);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.identity-form input {
  height: 36px;
  border: 1px solid var(--background-line);
  border-radius: var(--r400);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.identity-form input:focus {
  box-shadow: 0 0 0 2px rgba(18, 69, 168, 0.22);
}

.composer input:focus {
  box-shadow: none;
}

.primary {
  min-height: 36px;
  border-radius: var(--r400);
  background: var(--primary);
  color: var(--inverse);
  font-weight: 750;
}

.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.room-section {
  min-height: 0;
  overflow: auto;
  padding: 8px 0 112px 8px;
}

.section-head {
  padding: 8px 8px 6px;
  font-weight: 750;
}

.room-list {
  display: grid;
  gap: 2px;
  overflow-x: hidden;
}

.room-item {
  display: grid;
  gap: 1px;
}

.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
}

.room-shortcut {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border-radius: var(--r400);
  background: var(--background);
  color: var(--text);
  text-align: left;
  padding: 3px 8px;
}

.room-shortcut:hover {
  background: var(--background-hover);
}

.room-shortcut.active,
.room-item.active .room-shortcut {
  background: var(--background-active);
}

.room-rename {
  align-self: center;
  width: 38px;
  height: 36px;
  border-radius: var(--r400);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
}

.room-row:hover .room-rename,
.room-item.active .room-rename,
.room-rename:focus-visible {
  opacity: 1;
}

.room-rename:hover,
.room-rename:focus-visible {
  background: var(--background-hover);
  color: var(--text);
}

.room-hash {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 850;
}

.room-copy,
.room-name,
.room-topic {
  min-width: 0;
}

.room-copy {
  display: grid;
  gap: 0;
}

.room-name,
.room-topic {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-topic {
  display: none;
}

.room-name {
  font-size: 14px;
  font-weight: 650;
}

.room-pill {
  border-radius: 999px;
  background: var(--success-container);
  color: var(--success);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 750;
}

.room-pill:empty {
  display: none;
}

.room-users {
  display: grid;
  gap: 0;
  padding-left: 30px;
}

.room-users:empty {
  display: none;
}

.room-user {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  border-radius: var(--r400);
  color: var(--muted);
  padding: 1px 6px;
}

.room-user:hover,
.room-user.is-speaking {
  background: var(--background-hover);
  color: var(--text);
}

.room-user-avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--background-line);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.room-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.room-user-state {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--success-container);
  color: var(--success);
}

.room-user-state svg,
.person-badge svg,
.action-icon,
.quality-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room-user.is-muted .room-user-state {
  background: var(--surface);
  color: var(--muted);
}

.room-user.is-screening .room-user-state {
  background: var(--primary-container);
  color: var(--primary);
}

.room-user:not(.is-muted):not(.is-screening) .room-user-state {
  background: var(--success-container);
  color: var(--success);
}

.room-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.room-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--surface-line);
  background: var(--surface);
}

.room-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-title-copy {
  min-width: 0;
}

.room-title-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.room-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 750;
}

.room-chat-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  color: var(--muted);
  padding: 0;
  opacity: 0;
}

.room-chat-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.room-chat-button:hover,
.room-chat-button:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.room-chat-button.active {
  opacity: 1;
  background: var(--primary-container);
  color: var(--primary);
}

.room-row:hover .room-chat-button,
.room-item.active .room-chat-button,
.room-chat-button:focus-visible {
  opacity: 1;
}

.room-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.action-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  color: var(--text);
  padding: 0;
  line-height: 0;
}

.action-button svg {
  pointer-events: none;
}

.quality-control {
  display: grid;
  grid-template-columns: 14px auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  color: var(--muted);
  padding: 0 10px 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.quality-control select {
  min-width: 158px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-variant);
  color: var(--text);
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  outline: none;
}

.quality-control select:focus-visible {
  box-shadow: 0 0 0 2px rgba(18, 69, 168, 0.22);
}

.quality-control:has(select:disabled) {
  opacity: 0.5;
}

.action-button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.action-button.icon-toggle .icon-on {
  display: none;
}

.action-button.icon-toggle.active .icon-off {
  display: none;
}

.action-button.icon-toggle.active .icon-on {
  display: block;
}

.action-button.fit-toggle .icon-fill {
  display: none;
}

.action-button.fit-toggle[data-fit="cover"] .icon-contain {
  display: none;
}

.action-button.fit-toggle[data-fit="cover"] .icon-fill {
  display: block;
}

.action-button.active {
  background: var(--success-container);
  box-shadow: inset 0 0 0 1px #99c7b4;
  color: var(--success);
}

.action-button.demo-toggle.active {
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  color: var(--muted);
}

.action-button.demo-toggle.active:hover:not(:disabled) {
  background: var(--surface-hover);
}

.action-button.danger {
  color: var(--critical);
}

.action-button.danger:hover:not(:disabled) {
  background: var(--critical-container);
  box-shadow: inset 0 0 0 1px #d89f9f;
}

.theater-topbar .action-button {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: var(--inverse);
}

.theater-topbar .action-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.theater-topbar .action-button.danger {
  color: #ffbcbc;
}

.theater-topbar .action-button.danger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.theater-fullscreen-button .icon-on {
  display: none;
}

.theater-fullscreen-button[data-fullscreen="true"] .icon-off {
  display: none;
}

.theater-fullscreen-button[data-fullscreen="true"] .icon-on {
  display: block;
}

.screen-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 250px;
  max-height: 48vh;
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-line);
  background: var(--surface);
}

.screen-stage.is-hidden {
  display: none;
}

.screen-focus,
.focused-screen,
.theater-media {
  min-width: 0;
  min-height: 0;
}

.focused-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r400);
  background: var(--screen-bg);
  box-shadow: inset 0 0 0 1px var(--surface-line), var(--shadow);
}

.focused-screen video,
.theater-media video {
  width: 100%;
  height: 100%;
  background: var(--screen-bg);
  object-fit: contain;
}

.fit-cover .focused-screen video,
.theater-media.fit-cover video {
  object-fit: cover;
}

.screen-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  border-radius: var(--r400);
  background: rgba(8, 11, 16, 0.8);
  color: var(--inverse);
  padding: 7px 9px;
  font-size: 13px;
}

.screen-label strong,
.screen-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-label span {
  color: #d7dbe2;
}

.screen-strip {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.screen-thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r400);
  background: var(--screen-bg);
  box-shadow: inset 0 0 0 2px transparent;
  padding: 0;
}

.screen-thumb.active {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.screen-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen-thumb span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px;
  background: rgba(8, 11, 16, 0.76);
  color: var(--inverse);
  padding: 3px 6px;
  font-size: 12px;
}

.timeline {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.voice-strip {
  display: none;
}

.voice-strip.is-empty {
  display: none;
}

.voice-card {
  display: grid;
  grid-template-columns: 34px minmax(112px, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 178px;
  min-height: 50px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  padding: 8px;
}

.voice-card.is-speaking {
  background: var(--success-container);
  box-shadow: inset 0 0 0 1px #99c7b4;
}

.voice-avatar,
.mini-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.voice-meta,
.person-main,
.message-content {
  min-width: 0;
}

.voice-meta strong,
.voice-meta small,
.person-main strong,
.person-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 28px;
}

.message {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 0;
  border-radius: 0 var(--r400) var(--r400) 0;
  padding: 4px 8px 4px 16px;
}

.message:hover {
  background: var(--surface-hover);
}

.message.own .message-avatar {
  background: var(--success-container);
  color: var(--success);
}

.message-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-top: 4px;
  font-size: 12px;
  border-radius: 50%;
}

.message-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding-top: 1px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.message-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.message p {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.message-attachments {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.message-attachment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: min(420px, 100%);
  border-radius: var(--r400);
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-variant-line);
  color: var(--text);
  padding: 8px;
  text-decoration: none;
}

.message-attachment:hover {
  background: var(--surface-variant-hover);
}

.image-attachment {
  display: block;
  width: fit-content;
  max-width: min(520px, 100%);
  border-radius: var(--r400);
  overflow: hidden;
  background: var(--screen-bg);
  color: inherit;
  text-decoration: none;
}

.media-attachment {
  width: min(560px, 100%);
  align-items: start;
}

.attachment-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r400);
  background: var(--primary-container);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.attachment-main {
  min-width: 0;
}

.attachment-name,
.attachment-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-name {
  font-size: 13px;
  font-weight: 650;
}

.attachment-meta {
  color: var(--muted);
  font-size: 12px;
}

.attachment-open,
.attachment-open-label {
  align-self: center;
}

.attachment-open {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.attachment-open:hover {
  color: var(--primary);
}

.attachment-preview {
  display: block;
  width: auto;
  max-width: min(520px, 100%);
  max-height: 420px;
  border-radius: var(--r400);
  object-fit: contain;
  background: var(--screen-bg);
}

.attachment-player {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
  border-radius: var(--r400);
}

.attachment-video {
  display: block;
  max-height: 320px;
  background: var(--screen-bg);
}

.attachment-audio {
  height: 38px;
}

.system-notice,
.messages-empty {
  align-self: center;
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.system-notice {
  margin: 4px 16px;
  background: var(--surface-variant);
}

.messages-empty {
  margin: auto;
}

.composer-area {
  flex: 0 0 auto;
  padding: 0 16px 12px;
  background: var(--surface);
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
}

.attachment-tray[hidden] {
  display: none;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  min-height: 30px;
  border-radius: var(--r400);
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-variant-line);
  color: var(--text);
  padding: 4px 6px 4px 9px;
  font-size: 12px;
}

.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.attachment-chip button:hover {
  background: var(--surface-variant-hover);
  color: var(--critical);
}

.composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: var(--r400);
  background: var(--surface-variant);
  box-shadow: inset 0 0 0 1px var(--surface-variant-line);
  padding: 6px 6px 6px 12px;
}

.composer-tool {
  width: 34px;
  height: 34px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--surface-line);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
}

.composer-tool:hover:not(:disabled) {
  background: var(--surface-hover);
}

.composer input {
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.composer input::placeholder {
  color: var(--soft-muted);
}

.composer button[type="submit"] {
  min-width: 64px;
  height: 36px;
  border-radius: var(--r400);
  background: var(--primary);
  color: var(--inverse);
  padding: 0 12px;
  font-weight: 750;
}

.composer button[type="submit"]:hover:not(:disabled) {
  background: var(--primary-hover);
}

.people-pane {
  display: flex;
  flex-direction: column;
  width: 266px;
  border-left: 1px solid var(--background-line);
}

.people-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 56px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--background-line);
}

.people-head h2 {
  font-size: 16px;
  font-weight: 750;
}

.people-head span {
  color: var(--muted);
  font-size: 12px;
}

.status-panel {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px;
  border-radius: var(--r400);
  background: var(--background-hover);
  box-shadow: inset 0 0 0 1px var(--background-line);
  padding: 8px;
}

.status-panel strong {
  color: var(--success);
  font-size: 13px;
}

.people-list {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  overflow: auto;
  padding: 8px 0;
}

.people-empty {
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
}

.person-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  margin-left: 8px;
  margin-right: 8px;
  border-radius: var(--r400);
  padding: 4px 8px;
}

.person-row:hover,
.person-row.is-speaking {
  background: var(--background-hover);
}

.person-row.is-local {
  min-height: 42px;
}

.person-row.is-muted .person-badge {
  background: var(--surface);
  color: var(--muted);
}

.person-row:not(.is-muted) .person-badge {
  background: var(--success-container);
  color: var(--success);
}

.person-row.is-muted .mini-avatar {
  background: var(--surface);
  color: var(--muted);
}

.person-row.is-speaking .mini-avatar {
  background: var(--success-container);
  color: var(--success);
}

.person-badge {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--background-line);
  color: var(--muted);
}

.person-audio-controls {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: -2px;
}

.person-mute {
  min-width: 54px;
  height: 26px;
  border-radius: var(--r400);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--background-line);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.person-mute:hover,
.person-mute.active {
  background: var(--critical-container);
  color: var(--critical);
}

.person-volume {
  width: 100%;
  min-width: 0;
  accent-color: var(--primary);
}

.theater {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  grid-template-rows: 56px 1fr;
  background: var(--screen-bg);
}

.theater.open {
  display: grid;
}

.theater-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--inverse);
  padding: 0 12px;
}

.theater-topbar div {
  display: flex;
  gap: 8px;
}

.theater-media {
  padding: 12px;
  cursor: zoom-out;
}

.audio-sink {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

@media (max-width: 1180px) {
  .client-shell {
    grid-template-columns: 256px minmax(0, 1fr);
  }

  .people-pane {
    display: none;
  }
}

@media (max-width: 860px) {
  .client-shell {
    grid-template-columns: 1fr;
  }

  .rail,
  .rooms-pane {
    display: none;
  }

  .room-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 12px;
  }

  .room-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .screen-stage {
    grid-template-columns: 1fr;
    max-height: none;
    padding: 12px;
  }

  .screen-strip {
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    overflow-x: auto;
  }

  .composer-area {
    padding: 0 8px 8px;
  }
}
