:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0d1117;
  color: #eef2f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 111, 235, 0.14), transparent 32rem),
    linear-gradient(225deg, rgba(46, 160, 67, 0.12), transparent 30rem),
    #0d1117;
}

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

.shell {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 40px 0 22px;
}

.screen {
  min-height: calc(100vh - 80px);
}

#host,
#viewer {
  min-height: calc(100vh - 80px);
}

.hidden {
  display: none;
}

.footer {
  width: min(1040px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 0 0 18px;
  color: #8b949e;
  font-size: 12px;
  text-align: center;
}

body:has(#viewer:not(.hidden)) .footer {
  display: none;
}

.brand,
.loginHeader {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  min-height: calc(100vh - 180px);
}

.mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #238636;
  color: white;
  font-size: 34px;
  font-weight: 800;
}

.loginPanel {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  display: grid;
  align-content: center;
  gap: 28px;
}

.loginHeader h1 {
  font-size: 42px;
  line-height: 1;
}

.loginHeader p {
  margin-top: 6px;
}

.authForm,
.sessionForm,
.settingsForm {
  display: grid;
  gap: 12px;
}

.authForm label,
.sessionForm label,
.settingsForm label {
  display: grid;
  gap: 8px;
  color: #aab4bf;
  font-weight: 700;
}

.sessionForm {
  grid-template-columns: minmax(240px, 1.25fr) minmax(160px, 0.9fr) minmax(160px, 0.9fr) auto;
  align-items: end;
  width: min(920px, 100%);
  margin-top: 14px;
}

.dashboardHero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  border-top: 1px solid #30363d;
  border-bottom: 1px solid #30363d;
  padding: 22px 0;
}

.dashboardHero h1 {
  font-size: 34px;
  line-height: 1.05;
}

.dashboardHero p {
  margin-top: 6px;
  font-size: 14px;
}

.sessionForm label {
  gap: 6px;
  font-size: 13px;
}

.sessionForm input,
.sessionForm select {
  height: 44px;
  margin-top: 0;
  padding: 10px 12px;
}

.sessionForm button {
  height: 44px;
  min-height: 44px;
  padding: 10px 14px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #30363d;
  margin-bottom: 20px;
}

.tab {
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #aab4bf;
  border: 1px solid transparent;
  border-bottom: 0;
}

.tab.active {
  color: #eef2f5;
  background: rgba(22, 27, 34, 0.86);
  border-color: #30363d;
}

.tabPanel {
  min-height: 220px;
}

.settingsPanel {
  border: 1px solid #30363d;
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.86);
  padding: 18px;
  width: min(560px, 100%);
}

.settingsForm {
  margin-top: 14px;
}

.checkboxLabel {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkboxLabel input {
  width: auto;
  margin: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.95;
}

h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

p {
  color: #aab4bf;
  margin-top: 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0 24px;
}

.adminTopbar {
  padding-bottom: 12px;
}

.topbar span {
  display: block;
  color: #8b949e;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  border: 1px solid #30363d;
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.86);
  padding: 18px;
}

.hint {
  min-height: 42px;
  font-size: 14px;
}

.micStatus {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}

.headerMicStatus {
  margin-top: 6px;
}

.micStatus span {
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 5px 9px;
  color: #aab4bf;
  background: #0b0f15;
  font-size: 12px;
  font-weight: 700;
}

.headerMicStatus span {
  padding: 3px 8px;
  font-size: 11px;
  background: rgba(11, 20, 26, 0.72);
}

.micStatus .active {
  color: #d8ffe0;
  border-color: #238636;
}

.micStatus .error {
  color: #ffd8d8;
  border-color: #f85149;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 16px;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 14px;
  background: #0b0f15;
  color: #eef2f5;
  outline: none;
}

input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #eef2f5;
  box-shadow: 0 0 0 1000px #0b0f15 inset;
  caret-color: #eef2f5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #58a6ff;
}

textarea {
  resize: vertical;
}

.linkBox {
  margin-bottom: 16px;
}

.sessionSummary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.sessionSummary div {
  border: 1px solid #30363d;
  border-radius: 8px;
  background: rgba(22, 27, 34, 0.72);
  padding: 12px;
}

