@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url("/assets/fonts/roboto-100.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/roboto-300.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/roboto-500.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-900.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --divider-dark: #0a0a0b;
  --divider-light: #2c2c33;
  --action-gray: #abacb2;
  --action-yellow: #443f39;
  --action-enabled: #53da3e;
  --action-disabled: #da3e44;
  --text-primary: #f9f9f9;
  --text-secondary: #8b8c93;
  --bg-dark: #121214;
  --bg-light-primary: #212126;
  --bg-light-secondary: #1a1a1e;
  --menu-width: 444px;
  --chat-width: 450px;
  --footer-height: 64px;
  --panel-slide: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: "Roboto", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

.hidden,
.compat-hidden {
  display: none !important;
}

.startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
}

.startup-overlay.hidden {
  display: none;
}

.app-shell {
  min-height: 100dvh;
  background: var(--bg-dark);
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) 0;
  grid-template-rows: minmax(0, 1fr) var(--footer-height);
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  transition: grid-template-columns var(--panel-slide);
}

.app-shell.layout-wide.menu-open.chat-open .workspace {
  grid-template-columns: var(--menu-width) minmax(0, 1fr) var(--chat-width);
}

.app-shell.layout-wide.menu-open:not(.chat-open) .workspace,
.app-shell.layout-medium.menu-open .workspace {
  grid-template-columns: var(--menu-width) minmax(0, 1fr) 0;
}

.app-shell.layout-wide.chat-open:not(.menu-open) .workspace,
.app-shell.layout-medium.chat-open .workspace {
  grid-template-columns: 0 minmax(0, 1fr) var(--chat-width);
}

.workspace-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--footer-height);
  left: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: opacity var(--panel-slide);
}

.side-panel {
  z-index: 30;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-light-secondary);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--panel-slide),
    transform var(--panel-slide);
}

.panel-channels {
  grid-column: 1;
  border-right: 1px solid var(--divider-dark);
  overflow-y: auto;
  transform: translateX(-28px);
}

.panel-chat {
  grid-column: 3;
  border-left: 1px solid var(--divider-dark);
  transform: translateX(28px);
}

.app-shell.menu-open .panel-channels,
.app-shell.chat-open .panel-chat {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.video-stage {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-dark);
}

.video-grid {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 28px 28px 10px;
  overflow: hidden;
  background: var(--bg-dark);
}

.video-grid.empty {
  display: block;
}

.join-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 48px));
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

.video-tile {
  position: absolute;
  overflow: hidden;
  padding: 0;
  border-radius: 2px;
  background: #d7d7d7;
}

.video-tile:fullscreen {
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

.video-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d7d7d7;
}

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

.video-tile.screen-share,
.video-tile.screen-share .video-media-wrap {
  background: transparent;
}

.video-tile.screen-share .video-media-wrap video {
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}

.video-caption {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-tile-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  pointer-events: auto;
}

.screen-volume-slider {
  width: min(116px, 18vw);
  accent-color: var(--action-gray);
}

.screen-volume-slider:disabled {
  opacity: 0.55;
}

.video-expand-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--action-gray);
  font-size: 26px;
  line-height: 1;
}

.video-footer {
  flex: 0 0 auto;
  min-height: 52px;
  max-height: 140px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-dark);
}

.video-footer.empty {
  display: none;
}

.video-participant-button {
  min-width: 0;
  max-width: 190px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--bg-light-primary);
  color: var(--action-gray);
  font-size: 18px;
  font-weight: 300;
  white-space: nowrap;
}

.video-participant-button.active {
  background: var(--action-gray);
  color: var(--bg-light-primary);
}

.video-participant-button:disabled {
  cursor: default;
  opacity: 1;
}

.video-participant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-participant-button i {
  flex: 0 0 auto;
  display: block;
  font-size: 24px;
}

.bottom-footer {
  z-index: 50;
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: var(--footer-height);
  height: var(--footer-height);
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--bg-light-primary);
  border-top: 1px solid var(--divider-dark);
}

.footer-edge-button,
.footer-media-button,
.icon-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--action-gray);
  line-height: 1;
}

.footer-edge-button {
  width: 48px;
  height: 48px;
  font-size: 42px;
}

.footer-edge-button:last-child {
  justify-self: end;
}

.footer-media-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.footer-media-button {
  width: 46px;
  height: 46px;
  position: relative;
  font-size: 38px;
  overflow: visible;
}

