:root {
  color-scheme: dark;
  --bg: #060b13;
  --bg-top: #0b1424;
  --panel: #0e1727;
  --panel-strong: #111d31;
  --text: #edf4ff;
  --muted: #96a7bc;
  --accent: #38bdf8;
  --accent-strong: #2563eb;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --border: rgba(148, 163, 184, 0.18);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.14);
  --neutral-bg: rgba(148, 163, 184, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 360px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16) 0%, transparent 34%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18) 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  color: var(--text);
  font: 13px/1.4 "Avenir Next", "Segoe UI", sans-serif;
}

.popup {
  padding: 16px;
}

.hero {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.15;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.subtle {
  color: var(--muted);
}

.panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 29, 49, 0.92) 0%, rgba(10, 18, 32, 0.94) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.debug-panel summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.debug-output {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(8, 15, 28, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.status.neutral {
  background: var(--neutral-bg);
  color: #d7e3f3;
}

.status.good {
  background: var(--success-bg);
  color: var(--success);
}

.status.warn {
  background: var(--warning-bg);
  color: var(--warning);
}

.summary {
  margin-top: 10px;
}

.warning {
  margin-top: 10px;
  color: var(--warning);
}

.update-banner {
  border-color: rgba(251, 191, 36, 0.2);
  background: linear-gradient(180deg, rgba(42, 28, 7, 0.92) 0%, rgba(21, 16, 9, 0.94) 100%);
}

.update-banner .summary {
  color: #f8e7b3;
}

.scene-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.scene-item {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.scene-item strong {
  display: block;
  font-size: 12px;
}

.scene-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.toggle,
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.field input,
button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 15, 28, 0.9);
  color: var(--text);
  font: inherit;
}

.field input {
  width: 72px;
  padding: 6px 8px;
  text-align: right;
}

button {
  cursor: pointer;
  padding: 8px 12px;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

button:hover {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 23, 39, 0.96);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  width: 100%;
  margin-top: 12px;
  border-color: rgba(56, 189, 248, 0.22);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #eff6ff;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

button.primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

input[type="number"] {
  color-scheme: dark;
}
