:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #111;
  --panel-2: #181818;
  --text: #f6f0d2;
  --muted: rgba(246, 240, 210, 0.62);
  --line: rgba(246, 240, 210, 0.13);
  --accent: #fecc1e;
  --good: #46d486;
  --warn: #ffb84d;
  --bad: #ff5c5c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 36px;
  padding: 0 14px;
}

button.secondary {
  background: var(--panel-2);
  color: var(--text);
  outline: 1px solid var(--line);
}

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

.studio-shell {
  display: grid;
  grid-template-rows: 56px 1fr;
  height: 100%;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #0b0b0b;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand strong {
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badges {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.badge {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  white-space: nowrap;
}

.badge::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 7px;
  width: 7px;
}

.badge[data-state="active"],
.badge[data-state="recording"],
.badge[data-state="connected"],
.badge[data-state="complete"],
.badge[data-state="started"] {
  color: var(--good);
}

.badge[data-state="starting"],
.badge[data-state="uploading"],
.badge[data-state="waiting"],
.badge[data-state="idle"] {
  color: var(--warn);
}

.badge[data-state="error"],
.badge[data-state="left"],
.badge[data-state="stopped"] {
  color: var(--bad);
}

.actions {
  display: flex;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 0;
}

.frame-wrap {
  background: #000;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.call-frame {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.side-panel {
  background: #0d0d0d;
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 16px;
}

.session-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.session-title h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.session-title p,
.logline {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.status-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
  overflow: auto;
}

.status-row {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-width: 0;
  padding-bottom: 10px;
}

.status-row span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.status-row span:last-child {
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error {
  color: var(--bad);
}

.clean-shell,
.recorder-shell {
  height: 100%;
  position: relative;
  width: 100%;
}

.clean-shell .call-frame,
.recorder-shell .call-frame {
  height: 100vh;
  width: 100vw;
}

.clean-overlay,
.recorder-overlay {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(254, 204, 30, 0.32);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  left: 16px;
  padding: 9px 11px;
  position: absolute;
  top: 16px;
  transition: opacity 240ms ease;
  z-index: 10;
}

.clean-overlay[data-quiet="true"] {
  opacity: 0;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 92px;
    padding: 10px 12px;
  }

  .studio-shell {
    grid-template-rows: auto 1fr;
  }

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

  .side-panel {
    display: none;
  }

  .actions {
    overflow-x: auto;
  }
}