.mic-warning-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 18px);
  z-index: 1000;
  transform: translateX(-50%);
  display: block;
  width: max-content;
  max-width: min(88vw, 420px);
  padding: 14px 20px;
  border: 1px solid var(--divider-light);
  border-radius: 18px;
  background: var(--bg-light-primary);
  color: var(--action-gray);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.28));
}

.mic-warning-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 16px;
  height: 16px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid var(--divider-light);
  border-bottom: 1px solid var(--divider-light);
  background: var(--bg-light-primary);
}

.icon-button {
  width: 34px;
  height: 34px;
  font-size: 30px;
}

.footer-media-button.enabled,
.footer-media-button.active,
.icon-button.enabled,
.icon-button.active {
  color: var(--action-enabled);
}

.footer-media-button:disabled,
.footer-edge-button:disabled,
.icon-button:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.footer-edge-button i,
.footer-media-button i,
.icon-button i,
.send-button i,
.device-summary i,
.participant-media-icon i {
  position: relative;
  z-index: 1;
  display: block;
}

.settings-panel {
  flex: 0 0 auto;
  background: var(--bg-light-secondary);
  border-bottom: 1px solid var(--divider-dark);
}

.device-summary,
.nickname-settings-row {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-light-primary);
  border-bottom: 1px solid var(--divider-dark);
  text-align: left;
}

.device-summary span:first-child,
.nickname-settings-row > span {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
}

.device-summary span:nth-child(2),
.nickname-footer-button {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-summary i {
  color: var(--action-gray);
  transform: rotate(0deg);
  transition: transform 180ms ease;
}

.device-summary.expanded i {
  transform: rotate(180deg);
}

.device-list {
  display: grid;
  max-height: 188px;
  overflow: auto;
  background: var(--bg-light-secondary);
}

.device-list.collapsed {
  display: none;
}

.device-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.device-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 300;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nickname-inline-input,
.room-title-input {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--divider-light);
  outline: none;
  background: var(--bg-light-primary);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 300;
  padding: 0 8px;
}

.current-channel {
  flex: 0 0 auto;
  max-height: 34vh;
  overflow: auto;
  padding: 14px 16px 16px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--divider-dark);
}

.current-channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.room-emoji {
  flex: 0 0 auto;
  font-size: 20px;
}

.editable-room-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.current-participants {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.participant-row {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
}

.participant-row .nickname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-media-icon {
  color: var(--action-gray);
  text-align: center;
  font-size: 20px;
}

.volume-slider {
  width: 116px;
  accent-color: var(--action-gray);
}

.channel-list {
  min-height: max-content;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.rooms-list {
  margin-top: auto;
}

.create-private-room-row {
  padding: 24px 28px 10px;
  background: var(--bg-light-secondary);
}

.menu-text-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 18px;
  border: 1px solid var(--divider-light);
  border-radius: 999px;
  background: var(--bg-light-primary);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.menu-text-button.danger {
  color: var(--text-primary);
}

.private-room-menu {
  display: grid;
  gap: 14px;
  padding: 22px 28px 28px;
  background: var(--bg-light-secondary);
}

.private-room-label,
.private-room-expiry {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.private-room-link {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.35;
}

.room-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-height: 94px;
  padding: 16px 28px;
  background: var(--bg-light-primary);
  border-bottom: 1px solid var(--divider-dark);
  cursor: pointer;
  outline: none;
  transition:
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.room-list-item.active {
  background: var(--bg-dark);
}

.room-list-item:not(.active):hover {
  background: #1b1b20;
}

.room-list-item.active:hover {
  background: var(--bg-light-secondary);
}

.room-list-item.active:has(.volume-slider:hover) {
  background: var(--bg-dark);
}

.room-list-item.busy {
  cursor: wait;
  opacity: 0.7;
}

.room-list-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--action-gray);
}

.room-list-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
}

.room-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-action {
  align-self: center;
  color: var(--action-yellow);
  font-size: 18px;
  font-weight: 900;
}

.text-action.danger {
  color: var(--action-disabled);
}

.room-participants {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-left: 50px;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
}

.active-room-participants {
  padding-left: 0;
  padding-top: 8px;
}

.empty-text {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 100;
}

.chat-panel-header {
  flex: 0 0 auto;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--bg-light-primary);
  border-bottom: 1px solid var(--divider-dark);
}

.chat-panel-header h1 {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
  background: var(--bg-dark);
  scroll-behavior: smooth;
}

.chat-footer {
  flex: 0 0 auto;
  min-height: 52px;
  max-height: 30dvh;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 7px 14px;
  background: var(--bg-light-primary);
  border-top: 1px solid var(--divider-dark);
}