.sessionSummary span {
  display: block;
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.sessionSummary strong {
  color: #eef2f5;
}

.viewerInfo {
  margin-top: 8px;
}

.linkBox label {
  display: block;
  color: #8b949e;
  font-size: 13px;
  font-weight: 700;
}

.linkBox input {
  margin-top: 8px;
}

.notice {
  min-height: 22px;
  color: #f0b72f;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.actions.compact {
  margin-top: 0;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
}

.primary {
  background: #238636;
  color: white;
}

.secondary {
  background: #21262d;
  color: #eef2f5;
  border: 1px solid #30363d;
}

.captions {
  display: grid;
  gap: 10px;
  min-height: 220px;
  align-content: start;
}

.chatShell {
  width: min(760px, 100%);
  height: calc(100vh - 96px);
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid #202c33;
  border-radius: 10px;
  background:
    radial-gradient(circle at 10px 10px, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 24px 22px, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 32px),
    #0b141a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.hostChatShell {
  height: calc(100vh - 168px);
  min-height: 560px;
  grid-template-rows: auto auto 1fr auto;
}

.chatHeader {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  background: #111b21;
  border-bottom: 1px solid #202c33;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  background: #0b141a;
  border: 1px solid #2a3942;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chatHeaderText {
  min-width: 0;
}

.chatHeaderText strong {
  display: block;
  color: #eef2f5;
  font-size: 18px;
  line-height: 1.2;
}

.chatHeaderText span {
  display: inline-block;
  color: #8b949e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peopleStatus {
  justify-self: end;
  margin-left: 0;
  padding: 2px 8px;
  border: 1px solid #2a3942;
  border-radius: 999px;
  background: rgba(11, 20, 26, 0.68);
  color: #c5d1d8;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.peopleStatus::before {
  content: "👤";
  margin-right: 4px;
}

.chatHeader > .status {
  justify-self: end;
  white-space: nowrap;
}

.chatLink {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(17, 27, 33, 0.92);
  border-bottom: 1px solid #202c33;
}

.chatLink span {
  color: #8b949e;
  font-size: 12px;
  font-weight: 700;
}

.chatLink input {
  height: 38px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 999px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 22px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(134, 150, 160, 0.55) transparent;
  scrollbar-width: thin;
}

.chat.empty {
  justify-content: center;
  align-items: center;
}

.chat::-webkit-scrollbar {
  width: 8px;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(134, 150, 160, 0.45);
  border-radius: 999px;
}

.chatSpacer {
  flex: 1 1 auto;
  min-height: 0;
}

.chatMessage {
  position: relative;
  max-width: min(78%, 560px);
  padding: 7px 10px 6px;
  border-radius: 8px;
  background: #202c33;
  color: #e9edef;
  border: 0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.chatMessage.own {
  align-self: flex-end;
}

.chatMessage.other {
  align-self: flex-start;
}

.chatMessage.host {
  background: #075e8d;
}

.chatMessage.guest {
  background: #075e54;
}

.typingBubble {
  width: fit-content;
  color: rgba(233, 237, 239, 0.72);
  font-style: italic;
}

.chatMeta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(233, 237, 239, 0.76);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
}

.chatMeta time {
  color: rgba(233, 237, 239, 0.62);
  font-weight: 600;
}

.chatPrimary {
  font-weight: 500;
  line-height: 1.3;
  font-size: 17px;
}

.chatSecondary {
  margin-top: 4px;
  color: rgba(233, 237, 239, 0.72);
  font-size: 0.92em;
  opacity: 0.78;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 46px;
  gap: 8px;
  align-items: end;
  padding: 8px 14px 12px;
  background: #111b21;
  border-top: 1px solid #202c33;
}

.composer textarea {
  min-height: 46px;
  max-height: 120px;
  margin: 0;
  resize: none;
  border-radius: 22px;
  background: #202c33;
  border-color: #202c33;
  padding: 12px 15px;
}

.composer button {
  border-radius: 999px;
  min-height: 46px;
}

.iconButton,
.sendButton {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.sendButton {
  background: #238636;
  font-size: 24px;
  padding-left: 2px;
}

.iconButton.recording {
  color: #ffd8d8;
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.16);
}

.caption time {
  display: block;
  color: #8b949e;
  font-size: 12px;
  margin-bottom: 4px;
}

.empty {
  color: #8b949e;
}

.status {
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 6px 10px;
}

@media (max-width: 760px) {
  .brand,
  .loginHeader,
  .topbar,
  .actions,
  .dashboardHero {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .sessionForm,
  .sessionSummary {
    grid-template-columns: 1fr;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .screen,
  #host,
  #viewer {
    min-height: 100vh;
  }

  .adminTopbar {
    padding: 10px 12px;
  }

  .chatShell,
  .hostChatShell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .chatLink {
    grid-template-columns: 1fr;
  }

  .chatMessage {
    max-width: 84%;
  }

  .chatHeader {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 68px;
    row-gap: 7px;
    column-gap: 10px;
    padding: 9px 12px 10px;
  }

  .chatHeaderText {
    grid-column: 2;
    align-self: center;
  }

  .headerMicStatus {
    grid-column: 2 / 4;
    grid-row: 2;
    align-self: start;
    justify-content: flex-start;
    margin-top: 0;
  }

  .peopleStatus,
  .chatHeader > .status {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .avatar {
    grid-row: 1 / 3;
    align-self: start;
    width: 38px;
    height: 38px;
    margin-top: 2px;
  }

  .chatHeaderText strong {
    font-size: 20px;
    line-height: 1.05;
  }

  .chatHeaderText span {
    font-size: 16px;
    line-height: 1.15;
  }

  .chat {
    padding: 12px 10px 14px;
  }

  .micStatus {
    gap: 5px;
  }

  .micStatus span {
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 7px;
    font-size: 10px;
  }

  .status,
  .peopleStatus {
    padding: 4px 8px;
    font-size: 12px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 7px;
    padding: 8px 10px 10px;
  }

  .composer textarea {
    min-height: 44px;
    padding: 11px 14px;
  }

  .composer button,
  .iconButton,
  .sendButton {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .loginPanel {
    align-content: start;
    padding-top: 48px;
  }
}
