:root {
  color-scheme: dark;
  --bg: #0c0c0e;
  --panel: #161618;
  --panel-border: rgba(255, 255, 255, 0.06);
  --text: #ececf0;
  --text-secondary: #8e8e96;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-green: #22c55e;
  --accent-text: #fff;
  --danger: #ef4444;
  --surface: #1c1c20;
  --border: rgba(255, 255, 255, 0.08);
  --radius-pill: 9999px;
  --radius-md: 12px;
  --radius-sm: 6px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px;
}

h1, h2, h3 {
  margin: 0 0 8px;
  font-weight: 700;
}

h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--text-secondary); }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-block: 16px;
}

button {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

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

button.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover:not(:disabled) {
  background: #252528;
}

button.danger {
  background: var(--danger);
}

button.success {
  background: var(--accent-green);
  color: #061510;
}

label {
  display: grid;
  gap: 6px;
  margin-block-start: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

input, select {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

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

input[readonly] {
  opacity: 0.7;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-block-start: 6px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.status-grid dt {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-grid dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.notice {
  color: var(--text-secondary);
  font-size: 14px;
}

.warning {
  color: var(--danger);
}

.entity-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.entity-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.guest-scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-block-start: 12px;
}

.guest-scene-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.guest-scene-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  background: #000;
}

.guest-scene-card > span {
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
}

.guest-scene-card > button {
  margin: 0 14px 12px;
  align-self: flex-start;
}

.control-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.audio-meter {
  height: 6px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex: 1;
}

.audio-meter-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.1s ease;
}