.chat-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 36px;
  min-height: 36px;
  max-height: min(30dvh, 220px);
  overflow-y: hidden;
  resize: none;
  border: 0;
  outline: none;
  border-radius: 0;
  padding: 8px 10px;
  background: var(--bg-light-primary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 300;
  line-height: 20px;
}

.chat-input::placeholder {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 300;
}

.chat-input:disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 1;
}

.send-button {
  width: 36px;
  height: 36px;
  font-size: 34px;
}

.send-button.enabled {
  color: var(--action-enabled);
}

.chat-day-separator {
  align-self: center;
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 100;
  text-align: center;
}

.chat-message {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 4px;
}

.chat-message.compact {
  margin-top: -6px;
}

.chat-author {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
}

.chat-message-line {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}

.chat-bubble {
  min-width: 0;
  max-width: calc(100% - 64px);
  padding: 8px 12px;
  border-radius: 0 8px 8px 8px;
  background: var(--bg-light-primary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 300;
  line-height: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-time {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 100;
  line-height: 20px;
}

.debug-panel {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  width: min(520px, calc(100vw - 24px));
  max-height: 50vh;
  overflow: auto;
  background: rgba(18, 18, 20, 0.94);
  border: 1px solid var(--divider-light);
  color: var(--text-secondary);
  font-size: 13px;
}

.debug-panel summary {
  padding: 8px 10px;
}

.debug-log {
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-status {
  display: block;
  padding: 0 10px 10px;
}

.new-room-page {
  overflow: auto;
}

.new-room-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-dark);
}

.new-room-panel {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--divider-light);
  border-radius: 8px;
  background: var(--bg-light-secondary);
  text-align: center;
}

.new-room-panel h1 {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
}

.new-room-status {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  :root {
    --menu-width: 390px;
    --chat-width: 390px;
  }

  .room-list-item {
    padding-right: 22px;
    padding-left: 22px;
  }

  .create-private-room-row,
  .private-room-menu {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 900px) {
  :root {
    --footer-height: 64px;
  }

  .app-shell {
    min-height: 100svh;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) var(--footer-height);
    height: 100svh;
  }

  .video-stage {
    grid-column: 1;
  }

  .side-panel {
    position: fixed;
    top: 0;
    bottom: var(--footer-height);
    width: min(78vw, 535px);
    max-width: 535px;
    border: 0;
  }

  .panel-channels {
    left: 0;
    transform: translateX(-100%);
  }

  .panel-chat {
    right: 0;
    width: 100vw;
    max-width: none;
    transform: translateX(100%);
  }

  .app-shell.layout-compact.menu-open .workspace-backdrop,
  .app-shell.layout-compact.chat-open .workspace-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  .video-grid {
    margin: 20px 16px 8px;
  }

  .video-footer {
    max-height: 132px;
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .video-participant-button {
    max-width: 190px;
  }

  .bottom-footer {
    padding: 0 22px;
  }

  .footer-edge-button {
    width: 48px;
    height: 48px;
  }

  .footer-media-actions {
    gap: 12px;
  }

  .footer-media-button {
    width: 42px;
    height: 42px;
    font-size: 36px;
  }

  .mic-warning-bubble {
    bottom: calc(100% + 16px);
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 20px;
  }

  .screen-volume-slider {
    width: min(104px, 30vw);
  }

  .chat-footer {
    max-height: 24dvh;
  }

  .chat-input {
    max-height: min(24dvh, 160px);
  }
}

@media (max-width: 520px) {
  .side-panel {
    width: min(82vw, 535px);
  }

  .panel-chat {
    width: 100vw;
    max-width: none;
  }

  .device-summary,
  .nickname-settings-row {
    grid-template-columns: 92px minmax(0, 1fr) 34px;
    padding: 0 14px;
  }

  .current-channel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .room-list-item {
    min-height: 94px;
    padding: 16px 18px;
  }

  .create-private-room-row,
  .private-room-menu {
    padding-right: 18px;
    padding-left: 18px;
  }

  .room-list-title {
    font-size: 24px;
  }

  .room-participants {
    padding-left: 58px;
  }

  .video-grid {
    margin: 20px 74px 8px;
  }

  .join-hint {
    width: calc(100% - 32px);
    font-size: 20px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .video-footer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .video-participant-button {
    max-width: 190px;
    padding: 0 12px;
  }

  .bottom-footer {
    padding: 0 26px;
  }
}
