:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #111722;
  --panel-soft: #161e2b;
  --line: #263244;
  --text: #f6f8fb;
  --muted: #8f9bad;
  --accent: #6df08c;
  --accent-dark: #07170c;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 75% 0%, #172533 0, transparent 34rem),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.landing {
  width: min(1160px, calc(100% - 40px));
  margin: auto;
  padding: 36px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 4px solid var(--accent);
  border-radius: 5px 5px 5px 1px;
  transform: rotate(-10deg);
}

.hero {
  padding: 10vh 0 7vh;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
}

.hero h1 span {
  color: transparent;
  -webkit-text-stroke: 1px #6d7785;
}

.lead {
  max-width: 620px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.mode-card {
  position: relative;
  min-height: 330px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, #141b27, #0d121b);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: #536176;
}

.mode-card.primary {
  color: var(--accent-dark);
  background: var(--accent);
  border-color: var(--accent);
}

.card-number {
  position: absolute;
  top: 28px;
  right: 30px;
  font-size: 0.8rem;
  opacity: 0.55;
}

.mode-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 52px;
  border: 2px solid currentColor;
  opacity: 0.8;
}

.phone-icon {
  width: 38px;
  border-radius: 10px;
}

.screen-icon {
  border-radius: 7px;
}

.mode-card h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.mode-card p {
  max-width: 380px;
  margin: 0;
  line-height: 1.5;
  opacity: 0.68;
}

.action {
  position: absolute;
  right: 34px;
  bottom: 30px;
  left: 34px;
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid currentColor;
  font-weight: 750;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 2px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 40px));
  margin: auto;
  padding: 26px 0;
}

.header-actions,
.viewer-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-button {
  min-width: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text);
  cursor: pointer;
  background: rgba(8, 11, 18, 0.75);
  font-size: 0.72rem;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  background: rgba(8, 11, 18, 0.65);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #687488;
}

.status-pill.online i,
.online i {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 24px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto 40px;
}

.video-shell {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #030507;
}

.video-shell video,
.viewer-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-shell.portrait video {
  transform: scaleX(-1);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}

.video-placeholder .mode-icon {
  margin: 0 0 20px;
}

.live-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 11px;
  border-radius: 7px;
  color: white;
  background: #ed3d51;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.control-panel {
  align-self: center;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17, 23, 34, 0.92);
}

.control-panel h1,
.connect-card h1 {
  margin: 0 0 38px;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

label {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: #090d14;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input:focus {
  border-color: var(--accent);
}

.room-row,
.button-row {
  display: flex;
  gap: 9px;
}

.icon-button,
.main-button,
.secondary-button {
  cursor: pointer;
  border: 0;
  font-weight: 800;
}

.icon-button {
  width: 58px;
  flex: 0 0 58px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 1.4rem;
}

.main-button {
  width: 100%;
  margin-top: 26px;
  padding: 17px 20px;
  border-radius: 11px;
  color: var(--accent-dark);
  background: var(--accent);
}

.secondary-button {
  flex: 1;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: transparent;
}

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

.hint,
.secure-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.secure-note {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.viewer-page {
  overflow: hidden;
  background: #000;
}

.viewer-video-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.receiver-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 75% 10%, #172533 0, transparent 38rem),
    var(--bg);
}

.viewer-header {
  position: absolute;
  top: 28px;
  right: 32px;
  left: 32px;
  justify-content: space-between;
}

.connect-card {
  width: min(460px, calc(100% - 32px));
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.viewer-tools {
  position: absolute;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
}

.secondary-button.compact {
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 13px;
  background: rgba(8, 11, 18, 0.75);
}

.account-badge {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 11, 18, 0.75);
  font-size: 0.72rem;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.admin-page {
  min-height: 100vh;
}

.admin-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 5vh auto 60px;
}

.auth-card {
  width: min(480px, 100%);
  margin: 8vh auto;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17, 23, 34, 0.94);
}

.auth-card h1,
.dashboard-heading h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.auth-description,
.dashboard-heading p,
.invite-panel p,
.empty-state p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-card label:not(:first-of-type) {
  margin-top: 18px;
}

.form-error {
  margin: 16px 0 0;
  color: #ff7f8e;
  font-size: 0.85rem;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.dashboard-heading p {
  max-width: 650px;
  margin-bottom: 0;
}

.create-button {
  width: auto;
  min-width: 190px;
  margin: 0;
}

.create-session-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.create-session-actions .secondary-button {
  margin: 0;
}

.team-panel {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 23, 34, 0.75);
}

.team-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.team-panel-heading h2 {
  margin: 4px 0;
  font-size: 1.5rem;
}

.team-panel-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.user-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.user-form input {
  margin: 0;
}

.user-form .main-button {
  width: auto;
  margin: 0;
}

.user-form .form-error {
  grid-column: 1 / -1;
  margin: 0;
}

.user-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid #263142;
  border-radius: 12px;
  background: #0b1018;
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.user-card b {
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.danger-button {
  padding: 9px 12px;
  border: 1px solid rgba(255, 92, 112, 0.45);
  border-radius: 9px;
  color: #ff8c9a;
  background: rgba(255, 92, 112, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 24px;
  border: 1px solid rgba(109, 240, 140, 0.5);
  border-radius: 16px;
  background: rgba(20, 62, 34, 0.36);
}

.upload-panel strong,
.upload-panel span {
  display: block;
}

.upload-panel span {
  overflow: hidden;
  margin-top: 4px;
  color: #9fb2a5;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #202a37;
}

.upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 120ms linear;
}

.upload-panel b {
  min-width: 44px;
  color: var(--accent);
  font-size: 0.82rem;
  text-align: right;
}

.invite-panel {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 42px;
  align-items: center;
  margin-bottom: 24px;
  padding: 30px;
  border: 1px solid #3da95a;
  border-radius: 20px;
  color: var(--accent-dark);
  background: var(--accent);
}

.public-url-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 23, 34, 0.75);
}

