/* Chloe's CEO Command Center: the admin site. "Plum" theme: plain, flat components on a near-black, slightly plum
   page, with pink kept for actions and highlights. The wheel itself keeps its own look (wheel-view.css), and the
   effect previews are the real overlay page, so neither is styled here. Fonts come from theme.css. */
:root {
  color-scheme: dark;
  --font-ui: 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
  --font-brand: 'Caveat Brush', cursive;
  --font-mono: Consolas, 'Cascadia Mono', ui-monospace, monospace;

  --bg: #0f0e13;
  --surface: #16151c;
  --surface-2: #1d1c25;
  --surface-3: #262530;
  --border: #2a2934;
  --border-strong: #3a3946;
  --border-hover: #4b4a59;
  --text: #f3f1f8;
  --text-2: #a9a6b8;
  --text-3: #75728a;
  --accent: #ff7ab8;
  --accent-hover: #ff8fc4;
  --accent-ink: #2a0b1b;
  --accent-soft: rgb(255 122 184 / 0.12);
  --violet: #b6a3ff;
  --ok: #6fe3a6;
  --warn: #fbc15e;
  --bad: #ff7d88;

  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 240px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font-ui);
}
h1,
h2,
h3,
p {
  margin: 0;
}
b,
strong {
  font-weight: 600;
}
h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h2 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}
h3 {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  font: 0.9em var(--font-mono);
}
.muted {
  color: var(--text-2);
}
.center {
  text-align: center;
}
.small-print {
  font-size: 12px;
  color: var(--text-3);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- brand ---- */
.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(#ff6b6b 0 17%, #ffd166 0 33%, #06d6a0 0 50%, #4cc9f0 0 67%, #9b5de5 0 83%, #f78c6b 0);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong);
}
.brand-mark.big {
  width: 64px;
  height: 64px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border-strong);
}
.brand-name {
  font: 400 26px/1 var(--font-brand);
}
.brand-name small {
  display: block;
  margin-top: 4px;
  font: 650 10.5px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- login ---- */
.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
}
.login-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(100%, 380px);
  padding: 36px 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}
.login-card .brand-name {
  font-size: 40px;
}

/* ---- app shell: sidebar + page ---- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 18px;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav-label {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font: 500 14px var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.tab[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.tab[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 99px;
  background: rgb(251 193 94 / 0.14);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 650;
}
.sidebar-foot {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px 6px 2px;
  border-top: 1px solid var(--border);
}
.health {
  display: grid;
  gap: 6px;
}
.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.health-label {
  color: var(--text-3);
}
.health .pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--violet);
  color: #1b1240;
  font-size: 12px;
  font-weight: 700;
}
.who {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.who strong,
.who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who span {
  font-size: 12px;
}
.account .button {
  margin-left: auto;
}

/* ---- pages ---- */
.content {
  min-width: 0;
}
.view {
  display: grid;
  gap: 16px;
  align-content: start;
  max-width: 1320px;
  padding: 24px 28px 110px;
}
.view.narrow {
  max-width: 860px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 4px;
}
.page-head p {
  flex: 1 1 18rem;
  order: 3;
  flex-basis: 100%;
}
.page-head > .button,
.page-head > .row,
.page-head > .pill {
  margin-left: auto;
}