.phone-link-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(109, 240, 140, 0.5);
  border-radius: 16px;
  background: rgba(20, 62, 34, 0.36);
}

.phone-link-panel strong,
.phone-link-panel span {
  display: block;
}

.phone-link-panel span {
  margin-top: 4px;
  color: #9fb2a5;
  font-size: 0.78rem;
}

.phone-link-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.phone-link-actions input {
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
}

.phone-link-actions .main-button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.public-url-panel strong,
.public-url-panel span {
  display: block;
}

.public-url-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.public-url-panel input {
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}

.field-error {
  grid-column: 2;
  margin: -14px 0 0;
  color: #ff7f8e;
  font-size: 0.76rem;
}

.invite-panel h2 {
  margin: 5px 0 0;
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.invite-panel p {
  margin-bottom: 0;
  color: rgba(7, 23, 12, 0.65);
}

.panel-kicker {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-actions input {
  color: var(--text);
  background: rgba(7, 23, 12, 0.86);
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
}

.invite-actions .main-button {
  color: var(--text);
  background: var(--accent-dark);
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 4px 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.session-section-heading b,
.session-archive summary b {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 100px;
  color: var(--accent-dark);
  background: var(--accent);
  font-size: 0.7rem;
}

.session-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 25px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 23, 34, 0.88);
}

.session-card-ended {
  overflow: hidden;
  border-color: #242b36;
  color: #707987;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 12px,
      rgba(255, 255, 255, 0.012) 12px,
      rgba(255, 255, 255, 0.012) 24px
    ),
    rgba(11, 15, 22, 0.78);
}

.session-card-ended::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  content: "";
  background: #505967;
}

.session-card-ended h2 {
  color: #8a929e;
  text-decoration: line-through;
  text-decoration-color: #4e5662;
}

.session-card h2 {
  margin: 9px 0 16px;
  font-size: 1.2rem;
}

.session-status,
.connection-grid span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.session-status i,
.connection-grid i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #596477;
}

.session-status.live,
.session-status.ready,
.connection-grid .connected {
  color: var(--accent);
}

.session-status.live i,
.session-status.ready i,
.connection-grid .connected i {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(109, 240, 140, 0.6);
}

.session-status.ended {
  color: #949ca8;
}

.session-status.ended i {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1px solid #646d7a;
  background: transparent;
}

.session-status.ended i::before,
.session-status.ended i::after {
  position: absolute;
  top: 5px;
  left: 2px;
  width: 7px;
  height: 1px;
  content: "";
  background: #7d8693;
  transform: rotate(45deg);
}

.session-status.ended i::after {
  transform: rotate(-45deg);
}

.connection-grid {
  display: flex;
  gap: 18px;
}

.ended-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #68717e;
  font-size: 0.76rem;
  font-weight: 700;
}

.ended-summary span::before {
  margin-right: 6px;
  content: "×";
}

.ended-summary time {
  color: #555e6b;
}

.session-archive {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.session-archive summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 4px 8px;
  color: #717b89;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
}

.session-archive summary::-webkit-details-marker {
  display: none;
}

.session-archive summary::before {
  content: "›";
  font-size: 1.3rem;
  transition: transform 160ms ease;
}

.session-archive[open] summary::before {
  transform: rotate(90deg);
}

.session-archive summary b {
  color: #9aa2ad;
  background: #242b35;
}

.archive-list {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.session-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.session-actions .main-button,
.session-actions .secondary-button {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.open-viewer {
  display: inline-block;
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-content: center;
  justify-items: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
}

.empty-state .mode-icon {
  margin: 0 0 18px;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
}

.access-state {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #090d14;
}

.access-state > i {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #6e7889;
}

.access-state strong,
.access-state span {
  display: block;
}

.access-state span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.access-state.valid {
  border-color: rgba(109, 240, 140, 0.45);
}

.access-state.valid > i {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.access-state.invalid {
  border-color: rgba(255, 92, 112, 0.5);
}

.access-state.invalid > i {
  background: #ff5c70;
}

.receiver-loader {
  width: 32px;
  height: 32px;
  margin: 0 0 18px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 800px) {
  .team-panel-heading,
  .user-card {
    align-items: stretch;
    flex-direction: column;
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  .create-session-actions,
  .create-session-actions .create-button {
    width: 100%;
  }

  .upload-panel {
    grid-template-columns: 1fr auto;
  }

  .upload-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hero {
    padding: 8vh 0 5vh;
  }

  .mode-grid,
  .studio {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 290px;
  }

  .studio {
    width: min(100% - 24px, 620px);
  }

  .studio-header {
    width: calc(100% - 24px);
  }

  .video-shell {
    min-height: 56vh;
  }

  .control-panel {
    padding: 28px 22px;
  }

  footer {
    flex-direction: column;
    gap: 8px;
  }

  .dashboard-heading,
  .session-card {
    align-items: stretch;
    flex-direction: column;
  }

  .create-button {
    width: 100%;
  }

  .invite-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .public-url-panel {
    grid-template-columns: 1fr;
  }

  .field-error {
    grid-column: 1;
  }

  .phone-link-panel,
  .phone-link-actions {
    grid-template-columns: 1fr;
  }

  .phone-link-actions .main-button {
    width: 100%;
  }

  .session-actions {
    display: grid;
  }

  .session-actions .main-button,
  .session-actions .secondary-button {
    width: 100%;
  }
}