/* ---- cards ---- */
.panel {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head .muted {
  font-size: 12.5px;
}
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.panel.sticky {
  position: sticky;
  top: 24px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.row > input {
  flex: 1 1 14rem;
}

/* ---- pills, tags ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.pill:empty {
  display: none;
}
.pill.ok {
  background: rgb(111 227 166 / 0.12);
  color: var(--ok);
}
.pill.warn {
  background: rgb(251 193 94 / 0.14);
  color: var(--warn);
}
.pill.bad {
  background: rgb(255 125 136 / 0.13);
  color: var(--bad);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- form controls ---- */
input[type='text'],
input[type='number'],
input[type='password'],
select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 14px var(--font-ui);
  font-variant-numeric: tabular-nums;
}
select {
  padding-right: 6px;
}
input::placeholder {
  color: var(--text-3);
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):hover,
select:hover {
  border-color: var(--border-hover);
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):focus,
select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled,
select:disabled {
  opacity: 0.45;
}
input[type='color'] {
  width: 40px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--accent);
}
.field {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.settings {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px;
}
.toggles {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toggle {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 12px;
  cursor: pointer;
}
.toggles .toggle + .toggle {
  border-top: 1px solid var(--border);
}
.toggle:hover {
  background: var(--surface-2);
}
.toggle input {
  /* a switch */
  appearance: none;
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  margin: 1px 0 0;
  border-radius: 99px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  cursor: pointer;
  transition: background 0.15s ease;
}
.toggle input::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s ease, background 0.15s ease;
}
.toggle input:checked {
  background: var(--accent);
  box-shadow: none;
}
.toggle input:checked::after {
  transform: translateX(14px);
  background: var(--accent-ink);
}
.toggle small {
  display: block;
  margin-top: 1px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.sound-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}
.sound-settings .field {
  width: 10rem;
}

/* ---- buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font: 600 13px var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.button:hover {
  border-color: var(--border-hover);
}
.button:active {
  transform: translateY(1px);
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.button.danger {
  border-color: rgb(255 125 136 / 0.35);
  background: transparent;
  color: var(--bad);
}
.button.danger:hover {
  border-color: var(--bad);
  background: rgb(255 125 136 / 0.08);
}
.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}
.button.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.button.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}
.button.big {
  height: 44px;
  padding: 0 28px;
  font-size: 16px;
}
.button.icon {
  width: 32px;
  height: 32px;
  padding: 0;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 12px var(--font-ui);
  cursor: pointer;
}
.link-button:hover {
  text-decoration: underline;
}

/* ---- live page ---- */
.live-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.preview {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
/* createWheelView adds .wheel-view to the container itself, hence the compound selector */
.preview.wheel-view {
  /* admin previews always show the wheel, whatever the overlay setting */
  opacity: 1;
  transform: none;
}
.spin-form {
  display: flex;
  gap: 8px;
}
.spin-form input {
  height: 44px;
}
.live-queue {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.live-queue .panel-head {
  margin-bottom: 8px;
}
/* the queue block draws the divider, so the heading doesn't */
.live-queue h3 {
  margin: 0;
  padding: 0;
  border: 0;
}
.requests {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.request {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.request.is-back {
  border-color: rgb(251 193 94 / 0.45);
  background: linear-gradient(rgb(251 193 94 / 0.05), rgb(251 193 94 / 0.05)), var(--surface-2);
}
.request.is-snoozed {
  background: transparent;
}
.request.is-snoozed .request-text {
  color: var(--text-2);
}
.request-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.request-from {
  margin-right: auto;
  font-size: 13px;
}
.request-text {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.request-input {
  margin: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.request-actions .ghost {
  margin-left: auto;
}
.requests .empty {
  padding: 4px 0;
}
.tests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 8px;
}
.tests > p {
  grid-column: 1 / -1;
}
.test {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.swatch {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 3px;
}
.test-name {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.test-name strong,
.test-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.test-name span {
  font-size: 12px;
}
.test .button {
  margin-left: auto;
}

/* ---- lists and tables ---- */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.list li + li {
  border-top: 1px solid var(--border);
}
.list li:first-child {
  padding-top: 0;
}
.list li > strong {
  flex: none;
}
.list li > .muted:last-child {
  font-size: 12.5px;
  text-align: right;
}
.table-wrap {
  max-height: 60vh;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
tbody tr + tr td {
  border-top: 1px solid var(--border);
}
td.when {
  white-space: nowrap;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
td.detail {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ---- wheel editor ---- */
.segments-head,
.segments li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) 4.8rem 5.5rem 2.6rem 2.2rem;
  gap: 8px;
  align-items: center;
}
.segments-head {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.segments {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.segments li.dragging {
  opacity: 0.35;
}
.segments .button.icon {
  width: 2.2rem;
  height: 36px;
}
.grip {
  color: var(--text-3);
  cursor: grab;
  text-align: center;
  user-select: none;
  letter-spacing: -0.15em;
}
.chance {
  position: relative;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chance::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: var(--seg, var(--accent));
  opacity: 0.22;
  transition: width 0.25s ease;
}
.chance span {
  position: relative;
}
.hub-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.hub-crop {
  width: 9rem;
  height: 9rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-2);
}
.hub-crop canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.hub-crop.is-editing canvas {
  cursor: grab;
}
.hub-crop.is-editing canvas:active {
  cursor: grabbing;
}
.hub-controls {
  display: grid;
  gap: 10px;
}
.practice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

/* ---- rewards ---- */
.rewards-head,
.rewards li {
  display: grid;
  grid-template-columns: minmax(9rem, 1.3fr) 10rem 5rem 10rem minmax(7rem, 1fr) 2.2rem 5.2rem auto;
  gap: 8px;
  align-items: center;
}
.rewards-head {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rewards {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rewards li {
  padding: 10px 0;
}
.rewards li + li {
  border-top: 1px solid var(--border);
}
.rewards li.is-off > :not(.reward-title):not(select) {
  opacity: 0.4;
}
.rewards .cell {
  display: grid;
  min-width: 0;
}
.rewards .cell > * {
  width: 100%;
  min-width: 0;
}
.reward-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.reward-title strong,
.reward-title > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.reward-title > span {
  font-size: 12px;
}
.reward-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin-top: 2px;
}
.reward-buttons {
  display: flex;
  gap: 6px;
}
.check {
  display: flex;
  justify-content: center;
}
.check input {
  width: 17px;
  height: 17px;
}
.reply-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.reply-note {
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--warn);
  text-align: center;
}
@media (max-width: 1100px) {
  .rewards-head {
    display: none;
  }
  .rewards li {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rewards li .reward-title {
    grid-column: 1 / -1;
  }
}

/* ---- effects look ---- */
.look-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 2fr);
  gap: 18px;
  align-items: start;
}
.look-controls,
.look-stage {
  display: grid;
  gap: 12px;
}
.try-look {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.try-look select {
  flex: 1 1 100%;
}
.reply-try select {
  flex: 1 1 10rem;
}
.note {
  padding: 9px 12px;
  border: 1px solid rgb(251 193 94 / 0.35);
  border-radius: var(--radius-sm);
  background: rgb(251 193 94 / 0.07);
  color: var(--warn);
  font-size: 13px;
}
.help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-2);
}
.help summary:hover {
  color: var(--text);
}
.help ul {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding-left: 1.2rem;
  color: var(--text-2);
}
.help p {
  margin-top: 6px;
}
.zones-wrap {
  display: grid;
  gap: 8px;
}
.stage,
.zones {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / 10% 10%,
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / 6.25% 6.25%,
    #0b0a0e;
}
.zones {
  width: 100%;
  aspect-ratio: 16 / 9;
  touch-action: none;
  user-select: none;
}
.zones.is-drawing {
  cursor: crosshair;
}
.zone-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.zone {
  position: absolute;
  padding: 0;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  cursor: pointer;
}
.zone:hover {
  background: color-mix(in srgb, var(--accent) 36%, transparent);
}
.zone.is-draft {
  pointer-events: none;
}
.stage iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  background: transparent;
  transform-origin: 0 0;
  pointer-events: none;
}
.mic-meter {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}
.mic-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--text-3);
  transition: width 0.2s linear;
}
.mic-meter.is-talking .mic-meter-fill {
  background: var(--accent);
}
.mic-meter-line {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--text);
}
#fx-mic .field.wide {
  grid-column: 1 / -1;
}

/* ---- cat gacha ---- */
.cats {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cats li {
  --rarity: var(--text-3);
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 9rem 5rem 2.2rem;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.cats li + li {
  border-top: 1px solid var(--border);
}
.cats li.rarity-rare {
  --rarity: var(--ok);
}
.cats li.rarity-epic {
  --rarity: #c9a2ff;
}
.cats li.rarity-legendary {
  --rarity: var(--warn);
}
.cats img {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--rarity);
  background: var(--bg);
}
.cats .tag {
  justify-self: center;
}
.add-cat {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.add-cat-fields {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
}
.add-cat-fields select {
  width: auto;
}
.cat-preview {
  flex: none;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  background: var(--bg);
}
.cat-preview.has-image {
  border: 2px solid var(--border-hover);
}

/* ---- Tunapedia ---- */
textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font-ui);
  resize: vertical;
}
textarea::placeholder {
  color: var(--text-3);
}
textarea:hover {
  border-color: var(--border-hover);
}
textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lore {
  display: grid;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.lore li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.2rem;
  gap: 8px 10px;
  padding: 12px 0 12px 12px;
  border-left: 3px solid var(--accent);
}
.lore li + li {
  margin-top: 8px;
}
.lore li > textarea,
.lore li > .lore-example {
  grid-column: 1 / -1;
}
.add-lore {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

/* ---- OBS sources ---- */
.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 10px;
}
.segmented label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.segmented label:hover {
  background: var(--surface-2);
}
.segmented label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.segmented label:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}
.segmented input {
  margin-top: 4px;
}
.segmented small {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 16px;
  align-items: start;
}
/* a square or tall source previews at a sensible size instead of the card's full width (see fitHeight in admin.js) */
.source .stage {
  justify-self: center;
  width: 100%;
}
#stage-wheel {
  width: min(100%, 26rem);
}
.url-row input {
  flex: 1 1 10rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.dock-sketch {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.dock-sketch-card {
  display: grid;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.dock-sketch-card.dim {
  opacity: 0.55;
}
.dock-sketch-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.dock-sketch-buttons i {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
}
.dock-sketch-buttons i:first-child {
  border-color: rgb(255 125 136 / 0.35);
  color: var(--bad);
}
.dock-sketch-buttons i:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---- connections checklist ---- */
.checklist {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.checklist li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
}
.checklist li + li {
  border-top: 1px solid var(--border);
}
.check-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}
.is-todo .check-mark {
  border-color: var(--accent);
  color: var(--accent);
}
.is-optional .check-mark {
  border-style: dashed;
}
.is-done .check-mark {
  border-color: transparent;
  background: rgb(111 227 166 / 0.15);
  color: var(--ok);
}
.is-done strong {
  color: var(--text-2);
}
.check-body {
  display: grid;
  gap: 2px;
}
.check-body .muted {
  font-size: 13px;
}
.check-note {
  color: var(--warn);
  font-size: 12.5px;
}

/* ---- save bars, toasts, floating preview, dialog ---- */
.savebar {
  position: fixed;
  left: calc(50% + var(--sidebar) / 2);
  bottom: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 2rem);
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-3);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  font-weight: 600;
  transform: translateX(-50%);
  animation: rise 0.2s ease-out;
}
.savebar > span::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warn);
  vertical-align: 1px;
}
/* both save bars can be up at once: the redemptions one sits above the wheel one */
#savebar:not([hidden]) ~ #fx-savebar {
  bottom: 76px;
}
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: grid;
  gap: 8px;
  justify-items: end;
}
.toast {
  max-width: 24rem;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.45);
  font-weight: 500;
  animation: rise 0.2s ease-out;
}
.toast.bad {
  border-left-color: var(--bad);
}
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}
.pip {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 25;
  display: grid;
  gap: 8px;
  width: min(30rem, calc(100vw - 40px));
  padding: 10px 12px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.55);
  animation: rise 0.2s ease-out;
}
.pip-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pip-head .button {
  margin-left: auto;
}
#pip-stage,
#rw-stage {
  display: grid;
  width: 100%;
}
#pip-stage > .stage,
#rw-stage > .stage {
  justify-self: center;
  width: 100%;
}
body:has(#fx-savebar:not([hidden])) .pip,
body:has(#savebar:not([hidden])) .pip {
  bottom: 84px;
}
.reward-dialog {
  width: min(62rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.6);
}
.reward-dialog::backdrop {
  background: rgb(5 4 8 / 0.7);
}
.reward-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}
.reward-dialog h2 {
  font-size: 18px;
}
.reward-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.reward-dialog-fields {
  display: grid;
  gap: 12px;
}
.reward-dialog-fields h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.reward-dialog-fields .field.wide {
  grid-column: 1 / -1;
}
.reward-dialog-preview {
  position: sticky;
  top: 0;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.reward-dialog-actions {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.reward-dialog-actions .spacer {
  flex: 1;
}

/* ---- narrower screens ---- */
@media (max-width: 1180px) {
  .live-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .live-grid > .stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  }
}
@media (max-width: 900px) {
  /* the sidebar becomes a top bar with a scrolling row of pages */
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: sticky;
    z-index: 15;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .brand {
    padding: 0;
  }
  .brand-name {
    font-size: 22px;
  }
  .nav {
    order: 3;
    flex: 1 1 100%;
    display: flex;
    gap: 4px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-label {
    display: none;
  }
  .tab {
    flex: none;
    height: 32px;
  }
  .tab[aria-selected='true']::before {
    display: none;
  }
  .sidebar-foot {
    display: contents;
  }
  .health {
    display: none;
  }
  .account {
    margin-left: auto;
  }
  .who {
    display: none;
  }
  .view {
    padding: 18px 16px 110px;
  }
  .live-grid,
  .columns,
  .look-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel.sticky {
    position: relative;
    top: 0;
    order: -1;
  }
  .savebar {
    left: 50%;
  }
}
@media (max-width: 560px) {
  .panel {
    padding: 16px;
  }
  .segments-head {
    display: none;
  }
  .segments li {
    grid-template-columns: 1.4rem minmax(0, 1fr) minmax(0, 1fr) 2.6rem 2.2rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .segments li > input[type='text'] {
    grid-column: 2 / 5;
  }
  .segments li > .button {
    grid-column: 5;
    grid-row: 1;
  }
  .segments li > input[type='number'] {
    grid-column: 2;
  }
  .hub-editor {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
  .spin-form {
    flex-direction: column;
  }
  .checklist li {
    grid-template-columns: 2rem minmax(0, 1fr);
  }
  .checklist li > .button {
    grid-column: 2;
    justify-self: start;
  }
  .cats li {
    grid-template-columns: 3.25rem minmax(0, 1fr) 2.2rem;
  }
  .cats li > :nth-child(3),
  .cats li > :nth-child(4) {
    grid-column: 2;
  }
  .add-cat {
    flex-direction: column;
  }
  .request-actions .ghost {
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
