/* QuantLab control panel.
   Dark, on purpose: it lives next to Discord and produces dark artwork.
   The brand book allows exactly one dark tone — "Dark Neutral #15161D,
   never purple-navy" — so every surface here is a neutral step off that
   one hex, and the only colour is the accent: brand Purple. */

:root {
  /* Dark glass — exact tokens */
  --bg:      #0b0b0c;
  --surface: #111113;
  --raised:  #17171a;
  --sunken:  #0d0d0f;
  --rule:    #232327;
  --line:    #232327;
  --line2:   #303036;
  --panel:   #111113;
  --panel2:  #17171a;
  --inset:   #0d0d0f;
  --ink:     #F3F4F6;
  --soft:    #9CA3AF;
  --muted:   #6B7280;
  --accent:  #2233f5;
  --accent-2:#4d5cff;
  --accent-d:#11143b;
  --blue:    #2233f5;
  --blue2:   #4d5cff;
  --blue-bg: #11143b;
  --blue-line:#2a318a;
  --gold:    #f5c451;
  --silver:  #c6ccd8;
  --bronze:  #d38b55;
  --good:    #22c55e;
  --off:     #6B7280;
  --warn:    #F59E0B;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius:  11px;
  --radius-sm: 9px;
  --sidebar-w: 220px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --gap-stack: 1.75rem;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  position: relative;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 55% -80px, rgba(34, 51, 245, 0.16), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.0028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.0028) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

body > * {
  position: relative;
  z-index: 1;
}

/* ── top bar ────────────────────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: max(0.7rem, env(safe-area-inset-top));
  z-index: 5;
  margin: 0.7rem 0.85rem 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.bar::after {
  content: "";
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent));
  /* Scaled, not resized: a width transition here re-ran layout on every
     scroll event and trailed behind the scroll. --scroll-k is 0..1. */
  transform: scaleX(var(--scroll-k, 0)); transform-origin: 0 50%;
}

.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.mark { width: 26px; height: 26px; flex: none; display: block; border-radius: 7px; object-fit: cover; }
img.mark { background: rgba(147,151,238,0.14); }
.mark rect { fill: rgba(147,151,238,0.14); stroke: rgba(147,151,238,0.5); stroke-width: 1; }
.mark .y path { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.wordmark { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; text-transform: lowercase; }

.here {
  font-size: 0.78rem; color: var(--muted);
  padding-left: 0.55rem; margin-left: 0.1rem;
  border-left: 1px solid var(--rule);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
html[data-scrolled="1"] .here { opacity: 1; transform: none; }

.bar-right { display: flex; align-items: center; gap: 0.55rem; font-size: 0.82rem; min-width: 0; }
.bar-right img { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.bar-right .who {
  color: var(--soft); max-width: 8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-right .btn { margin-left: 0.15rem; }

@media (max-width: 26rem) {
  .bar-right .who { display: none; }
  .wordmark { font-size: 0.74rem; letter-spacing: 0.07em; }
}
@media (max-width: 20rem) {
  .here { display: none; }
}

/* ── layout ──────────────────────────────────────────────────────────── */
#main { position: relative; z-index: 1; max-width: 64rem; margin: 0 auto; padding: 1.6rem 1.1rem 5rem; }
.view { display: none; flex-direction: column; gap: 1.25rem; }
html[data-state="loading"] .view[data-view="loading"],
html[data-state="login"]   .view[data-view="login"],
html[data-state="setup"]   .view[data-view="setup"],
html[data-state="panel"]   .view[data-view="panel"] { display: flex; }

.section { display: none; flex-direction: column; gap: 1.1rem; }
.section[data-active] { display: flex; }

.grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 46rem) { .grid { grid-template-columns: 1fr 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.4rem;
  box-shadow: var(--shadow-card);
}
.panel.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; padding: 2.8rem 1.4rem; }

h1 {
  font-size: 1.45rem;
  margin: 0;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--ink);
}
h2 {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.muted { color: var(--soft); margin: 0; }
.hint { color: var(--muted); font-size: 0.78rem; margin: 0; }

/* ── server identity ─────────────────────────────────────────────────── */
.server { display: flex; flex-direction: column; gap: 0.85rem; }
.server-id { display: flex; align-items: center; gap: 0.85rem; }
.crest {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: var(--raised); border: 1px solid var(--rule);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--mono); font-size: 1.05rem; color: var(--accent);
}
.crest img { width: 100%; height: 100%; object-fit: cover; }
.server-meta {
  margin: 0; color: var(--muted); font-size: 0.8rem; font-family: var(--mono);
  line-height: 1.45; min-height: 1.45em;
}

.guilds { display: flex; gap: 0.55rem; overflow-x: auto; padding-bottom: 0.25rem; }
.guilds button {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--sunken);
  border: 1px solid var(--rule);
  color: var(--soft);
  border-radius: 12px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.guilds button img { width: 18px; height: 18px; border-radius: 5px; }
@media (hover: hover) { .guilds button:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); } }
.guilds button[aria-current="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--rule));
  color: var(--ink);
  background: var(--raised);
}
.guilds:has(button:only-child) { display: none; }

/* ── section nav ─────────────────────────────────────────────────────── */
.sections {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding: 0.3rem;
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.sections button {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.sections button[aria-current="true"] {
  color: var(--ink);
  background: var(--raised);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
@media (hover: hover) { .sections button:hover { color: var(--soft); } }
@media (hover: hover) { .sections button[aria-current="true"]:hover { color: var(--ink); } }

/* ── stat tiles ──────────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 30rem) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 52rem) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) { .tile:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  background: var(--raised);
} }
.tile .n { font-family: var(--mono); font-size: 1.45rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .l { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.tile.live .n { color: var(--good); }
.tile.idle .n { color: var(--off); }
.tile.ph { visibility: hidden; }

/* ── rows ────────────────────────────────────────────────────────────── */
.rows { display: flex; flex-direction: column; gap: 0.7rem; }
.panel > .muted + .rows, .panel > .hint + .rows { margin-top: 1rem; }
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.row .k {
  color: var(--soft);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .v {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  flex: 0 1 auto;
  max-width: 58%;
  min-width: 0;
}
.row .v.dim { color: var(--muted); }

.pill {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.18rem 0.5rem; border-radius: 999px;
  border: 1px solid currentColor;
}
.pill.on { color: var(--good); }
.pill.off { color: var(--off); }
.pill.wait { color: var(--warn); }

.permit {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; min-height: 2rem;
}
.permit .who {
  font-size: 0.9rem; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.permit-right { display: flex; align-items: center; gap: 0.55rem; flex: none; }

@media (max-width: 26rem) {
  .permit { flex-direction: column; align-items: stretch; gap: 0.45rem; }
  .permit-right { justify-content: space-between; }
}

.tag {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em;
  color: var(--muted); border: 1px solid var(--rule);
  border-radius: 999px; padding: 0.12rem 0.42rem; text-transform: uppercase;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.chips span {
  font-family: var(--mono); font-size: 0.68rem;
  background: var(--raised); border: 1px solid var(--rule);
  border-radius: 6px; padding: 0.12rem 0.4rem; color: var(--soft);
}
.chips span.unknown { color: var(--warn); border-color: rgba(232,135,74,0.4); }

/* ── leaderboard ─────────────────────────────────────────────────────── */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.board li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.9rem; }
.board .rank { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); width: 1.4rem; }
.board img { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.board .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .bal { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--good); }

/* ── studio ──────────────────────────────────────────────────────────── */
.studio { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 56rem) { .studio { grid-template-columns: 1.35fr 1fr; align-items: start; } }

.stage { display: flex; flex-direction: column; gap: 0.55rem; }
.stage-frame {
  position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--rule); background: var(--sunken);
  aspect-ratio: 5 / 2;
}
.stage-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.stage-busy { position: absolute; inset: 0; background: rgba(5,5,6,0.4); }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

.editor { display: flex; flex-direction: column; gap: 0.7rem; }
.editor-foot { display: flex; gap: 0.5rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > span, .field-head { font-size: 0.78rem; color: var(--soft); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.field .count { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
input[type="text"], input[type="date"], textarea, select {
  width: 100%; font: inherit; font-size: 0.88rem;
  background: var(--sunken); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 0.75rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) { input[type="text"]:hover, input[type="date"]:hover, textarea:hover, select:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--rule));
} }
textarea { resize: vertical; min-height: 4.5rem; font-family: var(--mono); font-size: 0.82rem; }
input[type="text"], input[type="date"] { font-family: var(--mono); font-size: 0.82rem; }

input[type="date"] {
  color-scheme: dark;
  -webkit-appearance: none; appearance: none;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-datetime-edit { padding: 0; line-height: inherit; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator {
  height: 1em; width: 1em; padding: 0; margin: 0 0 0 0.3rem;
  cursor: pointer; opacity: 0.6;
}
@media (hover: hover) { input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; } }
input:focus, textarea:focus, select:focus { outline: none; border-color: rgba(255,255,255,0.16); box-shadow: none; }

/* ── forms ───────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.05rem; }

.actions {
  display: flex; flex-wrap: wrap; gap: 0.55rem;
  margin-top: 0.6rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.form .actions { margin-top: 0.3rem; }

.embed-link-row { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.embed-link-row input { flex: 1; min-width: 0; }
#embed-link-card .actions { margin-top: 0.9rem; padding-top: 0; border-top: none; }

.fineprint {
  margin: 1.2rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex; justify-content: center; align-items: center; gap: 0.5rem;
}
.fineprint a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
@media (hover: hover) { .fineprint a:hover { color: var(--soft); border-bottom-color: var(--rule); } }
.fineprint a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }


/* ── polls ──────────────────────────────────────────────────────────────── */
.poll-results { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.8rem 0 0.25rem; }
.poll-line { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.55rem; align-items: start; }
.poll-key {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  line-height: 1.35; text-align: center;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--sunken);
}
.poll-line.lead .poll-key { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.poll-body { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.poll-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.poll-label { min-width: 0; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-num {
  flex: none; font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.poll-line.lead .poll-num { color: var(--ink); }
.poll-track { height: 5px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--rule); overflow: hidden; }
.poll-track > i { display: block; height: 100%; background: var(--off); transition: width var(--slow) var(--ease); }
.poll-line.lead .poll-track > i { background: var(--accent); }

.poll-option-row { display: flex; align-items: flex-end; gap: 0.5rem; }
.poll-option-row .field { flex: 1; min-width: 0; }
#form-poll .subfields > .btn { align-self: flex-start; }

/* ── release desk ───────────────────────────────────────────────────────── */
.scope-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
  margin-top: 1rem; padding: 0.35rem;
  background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px;
}
.scope-tab {
  display: flex; flex-direction: column; align-items: center; gap: 0.12rem;
  padding: 0.55rem 0.4rem; min-width: 0;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
@media (hover: hover) { .scope-tab:hover { color: var(--soft); } }
.scope-tab[aria-selected="true"] {
  background: var(--raised); border-color: var(--rule); color: var(--ink);
}
.scope-name {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.scope-count {
  font-family: var(--mono); font-size: 1.1rem; font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.scope-tab[aria-selected="true"] .scope-count { color: var(--accent); }

.agenda {
  display: flex; flex-direction: column;
  margin-top: 1rem;
  max-height: 22rem; overflow-y: auto;
}
.agenda > p { margin: 0.4rem 0; }
.agenda-row {
  display: grid;
  grid-template-columns: 0.5rem 3.1rem 2.5rem minmax(0, 1fr) auto;
  align-items: center; gap: 0.55rem;
  padding: 0.48rem 0.1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
}
.agenda[data-range="week"] .agenda-row { grid-template-columns: 0.5rem 2.2rem 3.1rem 2.5rem minmax(0, 1fr) auto; }
.agenda-row:last-child { border-bottom: none; }

.impact-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--off); }
.impact-dot.high { background: #E5484D; box-shadow: 0 0 0 3px color-mix(in srgb, #E5484D 18%, transparent); }
.impact-dot.medium { background: var(--warn); }
.impact-dot.low { background: transparent; border: 1px solid var(--off); }
.impact-dot.holiday { background: var(--accent); }

.agenda-day, .agenda-time, .agenda-cur {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); letter-spacing: 0.04em;
}
.agenda-day { font-size: 0.7rem; color: var(--muted); }
.agenda-time { font-size: 0.76rem; color: var(--soft); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.agenda-cur { font-size: 0.72rem; color: var(--muted); }
.agenda-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-fig { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); white-space: nowrap; }

.agenda.is-scrollable {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent 100%);
}

@media (max-width: 30rem) {
  .agenda-row { grid-template-columns: 0.5rem 3rem 2.4rem minmax(0, 1fr); gap: 0.45rem; }
  .agenda[data-range="week"] .agenda-row { grid-template-columns: 0.5rem 2.1rem 3rem 2.4rem minmax(0, 1fr); }
  .agenda-fig { display: none; }
  .agenda-title {
    white-space: normal; overflow: visible;
    overflow-wrap: break-word; hyphens: auto;
  }
  .scope-name { font-size: 0.66rem; letter-spacing: 0.03em; }
}

#release-desk .actions { margin-top: 1rem; padding-top: 1rem; }

/* ── terms & privacy ────────────────────────────────────────────────────── */
.legal-links { display: grid; grid-template-columns: 1fr; gap: 0.7rem; margin-top: 1rem; }
@media (min-width: 34rem) { .legal-links { grid-template-columns: 1fr 1fr; } }

.legal-link {
  min-width: 0;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--rule); border-radius: 14px;
  background: var(--sunken);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) { .legal-link:hover { border-color: var(--accent); background: var(--raised); transform: translateY(-1px); } }
.legal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.legal-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-d); color: var(--accent);
  font-family: Georgia, "Times New Roman", serif; font-size: 1rem;
}
.legal-text { display: flex; flex-direction: column; min-width: 0; gap: 0.12rem; }
.legal-name { font-size: 0.9rem; font-weight: 500; }
.legal-url {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.legal-arrow { margin-left: auto; color: var(--muted); font-size: 0.85rem; flex: none; }
@media (hover: hover) { .legal-link:hover .legal-arrow { color: var(--accent); } }

#legal-card .actions {
  margin-top: 1rem; padding-top: 0; border-top: none;
  display: grid; grid-template-columns: 1fr; gap: 0.7rem;
}
@media (min-width: 34rem) { #legal-card .actions { grid-template-columns: 1fr 1fr; } }
#legal-card .actions .btn { width: 100%; min-width: 0; }

* + h2 { margin-top: 1.4rem; }
.panel > h2:first-child, .rows h2, form > h2:first-child { margin-top: 0; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9rem; cursor: pointer; }
.toggle-row { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.toggle-row:last-of-type { border-bottom: none; }
.toggle-row .hint { margin-top: 0.3rem; }
.toggle span { color: var(--soft); }
.toggle input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--raised); border: 1px solid var(--rule); position: relative; cursor: pointer; flex: none; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--off); transition: transform 0.15s, background 0.15s; }
.toggle input:checked { background: var(--accent-d); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); background: var(--accent); }
.toggle input:focus-visible, textarea:focus-visible { outline: none; border-color: rgba(255,255,255,0.18); }

/* ── shop items ──────────────────────────────────────────────────────── */
.items { display: flex; flex-direction: column; gap: 0.7rem; }
.item { border: 1px solid var(--rule); border-radius: 12px; background: var(--sunken); }
.item summary { display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem 0.9rem; cursor: pointer; font-size: 0.9rem; list-style: none; }
.item summary::-webkit-details-marker { display: none; }
.item summary .emoji { font-size: 1.05rem; }
.item summary .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item summary .pr { font-family: var(--mono); font-size: 0.82rem; color: var(--good); font-variant-numeric: tabular-nums; }
.item[open] summary { border-bottom: 1px solid var(--rule); }
.item .body { padding: 1.05rem; display: flex; flex-direction: column; gap: 0.9rem; }

/* ── composer ────────────────────────────────────────────────────────── */
.composer { display: grid; grid-template-columns: 1fr; gap: 1.1rem; align-items: start; }
@media (min-width: 52rem) { .composer { grid-template-columns: 15.5rem 1fr; } }

.tpl-list {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--rule); border-radius: 16px; padding: 1rem;
}
.tpl-list-head { display: flex; align-items: center; justify-content: space-between; }
.tpl-list-head h2 { margin: 0; }
#tpl-index { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.8rem; max-height: 24rem; overflow-y: auto; }
.tpl-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: none; border: 1px solid transparent; border-radius: 10px;
  color: var(--soft); font: inherit; font-size: 0.86rem;
  padding: 0.45rem 0.55rem; cursor: pointer; text-align: left; width: 100%;
}
@media (hover: hover) { .tpl-entry:hover { background: var(--raised); } }
.tpl-entry[aria-current="true"] { background: var(--raised); border-color: var(--accent); color: var(--ink); }
.tpl-entry .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-entry .mt { font-family: var(--mono); font-size: 0.66rem; color: var(--muted); flex: none; }

.composer-body { display: flex; flex-direction: column; gap: 1.15rem; }

.embed-box { border: 1px solid var(--rule); border-radius: 12px; background: var(--sunken); margin-top: 0.7rem; }
.embed-box summary { display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.85rem; cursor: pointer; list-style: none; font-size: 0.9rem; }
.embed-box summary::-webkit-details-marker { display: none; }
.embed-box .swatch { width: 4px; height: 20px; border-radius: 2px; flex: none; }
.embed-box[open] summary { border-bottom: 1px solid var(--rule); }
.embed-box .body { padding: 1.05rem; display: flex; flex-direction: column; gap: 0.95rem; }

.subfields { display: flex; flex-direction: column; gap: 0.95rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; margin-top: 0.4rem; }
.subfield { display: flex; flex-direction: column; gap: 0.65rem; border-left: 2px solid var(--rule); padding-left: 0.8rem; padding-bottom: 0.35rem; }

.bstyle {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em;
  border-radius: 5px; padding: 0.12rem 0.38rem; border: 1px solid currentColor; flex: none;
}
.bstyle.primary { color: var(--accent); }
.bstyle.success { color: var(--good); }
.bstyle.danger  { color: var(--warn); }
.bstyle.secondary, .bstyle.link { color: var(--muted); }

.post-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-size: 0.84rem; padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.post-row .k { color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── giveaways ───────────────────────────────────────────────────────── */
.gaw {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) { .gaw.tappable:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--rule));
  background: var(--raised);
} }
.gaw-top { display: flex; align-items: center; gap: 0.55rem; }
.gaw-top .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.gaw .kind {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em;
  border-radius: 999px; padding: 0.14rem 0.45rem; border: 1px solid currentColor; flex: none;
}
.gaw .kind.coins { color: var(--good); }
.gaw .kind.prize { color: var(--accent); }
.gaw .idtag { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); flex: none; }

.gaw.tappable {
  position: relative; width: 100%; text-align: left; cursor: pointer;
  color: inherit; font: inherit;
  padding-right: 2rem;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
@media (hover: hover) { .gaw.tappable:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); background: var(--raised); } }
.gaw.tappable:active { transform: scale(0.985); }
.gaw .chev {
  position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 1.2rem; line-height: 1;
  transition: transform var(--fast) var(--ease), color var(--fast) var(--ease);
}
@media (hover: hover) { .gaw.tappable:hover .chev { color: var(--accent); transform: translateY(-50%) translateX(2px); } }
.v.mono { font-family: var(--mono); font-size: 0.8rem; }
.v.mono.wrap { overflow-wrap: anywhere; text-align: right; }

.gaw .kind.sev-danger { color: var(--bad, #E74C3C); }
.gaw .kind.sev-warn   { color: var(--warn); }
.gaw .kind.sev-clear  { color: var(--good); }
.gaw .kind.sev-idle   { color: var(--muted); }

.queue-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.queue-head h2 { margin-bottom: 0; }

.econ-card {
  background: none;
  border-color: color-mix(in srgb, var(--rule) 70%, transparent);
  padding: 1.05rem 1.1rem 1.15rem;
}
.econ-card h2 { margin-bottom: 0; }
.econ-card.off { opacity: 0.62; }
.econ-card.off h2 { color: var(--off); }

.signals { display: flex; flex-direction: column; gap: 0.35rem; }
.signal {
  margin: 0; font-size: 0.84rem; line-height: 1.35;
  padding: 0.42rem 0.6rem; border-radius: 9px;
  border-left: 3px solid var(--rule); background: var(--sunken);
}
.signal.danger { border-left-color: #E74C3C; color: #F5B7B1; }
.signal.warn   { border-left-color: var(--warn); color: #F3C99B; }
.signal.note   { border-left-color: var(--off); color: var(--soft); }
.signal.good   { border-left-color: var(--good); color: #A9DFC4; }

.quote {
  border-left: 3px solid var(--accent);
  background: var(--sunken); border-radius: 0 9px 9px 0;
  padding: 0.55rem 0.75rem;
}
.quote p { margin: 0; font-size: 0.88rem; overflow-wrap: anywhere; }

.rows + .form {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}

/* ── chip multi-select ───────────────────────────────────────────────── */
.chipset { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.field .chipset { margin-top: 0.45rem; }
.chip {
  font: inherit; font-family: var(--mono); font-size: 0.72rem;
  padding: 0.25rem 0.55rem; border-radius: 999px; cursor: pointer;
  background: var(--sunken); color: var(--muted);
  border: 1px solid var(--rule);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
@media (hover: hover) { .chip:hover { color: var(--ink); border-color: var(--accent); } }
.chip:active { transform: scale(0.94); }

.field .count.bad { color: var(--warn); }
.hint.bad { color: var(--warn); }
.chip-toggle {
  font: inherit; font-size: 0.8rem;
  background: var(--sunken); border: 1px solid var(--rule); border-radius: 999px;
  color: var(--muted); padding: 0.3rem 0.7rem; cursor: pointer;
}
@media (hover: hover) { .chip-toggle:hover { color: var(--soft); border-color: var(--off); } }
.chip-toggle[aria-pressed="true"] {
  background: var(--accent-d); border-color: var(--accent); color: var(--ink);
}
input.bad { border-color: var(--warn); }

/* ── countdown ───────────────────────────────────────────────────────── */
.countdown {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 0.82rem; color: var(--accent);
}
.countdown.soon { color: var(--warn); }
.countdown.over { color: var(--off); }

.meter { height: 4px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0%; background: rgba(255,255,255,0.28); border-radius: 999px; transition: none; }
.meter.soon > i { background: var(--warn); }

.gaw-preview { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--sunken); }
.gaw-preview img { display: block; width: 100%; }

/* ── controls ────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; text-decoration: none; font: inherit; text-align: center;
  border-radius: 10px; padding: 0.6rem 1.1rem; border: 1px solid var(--rule);
  color: var(--ink); background: var(--raised); cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn.danger { color: #A1A1AA; border-color: rgba(255,255,255,0.14); background: transparent; }
@media (hover: hover) { .btn.danger:hover { color: #E4E4E7; border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.04); } }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.12); } }
.btn:disabled { opacity: 0.5; cursor: default; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.note { color: var(--warn); font-size: 0.85rem; margin: 0; }
.note.soft { color: var(--muted); }
.storage-nudge { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; border-color: color-mix(in srgb, var(--accent) 34%, var(--rule)); }
.storage-nudge .btn { align-self: stretch; }

.keys { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.keys li { font-family: var(--mono); font-size: 0.85rem; background: var(--raised); border: 1px solid var(--rule); border-radius: 8px; padding: 0.45rem 0.65rem; }

/* (toasts: see toasts.css) */

/* ── motion ─────────────────────────────────────────────────────────────── */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 140ms;
  --mid: 260ms;
  --slow: 420ms;
}

@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pillDrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: 200% 0; } }
@keyframes tickOver { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes tabIn { from { opacity: 0; } to { opacity: 1; } }

/* Entrance motion only on the first paint of the panel. */
html[data-entered] .bar,
html[data-entered] .server,
html[data-entered] .sections,
html[data-entered] .tiles > *,
html[data-entered] .section,
html[data-entered] .section .panel,
html[data-entered] .grid > * {
  animation: none !important;
}

.bar { animation: pillDrop var(--slow) var(--ease) both; }
.server { animation: rise var(--slow) var(--ease) both 60ms; }
.sections { animation: rise var(--slow) var(--ease) both 110ms; }

.tiles > * { animation: popIn var(--mid) var(--ease) both; }
.tiles > .ph { animation: none; }
.tiles > :nth-child(1) { animation-delay: 140ms; }
.tiles > :nth-child(2) { animation-delay: 180ms; }
.tiles > :nth-child(3) { animation-delay: 220ms; }
.tiles > :nth-child(4) { animation-delay: 260ms; }
.tiles > :nth-child(5) { animation-delay: 300ms; }
.tiles > :nth-child(6) { animation-delay: 340ms; }

.tile .n.ticked { animation: tickOver var(--mid) var(--ease); }

.section[data-active] { animation: tabIn 280ms var(--ease) both; }
.section .panel { animation: rise 320ms var(--ease) both; }
.section .panel:nth-child(2) { animation-delay: 30ms; }
.section .panel:nth-child(3) { animation-delay: 50ms; }
.section .panel:nth-child(4) { animation-delay: 70ms; }
.grid > *:nth-child(2) { animation-delay: 45ms; }
.grid > *:nth-child(3) { animation-delay: 90ms; }
.grid > *:nth-child(4) { animation-delay: 135ms; }

/* Keep form controls out of ancestor transforms so native selects stay open. */
.field, .form, select, input, textarea, .chipset, .actions {
  transform: none;
  filter: none;
  will-change: auto;
}

.btn { transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast); }
.btn:active:not(:disabled) { transform: scale(0.96); }
.sections button { transition: color var(--fast) var(--ease); }
.sections button { position: relative; border-bottom-color: transparent !important; }
.tpl-entry, .chip-toggle, .guilds button {
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.tpl-entry:active, .chip-toggle:active, .guilds button:active { transform: scale(0.97); }

input, textarea, select { transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.panel { transition: border-color var(--mid) var(--ease); }
.item[open] .body, .embed-box[open] .body { animation: rise var(--mid) var(--ease) both; }
html[data-entered] .item[open] .body,
html[data-entered] .embed-box[open] .body { animation: none; }


.skeleton {
  border-radius: 9px; min-height: 1rem;
  background: linear-gradient(90deg, var(--raised) 25%, var(--rule) 50%, var(--raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.stage-frame img { transition: opacity var(--mid) var(--ease); }
.stage-busy { transition: opacity var(--fast) var(--ease); }

/* ── the sheet ───────────────────────────────────────────────────────────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }

.sheet-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  /* no glass */
  -webkit-/* no glass */
  animation: scrimIn var(--mid) var(--ease) both;
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 780px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 0.55rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.55);
  animation: sheetUp var(--slow) var(--ease) both;
  scrollbar-gutter: stable;
}
@media (min-width: 620px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--rule); animation-name: sheetPop; }
  .sheet-grip { display: none; }
}

.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--rule); margin: 0.15rem auto 0.55rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-x {
  flex: none; width: 34px; height: 34px; line-height: 1;
  font-size: 1.3rem; border-radius: 10px; cursor: pointer;
  background: var(--raised); color: var(--soft); border: 1px solid var(--rule);
}
@media (hover: hover) { .sheet-x:hover { color: var(--ink); } }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.8rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.sheet-body > * + * { margin-top: 0.8rem; }
.sheet .actions { margin-top: 0.95rem; }
.sheet .actions:empty { display: none; }

.sheet-body > * { animation: sheetRow var(--mid) var(--ease) both; }
.sheet-body > *:nth-child(1) { animation-delay: 90ms; }
.sheet-body > *:nth-child(2) { animation-delay: 130ms; }
.sheet-body > *:nth-child(3) { animation-delay: 170ms; }
.sheet-body > *:nth-child(n+4) { animation-delay: 210ms; }
/* A refresh of a sheet that is already open (participants poll) does not
   play the entrance again — every row used to fade back in each time. */
.sheet-body.no-enter > *,
.sheet-body.no-enter .roster-row { animation: none; }

@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(14%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetPop { from { transform: scale(0.97) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetRow { from { transform: translateY(7px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Discord embed preview */
.demb {
  background: #2B2D31; border-radius: 4px;
  border-left: 4px solid var(--accent);
  padding: 0.65rem 0.85rem; color: #DBDEE1;
  font-family: var(--sans); font-size: 0.85rem; line-height: 1.4;
}
.demb .t { font-weight: 600; color: #F2F3F5; margin: 0 0 0.25rem; }
.demb .d { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.demb .a { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #B5BAC1; margin: 0 0 0.3rem; }
.demb .f { display: flex; flex-wrap: wrap; gap: 0.55rem 1.1rem; margin: 0.5rem 0 0; }
.demb .f > div { min-width: 8rem; flex: 1 1 8rem; }
.demb .f b { display: block; font-size: 0.78rem; color: #F2F3F5; }
.demb .f span { font-size: 0.8rem; }
.demb img.big {
  display: block; width: 100%; max-height: 20rem; object-fit: contain;
  object-position: left top; border-radius: 4px; margin-top: 0.5rem;
}
.demb .ft { font-size: 0.72rem; color: #949BA4; margin: 0.5rem 0 0; }
.demb-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.demb-btns span {
  font-size: 0.78rem; padding: 0.32rem 0.7rem; border-radius: 4px;
  background: #4E5058; color: #fff; font-family: var(--sans);
}
.demb-btns span.Primary { background: #5865F2; }
.demb-btns span.Success { background: #248046; }
.demb-btns span.Danger  { background: #DA373C; }
.demb-btns span.link::after { content: ' ↗'; opacity: 0.8; }
.demb-btns span.Secondary { background: #4E5058; }

.btn-editor-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.45rem; }

.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.5rem 1.1rem; margin-top: 0.4rem; }
.palette-row { display: flex; flex-direction: column; gap: 0.2rem; }
.palette-head { display: flex; flex-direction: column; }
.palette-head .nm { font-size: 0.86rem; color: var(--ink); }
.palette-head .hint { margin: 0; font-size: 0.72rem; }
.palette-row .field { margin: 0; }
.palette-row .field > span:first-child { display: none; }

.palette-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.4rem; }
.palette-preview .demb { padding: 0.4rem 0.6rem; }
.palette-preview .demb .t { margin: 0; font-size: 0.78rem; }
.btn-editor-head .hint { margin: 0; }

/* Social */
.social-card { border-left: 3px solid var(--accent); margin-bottom: 1rem; }
.social-card.off { opacity: 0.55; }
.social-card .tag { font-weight: 700; }
.social-head-left { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.social-head-left h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.social-strip {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  margin-bottom: 0.55rem; padding: 0.8rem 0.95rem;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent); border-radius: 14px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
@media (hover: hover) { .social-strip:hover { background: var(--sunken); } }
.social-strip:active { transform: scale(0.995); }
.social-strip.off { opacity: 0.55; }

.social-badge {
  flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
}
.social-badge img { width: 100%; height: 100%; display: block; }
.social-names { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1 1 auto; }
.social-names .nm { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-names .mt { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-strip .pill { flex: 0 0 auto; }
.social-chev { flex: 0 0 auto; color: var(--muted); font-size: 1.2rem; line-height: 1; }

.disc { margin: 0.8rem 0 0; border-top: 1px solid var(--rule); padding-top: 0.7rem; }
.disc > summary {
  cursor: pointer; list-style: none; color: var(--muted);
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  padding: 0.25rem 0;
}
.disc > summary::-webkit-details-marker { display: none; }
.disc > summary::before { content: '▸ '; display: inline-block; transition: transform 0.15s; }
.disc[open] > summary::before { content: '▾ '; }
@media (hover: hover) { .disc > summary:hover { color: var(--soft); } }
.social-status { margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid var(--rule); }
.social-status .bad { color: var(--warn); }
.social-status a.mono {
  display: block; margin-top: 0.4rem; word-break: break-all;
  font-family: var(--mono, monospace); font-size: 0.72rem; color: var(--muted);
}
.social-test {
  margin-top: 0.8rem; padding: 0.7rem 0.85rem;
  background: var(--sunken); border: 1px solid var(--rule); border-radius: 10px;
}
.social-test .row.dim { opacity: 0.45; }

/* Appearance */
.demb .a.lead { font-size: 0.9rem; font-weight: 600; color: #F2F3F5; margin-bottom: 0.3rem; }
.demb .a .av {
  width: 1.4rem; height: 1.4rem; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #5865F2, #949BA4);
}
.demb .f.fixed { opacity: 0.45; }
.demb .f.fixed span { font-style: italic; }

.demb-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.demb-main { flex: 1 1 auto; min-width: 0; }
.demb .md-link { color: #00A8FC; }
.demb code {
  font-family: var(--mono); font-size: 0.85em;
  background: #1E1F22; border-radius: 3px; padding: 0.05rem 0.25rem;
}
.demb-thumb {
  flex: 0 0 auto; width: 2.8rem; height: 2.8rem; border-radius: 4px;
  border: 1px dashed #4E5058; background: #313338;
}
.demb-thumb-img { flex: 0 0 auto; width: 5rem; height: 5rem; object-fit: cover; border-radius: 4px; }

.demb-auth { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #F2F3F5; margin: 0 0 0.3rem; font-weight: 600; }
.demb .ft { display: flex; align-items: center; gap: 0.4rem; }
.demb-auth-ic { width: 1.25rem; height: 1.25rem; border-radius: 50%; object-fit: cover; flex: none; }

.demb-say {
  margin: 0 0 0.4rem; color: #DBDEE1; font-family: var(--sans);
  font-size: 0.9rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.demb-second { margin-top: 0.55rem; padding-top: 0.55rem; border-top: 1px dashed var(--rule); }
.demb-second .hint { margin: 0 0 0.35rem; }
.demb-second .demb-say { margin-bottom: 0.4rem; }
.demb-second img.big { display: block; width: 100%; border-radius: 4px; }

#appearance-index { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.8rem; }

.style-preview { display: grid; gap: 0.65rem; }

.color-row { display: flex; gap: 0.5rem; align-items: center; }
.color-row input[type="color"] {
  width: 2.6rem; height: 2.4rem; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--rule); border-radius: 9px; background: none; cursor: pointer;
}
.color-row input[type="text"] { flex: 1 1 auto; font-family: var(--mono, monospace); text-transform: uppercase; }
.color-row input[type="text"].bad { border-color: var(--warn); }

.chip-toggle.mono { font-family: var(--mono, monospace); font-size: 0.78rem; }

.index-group {
  margin: 1rem 0 0.35rem; padding: 0 0.2rem;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.index-group:first-child { margin-top: 0; }
.tag.on { background: var(--accent); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── overview loading / empty recovery ─────────────────────────────────── */
.overview-loading .section[data-section="overview"] .panel .rows:empty::before,
.overview-loading .section[data-section="overview"] .board:empty::before {
  content: 'Loading…';
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}
.overview-failed .section[data-section="overview"] .panel .rows:empty::before,
.overview-failed .section[data-section="overview"] .board:empty::before {
  content: 'Could not load — retrying…';
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}


/* ── Automation desks ───────────────────────────────────────────────────── */
.desk-composer {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #2a2d38) 80%, transparent);
}
.desk-composer h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.empty-desk {
  padding: 0.75rem 0.15rem 0.35rem;
}
#sched-panel .queue-head,
#reply-panel .queue-head {
  align-items: center;
}


/* === stability hard-fix (dropdowns + hover shake) ===================== */
.section, .section .panel, .form, .field, .items, .item, .gaw,
select, input, textarea, label.field, .chipset, .actions {
  transform: none !important;
  filter: none !important;
  will-change: auto !important;
}

.gaw.tappable,
.gaw.tappable .chev,
.tpl-entry,
.chip-toggle,
.guilds button,
.legal-link,
.btn {
  transition-property: background, border-color, color, opacity !important;
}

@media (hover: hover) { .gaw.tappable:hover .chev {
  transform: translateY(-50%) !important;
} }
@media (hover: hover) { .legal-link:hover {
  transform: none !important;
} }
.btn:active:not(:disabled),
.tpl-entry:active,
.chip-toggle:active,
.guilds button:active {
  transform: none !important;
}

html[data-entered] .bar,
html[data-entered] .server,
html[data-entered] .sections,
html[data-entered] .tiles > *,
html[data-entered] .section,
html[data-entered] .section .panel,
html[data-entered] .grid > *,
html[data-entered] .item[open] .body,
html[data-entered] .embed-box[open] .body {
  animation: none !important;
}

/* Tracking log — 1 card fills width; more cards share up to 3 / row */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.track-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--sunken);
  min-width: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) { .track-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  background: var(--raised);
} }
.track-card .track-title {
  margin: 0; font-size: 0.92rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-card .track-meta {
  margin: 0; font-size: 0.75rem; color: var(--muted); line-height: 1.35;
}
.track-card .field { margin: 0; }
.track-card .actions {
  margin-top: auto; padding-top: 0.35rem; border-top: none; gap: 0.4rem;
}
.track-card select { font-size: 0.84rem; }

/* backface-visibility:hidden used to sit here on every card, forcing each
   onto its own GPU layer — hundreds of layers on a busy tab, which cost more
   memory and compositing than the flicker it was meant to hide. */

.desk-composer {
  margin-top: 1rem; padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--rule));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 4%, var(--sunken));
  display: flex; flex-direction: column; gap: 0.7rem;
}
.desk-composer h3 { margin: 0; font-size: 0.95rem; }
.empty-desk { padding: 1.1rem 0.25rem 0.5rem; text-align: center; }

/* Appearance: no entrance motion on the editor (stops perceived flash) */
#appearance-body,
#appearance-body .panel,
#appearance-index,
#appearance-index * {
  animation: none !important;
}
#appearance-body .panel {
  transition: border-color 0.15s ease;
}

/* Automation creative controls */
.cadence-chips, .time-presets, .desk-composer .chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.time-presets { margin-top: 0.5rem; }
.desk-composer .chip-toggle {
  border: 1px solid var(--rule);
  background: var(--raised);
  color: var(--soft);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.desk-composer .chip-toggle.on {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--raised));
}
@media (hover: hover) { .desk-composer .chip-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--raised));
} }
.desk-composer .chip-toggle.on {
  background: color-mix(in srgb, var(--accent) 22%, var(--raised));
}

/* ── Drop Desk ───────────────────────────────────────────────────────── */
.drop-desk-head { margin: 0 0 1rem; }
.drop-title {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.drop-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0.75rem;
}
.drop-card {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--sunken);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.drop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.drop-card .live-dot {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--good);
}
.drop-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.drop-card-time {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.drop-card.kind-coins { border-color: color-mix(in srgb, var(--good) 35%, var(--rule)); }
.drop-card.kind-prize { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
.drop-compose-grid { align-items: start; }
.drop-chips, .desk-composer .chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0;
}
.drop-chips .chip-toggle, .form .chip-toggle {
  border: 1px solid var(--rule);
  background: var(--raised);
  color: var(--soft);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.form .chip-toggle.on, .form .chip-toggle[aria-pressed="true"], .drop-chips .chip-toggle.on, .drop-chips .chip-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--raised));
}
@media (hover: hover) { .form .chip-toggle:hover, .drop-chips .chip-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--raised));
} }

.form .chip-toggle[aria-pressed="true"],
.drop-chips .chip-toggle[aria-pressed="true"],
.form .chip-toggle.on,
.drop-chips .chip-toggle.on {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.drop-card.is-live { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.drop-card.is-ended { border-color: color-mix(in srgb, var(--muted) 50%, var(--rule)); opacity: 0.95; }
.live-dot {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--good);
  animation: livePulse 1.8s ease-in-out infinite;
}
.ended-dot {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted);
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.drop-card-time {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.drop-winners { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.winner-chip {
  border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.78rem;
  background: color-mix(in srgb, var(--accent) 18%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule));
}
.bonus-role-log { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.4rem 0; }
.bonus-role-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.65rem; border-radius: 10px;
  background: var(--sunken); border: 1px solid var(--rule);
}
.bonus-role-row .nm { flex: 1; font-weight: 600; }
.bonus-role-row .pr { font-size: 0.75rem; color: var(--accent); }
.hint.mono { font-family: var(--mono); font-size: 0.75rem; }

.bonus-add-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.bonus-add-row .bonus-pick {
  flex: 1;
  margin: 0;
}
.bonus-add-row .bonus-pick > span { display: none; }
.bonus-add-btn {
  flex: none;
  height: 2.35rem;
  align-self: flex-end;
  padding: 0 0.9rem;
}
.bonus-extra {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--soft);
}
.bonus-extra input {
  width: 3.2rem;
  padding: 0.2rem 0.35rem;
  text-align: center;
}
.prize-code-box input {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* Live drops pager — always full width under the card grid, never a side cell */
.drop-pager {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
  background: color-mix(in srgb, var(--panel-2, var(--panel)) 88%, transparent);
}
.drop-pager-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.drop-pager-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.drop-pager-count {
  font-size: 0.82rem;
  color: var(--soft, var(--text));
  font-variant-numeric: tabular-nums;
}
.drop-pager-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.drop-pager-dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.drop-pager-dot {
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
@media (hover: hover) { .drop-pager-dot:hover {
  color: var(--text);
  border-color: var(--rule);
} }
.drop-pager-dot.on {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--rule));
  color: var(--text);
}
.drop-pager-btn {
  min-width: 2rem;
  padding-inline: 0.55rem;
}
.drop-pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Feature-gated section tabs */
nav.sections button[hidden],
nav.sections button[aria-hidden="true"] {
  display: none !important;
}


/* ── Winner podium (ended giveaway sheet) ─────────────────────────────────── */
.win-podium {
  position: relative;
  margin: 0.35rem 0 0.85rem;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%),
    color-mix(in srgb, var(--raised) 88%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 12px 40px -18px color-mix(in srgb, var(--accent) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
  overflow: hidden;
}
.win-podium::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  animation: win-breathe 4.5s ease-in-out infinite;
}
@keyframes win-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.win-podium-label {
  position: relative;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 85%, var(--ink));
  margin-bottom: 0.65rem;
}
.win-podium-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.win-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 0 20px -8px color-mix(in srgb, var(--accent) 55%, transparent);
}
.win-chip-rank {
  flex: none;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.win-chip-name {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.win-chip-meta {
  flex: none;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}
.win-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.2rem 0.55rem 0.2rem 0.35rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 0 14px -4px color-mix(in srgb, var(--accent) 50%, transparent);
}
.win-inline .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}


/* ── App shell (Quant Lab dual-column) ─────────────────────────────────── */
html[data-state="panel"] body {
  overflow: hidden;
  height: 100%;
}
html[data-state="panel"] .bar,
html[data-state="panel"] > .bar {
  display: none !important;
}
html[data-state="panel"] #main {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100dvh;
  height: 100vh;
}
html[data-state="panel"] .view[data-view="panel"] {
  flex: 1;
  min-height: 0;
  gap: 0;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  height: 100vh;
  min-height: 0;
  background: var(--bg);
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem 0.75rem 1.5rem;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.55rem 0.75rem;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Sidebar nav overrides horizontal .sections */
.sidebar-nav.sections {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible;
}

.sidebar-nav.sections button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0 !important;
  border-radius: 12px;
  border-bottom: 0 !important;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

@media (hover: hover) { .sidebar-nav.sections button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
} }

.sidebar-nav.sections button[aria-current="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none;
  font-weight: 500;
}
.sidebar-nav.sections button[aria-current="true"] .nav-ico {
  color: var(--accent);
  opacity: 1;
}

.workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.workspace-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.workspace-section-label {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.workspace-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding:  1.5rem 1.75rem 4.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap-stack);
}

.section {
  gap: var(--gap-stack);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-card);
}

.tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.grid {
  gap: 1.15rem;
}

@media (min-width: 46rem) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 52rem) {
  .app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }
  html[data-state="panel"] body {
    overflow: auto;
    height: auto;
  }
  html[data-state="panel"] #main {
    height: auto;
  }
  .sidebar {
    flex: none;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0.75rem;
  }
  .sidebar-nav.sections {
    flex-direction: row !important;
    overflow-x: auto;
  }
  .sidebar-nav.sections button {
    width: auto;
    white-space: nowrap;
  }
  .workspace-body {
    padding: 1.15rem 1rem 2.5rem;
  }
}

/* Clean end of each tab — content stops; no endless empty card feel */
.workspace-body .section[data-active] > :last-child {
  margin-bottom: 0.5rem;
}
.workspace-body::after {
  content: "";
  display: block;
  height: 1.5rem;
  flex: none;
}
.panel {
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.tile {
  background: var(--surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.gaw {
  background: var(--sunken) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Kill any residual underline animation on nav */
.sidebar-nav.sections button::after,
.sections button::after {
  content: none !important;
  display: none !important;
}


/* ── Content isolation frame (Quant Lab main panel) ──────────────────────── */
.workspace-body {
  margin: 0 1.15rem 1.25rem !important;
  padding: 1.35rem 1.4rem 2.25rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #0B0C0E;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  /* stop infinite empty feel */
  min-height: 0;
}

.workspace-body .section[data-active] {
  padding-bottom: 0.25rem;
}

.workspace-body .section[data-active] > :last-child {
  margin-bottom: 0;
}

/* Solid cards — no glass */
.panel,
.tile {
  background: #16181D !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.gaw {
  background: #12141A !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Sidebar nav icons — Lucide stroke in tinted square */
.sidebar-nav.sections button {
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.65rem !important;
}

.nav-ico-wrap {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ico, #9397EE) 18%, transparent);
  color: var(--ico, #9397EE);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ico, #9397EE) 28%, transparent);
}

.nav-ico-wrap svg {
  display: block;
}

.sidebar-nav.sections button .nav-label {
  font-size: 0.88rem;
  font-weight: 500;
}

.sidebar-nav.sections button[aria-current="true"] {
  color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
  font-weight: 500 !important;
}

.sidebar-nav.sections button[aria-current="true"] .nav-ico-wrap {
  background: color-mix(in srgb, var(--ico, var(--accent)) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ico, var(--accent)) 28%, transparent);
}

.sidebar-nav.sections button::after {
  content: none !important;
  display: none !important;
}

html[data-state="panel"] .bar {
  display: none !important;
}


/* ═══ Quant Lab shell polish (account in frame, glass selects) ═══════════ */
html[data-state="panel"] .bar { display: none !important; }

.app-shell,
.sidebar,
.workspace {
  background: #0D0F12 !important;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding-top: 1.25rem !important;
}

.sidebar-brand {
  padding-top: 0.15rem !important;
  padding-bottom: 1rem !important;
}

.workspace-top { display: none !important; }

.workspace-body {
  margin: 0.85rem 1rem 1rem 1rem !important;
  padding: 1.1rem 1.25rem 2rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  background: #0B0C0E !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.35rem !important;
  overflow: auto !important;
  min-height: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.workspace-body::-webkit-scrollbar { width: 8px; height: 8px; }
.workspace-body::-webkit-scrollbar-track { background: transparent; }
.workspace-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
@media (hover: hover) { .workspace-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
  background-clip: padding-box;
} }

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding-bottom: 0.15rem;
}

.content-toolbar .workspace-section-label {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #F3F4F6;
}

.content-toolbar .bar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
}

.content-toolbar .bar-right img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.content-toolbar .bar-right .who {
  color: #9CA3AF;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel, .tile {
  background: #16181D !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

select.cselect-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.cselect {
  position: relative;
  width: 100%;
}

.cselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  color: #F3F4F6;
  background: #12141A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

@media (hover: hover) { .cselect-trigger:hover {
  border-color: rgba(255,255,255,0.14);
} }

.cselect-trigger:focus {
  outline: none;
  border-color: rgba(255,255,255,0.16);
  box-shadow: none;
}

.cselect-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect-chev {
  flex: none;
  width: 1rem;
  height: 1rem;
  display: grid;
  place-items: center;
  color: #9CA3AF;
  transition: transform 0.18s ease;
}

.cselect[data-open="1"] .cselect-chev {
  transform: rotate(180deg);
  color: #F3F4F6;
}

.cselect-menu {
  position: fixed;
  z-index: 4000;
  min-width: 10rem;
  max-height: min(280px, 42vh);
  overflow: auto;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(18, 20, 26, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.cselect-menu::-webkit-scrollbar { width: 6px; }
.cselect-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

.cselect-option {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.86rem;
  color: #E5E7EB;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.cselect-option[data-active="1"] {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

@media (hover: hover) { .cselect-option:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
} }

.cselect-option[aria-selected="true"] {
  background: rgba(139, 92, 246, 0.16);
  color: #E9E5FF;
}

select:focus {
  outline: none !important;
  border-color: rgba(255,255,255,0.14) !important;
  box-shadow: none !important;
}

@media (max-width: 52rem) {
  .workspace-body {
    margin: 0.5rem 0.65rem 0.75rem !important;
  }
}


/* Unified canvas — content frame is stroke only */
.app-shell, .sidebar, .workspace, .workspace-body {
  background: #0D0F12 !important;
}
.sidebar {
  border-right: none !important;
}
.workspace-body {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #0D0F12 !important;
  border-radius: 16px !important;
}

/* Modern scrollbars everywhere */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
@media (hover: hover) { *::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
  background-clip: padding-box;
} }

.sheet {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

/* Toggle: text not a click target */
.toggle {
  cursor: default !important;
}
.toggle .toggle-text {
  cursor: default;
  pointer-events: none;
}
.toggle input {
  cursor: pointer !important;
  flex: none;
}

/* Appearance category switcher */
.appear-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.appear-cat {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9CA3AF;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
@media (hover: hover) { .appear-cat:hover { color: #F3F4F6; border-color: rgba(255,255,255,0.14); } }
.appear-cat.on {
  color: #E9E5FF;
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.35);
}
.appear-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
#appearance-index {
  max-height: none !important;
  overflow: visible !important;
}

/* Ensure native selects stay hidden when enhanced */
select.cselect-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}


/* Appearance segmented control */
.appear-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.appear-seg-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9CA3AF;
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
@media (hover: hover) { .appear-seg-btn:hover { color: #F3F4F6; background: rgba(255,255,255,0.04); } }
.appear-seg-btn.on {
  color: #F3F4F6;
  background: #1A1D24;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}

/* Prize sheet winner tabs + compact foot */
.prize-winner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.55rem;
}
.prize-winner-tab {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: #A1A1AA;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prize-winner-tab.on {
  color: #E9E5FF;
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.14);
}

.sheet .actions .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}
.sheet .btn.primary.small,
.sheet .btn.small {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 9px;
}


/* Dropdown enter / leave */
.cselect-menu {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.cselect-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cselect-menu.is-leaving {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
}
/* When menu opens upward, grow from bottom */
.cselect-menu[data-flip="1"] {
  transform-origin: bottom center;
}
.cselect-menu[data-flip="1"].is-open {
  transform: translateY(0) scale(1);
}
.cselect-menu[data-flip="1"].is-leaving {
  transform: translateY(4px) scale(0.98);
}


/* Soft remove for live/history cards and list rows */
.drop-card,
.gaw,
.item,
.sheet-row {
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.22s ease, margin 0.22s ease, padding 0.22s ease;
}
.drop-card.is-leaving,
.gaw.is-leaving,
.item.is-leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
  pointer-events: none;
}


/* Save / primary actions: busy = still clearly the main button, not “dead grey” */
.btn.primary:disabled,
.btn.primary.is-busy {
  opacity: 0.85;
  filter: none;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: wait;
}
.btn.primary:not(:disabled):not(.is-busy) {
  opacity: 1;
}


/* ── Giveaway roster (panel) ─────────────────────────────────────────────── */
.roster-loading {
  padding: 1.5rem 0;
  text-align: center;
  color: var(--soft);
  animation: roster-pulse 1.2s ease-in-out infinite;
}
@keyframes roster-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.roster-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.roster-count {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.roster-count-num {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}
.roster-count-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft);
}
.roster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}
.roster-prize {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-id {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--soft);
}
.roster-flag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.15);
  color: #f5a9a0;
  border: 1px solid rgba(231, 76, 60, 0.35);
}
.roster-empty {
  padding: 1.75rem 0.5rem;
  text-align: center;
  color: var(--soft);
  font-size: 0.9rem;
}
.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 0.15rem;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  animation: roster-in 0.35s ease both;
  transition: background 0.15s, border-color 0.15s, opacity 0.22s, transform 0.22s;
}
@keyframes roster-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (hover: hover) { .roster-row:hover {
  background: var(--raised);
  border-color: var(--rule);
} }
.roster-row.is-young {
  border-color: rgba(231, 76, 60, 0.25);
  background: rgba(231, 76, 60, 0.06);
}
.roster-row.is-leaving {
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
}
.roster-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: var(--raised);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--soft);
}
.roster-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roster-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.roster-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-sub {
  font-size: 0.72rem;
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-actions {
  flex: none;
}
.roster-remove {
  opacity: 0.85;
}
@media (hover: hover) { .roster-row:hover .roster-remove {
  opacity: 1;
} }


/* ── confirm overlay (does not replace sheet) ───────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.confirm-card {
  width: min(100%, 22rem);
  background: var(--panel, var(--raised, #1a1b22));
  border: 1px solid var(--rule, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.confirm-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--ink, #f2f2f7);
}
.confirm-msg {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.confirm-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap;
}


/* Tickets — opener mention */
.ticket-opener {
  color: var(--accent, #a78bfa);
  font-weight: 600;
  font-variant-numeric: normal;
}
.ticket-open-card .actions {
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Tracking log desk wraps grid + pager */
.track-desk {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.track-pager {
  margin-top: 0.15rem;
}


/* Tracking log — show / hide */
.track-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 0.35rem;
}
.track-log-head h3 { margin: 0; }
.track-log-toggle { flex: none; }
.track-log-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.28s ease,
              transform 0.28s ease;
}
.track-log-body.is-open {
  max-height: 2400px;
  opacity: 1;
  transform: none;
}
.track-log-summary { margin: 0.15rem 0 0.75rem; }
@media (prefers-reduced-motion: reduce) {
  .track-log-body { transition: none; }
}




/* cselect: scrollable list + optional search (Quick Action only) */
.cselect-menu {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cselect-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.45rem 0.5rem;
  background: inherit;
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.cselect-search input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: color-mix(in srgb, #000 22%, transparent);
  color: inherit;
  padding: 0.4rem 0.55rem;
  font: inherit;
  outline: none;
}
.cselect-search input:focus {
  border-color: color-mix(in srgb, #a78bfa 50%, transparent);
}
.cselect-list {
  /* options live here so search stays sticky while list scrolls */
}
.cselect-empty {
  padding: 0.7rem 0.85rem;
  opacity: 0.55;
  font-size: 0.9em;
}
.cselect-option.is-selected {
  font-weight: 600;
}

/* Composer: embed indicator on template list */
.tpl-entry .tpl-embed-mark {
  display: inline-block;
  color: #c4b5fd;
  font-size: 0.75em;
  margin-right: 0.15em;
  opacity: 0.9;
  vertical-align: middle;
}
.composer-empty-embeds {
  padding: 0.75rem 0.25rem 0.25rem;
  opacity: 0.85;
}

.composer-plain {
  margin: 0.75rem 0 0.5rem;
  padding: 0.15rem 0 0.35rem;
}
.composer-plain > h2 {
  margin-bottom: 0.25rem;
}

/* Compact image source: pill + menu + upload */
.img-source-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  max-width: 100%;
}
.img-source-pill {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 22rem);
  display: flex;
  align-items: center;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: color-mix(in srgb, #000 22%, transparent);
  overflow: visible;
}
.img-source-pill input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.5rem 0.65rem;
  outline: none;
}
.img-source-pill input[readonly] {
  cursor: default;
  opacity: 0.95;
}
.img-source-chev {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 100%;
  border: 0;
  border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  border-radius: 0 10px 10px 0;
}
@media (hover: hover) { .img-source-chev:hover { opacity: 1; background: color-mix(in srgb, #fff 6%, transparent); } }
.img-source-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 14rem;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: #1a1b22;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  padding: 0.25rem;
}
.img-source-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}
@media (hover: hover) { .img-source-opt:hover { background: color-mix(in srgb, #a78bfa 18%, transparent); } }
.img-source-opt.on { background: color-mix(in srgb, #a78bfa 28%, transparent); font-weight: 600; }
.img-source-up {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}

.drop-card .empty-dot {
  background: color-mix(in srgb, #ef4444 22%, transparent);
  color: #fca5a5;
  border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
}

.whop-app-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 10px 0 6px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .whop-app-groups {
    grid-template-columns: 1fr;
  }
}
.whop-app-group {
  margin: 0;
  padding: 12px 14px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--stroke, #2a2a35) 80%, transparent);
  background: color-mix(in srgb, var(--panel, #12121a) 92%, transparent);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.whop-app-group-title {
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0;
  line-height: 1.3;
}
.whop-app-group > .hint {
  margin: 0 0 4px;
}
.whop-app-group > .field,
.whop-app-group > .actions {
  margin-top: 2px;
}

/* ── Overview members roster ─────────────────────────────────────────── */
.members-panel { grid-column: 1 / -1; }
.members-search-wrap { margin: 0 0 0.75rem; }
.members-search {
  width: 100%; box-sizing: border-box;
  padding: 0.6rem 0.85rem 0.6rem 2.25rem;
  border-radius: 12px; border: 1px solid var(--rule);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E")
    0.75rem 50% / 16px no-repeat,
    color-mix(in oklab, var(--panel) 80%, black);
  color: var(--ink); font-size: 0.9rem; outline: none;
}
.members-search:focus {
  border-color: color-mix(in oklab, #9397EE 55%, var(--rule));
  box-shadow: 0 0 0 3px color-mix(in oklab, #9397EE 18%, transparent);
}
.members-search::placeholder { color: var(--muted); opacity: 0.75; }
.members-roster {
  max-height: 440px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule); border-radius: 14px;
  background: color-mix(in oklab, var(--panel) 88%, black);
}
.members-empty { padding: 1.25rem 1rem; text-align: center; }
.members-list { display: flex; flex-direction: column; }
.member-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--rule);
  min-width: 0; width: 100%; box-sizing: border-box;
}
.member-info { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.member-row:last-child { border-bottom: none; }
.member-row.is-owner { background: color-mix(in oklab, #9397EE 10%, transparent); }
.member-row.is-admin:not(.is-owner) { background: color-mix(in oklab, #9397EE 5%, transparent); }
.member-av {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: color-mix(in oklab, var(--ink) 12%, transparent);
  display: grid; place-items: center; font-weight: 600; font-size: 0.85rem;
}
.member-av img { width: 100%; height: 100%; object-fit: cover; }
.member-info { flex: 1; min-width: 0; }
.member-name {
  display: flex; align-items: center; gap: 0.45rem;
  font-weight: 600; font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-rank {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.12rem 0.4rem; border-radius: 999px;
  background: color-mix(in oklab, #9397EE 22%, transparent); color: #c5c8ff; flex-shrink: 0;
}
.member-user {
  font-size: 0.75rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-roles { display: flex; flex-wrap: wrap; gap: 0.28rem; margin-top: 0.28rem; }
.role-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; max-width: 140px;
  padding: 0.12rem 0.45rem 0.12rem 0.35rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 500; line-height: 1.3;
  color: color-mix(in oklab, var(--ink) 88%, transparent);
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-pill.has-color {
  background: color-mix(in oklab, var(--role-c) 14%, transparent);
  border-color: color-mix(in oklab, var(--role-c) 28%, transparent);
  color: color-mix(in oklab, var(--role-c) 55%, var(--ink));
}
.role-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in oklab, var(--ink) 35%, transparent);
}
.role-pill.more { opacity: 0.7; font-weight: 600; }
.role-pill-x {
  border: 0; background: transparent; color: inherit; opacity: 0.55;
  cursor: pointer; font-size: 0.85rem; line-height: 1; padding: 0 0.05rem; margin-left: 0.05rem;
}
@media (hover: hover) { .role-pill-x:hover { opacity: 1; color: #f87171; } }
.member-check { flex-shrink: 0; }
.member-pad-hero { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0 0.2rem; }
.member-pad-av {
  width: 72px; height: 72px; border-radius: 18px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, #9397EE33, #9397EE11);
  border: 1px solid color-mix(in oklab, #9397EE 35%, transparent);
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
}
.member-pad-av img { width: 100%; height: 100%; object-fit: cover; }
.member-pad-meta { min-width: 0; }
.member-pad-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.member-pad-user { color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; }
.member-pad-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem;
}
.member-pad-roles, .member-pad-assign, .member-pad-actions, .member-pad-dm { margin-top: 0.15rem; }
.member-pad-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.member-pad-chips .role-pill { max-width: none; font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.member-pad-assign-row { display: flex; gap: 0.5rem; align-items: center; }
.member-pad-assign-row select {
  flex: 1; min-width: 0;
  background: color-mix(in oklab, var(--panel) 80%, black);
  border: 1px solid var(--rule); border-radius: 10px;
  color: var(--ink); padding: 0.45rem 0.6rem;
}
.member-pad-dm textarea {
  width: 100%; box-sizing: border-box; min-height: 72px; resize: vertical;
  padding: 0.55rem 0.7rem; border-radius: 12px; border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--panel) 80%, black);
  color: var(--ink); font: inherit; font-size: 0.88rem; outline: none;
}
.member-pad-dm textarea:focus {
  border-color: color-mix(in oklab, #9397EE 55%, var(--rule));
  box-shadow: 0 0 0 3px color-mix(in oklab, #9397EE 18%, transparent);
}
.member-pad-dm-row { display: flex; justify-content: flex-end; margin-top: 0.45rem; }
.member-pad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.member-pad-grid .btn { width: 100%; justify-content: center; }


/* ── Mobile layout lock: no horizontal scroll, cards fit the phone ── */
@media (max-width: 52rem) {
  html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }
  html[data-state="panel"] body {
    overflow-x: clip !important;
  }
  #main,
  .app-shell,
  .workspace,
  .workspace-body,
  .section,
  .grid,
  .panel,
  .tiles,
  .members-panel,
  .members-roster,
  .members-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .workspace-body {
    padding: 0.85rem 0.75rem 2.5rem !important;
    overflow-x: clip !important;
  }
  .workspace-top {
    padding: 0.75rem 0.85rem !important;
  }
  .panel {
    padding: 0.9rem 0.85rem !important;
    overflow: hidden;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }
  .tile {
    padding: 0.7rem 0.75rem;
    min-width: 0;
  }
  .tile .n { font-size: 1.15rem; }
  .member-row {
    gap: 0.5rem !important;
    padding: 0.65rem 0.55rem !important;
    min-width: 0;
  }
  .member-info {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }
  .member-name,
  .member-user {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .member-roles {
    max-width: 100%;
    overflow: hidden;
  }
  .member-check {
    flex: 0 0 auto !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .row { gap: 0.5rem; }
  .sidebar {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
}


/* Member mod pad — join + account age */
.member-pad-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.65rem;
  width: 100%;
  min-width: 0;
}
.member-pad-time-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent, #7c6cff) 22%, var(--rule, #2a2d38));
  background: color-mix(in srgb, var(--accent, #7c6cff) 6%, var(--sunken, #12141a));
  min-width: 0;
}
.member-pad-time-k {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8b90a0);
}
.member-pad-time-v {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink, #e8eaf0);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 52rem) {
  .member-pad-timeline { grid-template-columns: 1fr; }
}

/* ── Trading rank / engagement cockpit ─────────────────────────────────── */
.rank-health { display: flex; flex-direction: column; gap: 1rem; }
.rank-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 52rem) {
  .rank-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rank-kpi {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #7c6cff) 20%, var(--rule, #2a2d38));
  background: color-mix(in srgb, var(--accent, #7c6cff) 7%, var(--sunken, #12141a));
  min-width: 0;
}
.rank-kpi-v {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink, #e8eaf0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-kpi-k {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8b90a0);
}
.rank-mix-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8b90a0);
  margin-bottom: 0.45rem;
}
.rank-mix-bars { display: flex; flex-direction: column; gap: 0.35rem; }
.rank-mix-line {
  display: grid;
  grid-template-columns: 4.5rem 1fr 2.2rem;
  gap: 0.45rem;
  align-items: center;
}
.rank-mix-name { font-size: 0.78rem; color: var(--soft, #b4b4be); }
.rank-mix-track {
  height: 6px;
  border-radius: 999px;
  background: var(--sunken, #12141a);
  border: 1px solid var(--rule, #2a2d38);
  overflow: hidden;
}
.rank-mix-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #7c6cff) 70%, #5b9fd4), var(--accent, #7c6cff));
}
.rank-mix-pct { font-size: 0.72rem; color: var(--muted, #8b90a0); text-align: right; }

.rank-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 52rem) {
  .rank-signal-grid { grid-template-columns: 1fr; }
}
.rank-signal-card {
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--rule, #2a2d38);
  background: var(--sunken, #12141a);
  min-width: 0;
}
.rank-signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.rank-signal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink, #e8eaf0);
}
.rank-signal-card .field { margin-top: 0.45rem; }

.rank-board-list { display: flex; flex-direction: column; gap: 0.45rem; }
.rank-board-row {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--rule, #2a2d38);
  background: color-mix(in srgb, var(--surface, #1a1b22) 80%, var(--sunken, #12141a));
}
.rank-board-name { font-weight: 650; font-size: 0.92rem; }
.rank-board-sub { font-size: 0.75rem; color: var(--muted, #8b90a0); margin-top: 0.15rem; }
.rank-board-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.rank-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent, #7c6cff) 25%, var(--rule, #2a2d38));
  background: color-mix(in srgb, var(--accent, #7c6cff) 10%, transparent);
  color: var(--ink, #e8eaf0);
  text-transform: capitalize;
}
.rank-chip.dim { opacity: 0.55; font-weight: 500; }


/* ── Trading rank (Engagement) ─────────────────────────────────────────── */
.rank-mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rank-mode-row .btn.primary { box-shadow: 0 0 0 1px rgba(232,121,249,.35); }
.rank-legend {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232,121,249,.06);
  border: 1px solid rgba(232,121,249,.12);
}
.rank-legend-title {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
  margin-bottom: 8px;
}
.rank-legend-row {
  font-size: 13px;
  padding: 4px 0;
  color: var(--text, #e2e8f0);
}
.rank-board-list { display: flex; flex-direction: column; gap: 6px; }
.rank-board-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.rank-board-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-board-pos {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: rgba(232,121,249,.15); color: #E879F9;
}
.rank-board-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-board-lvl { font-size: 12px; color: var(--muted, #94a3b8); }
.rank-board-xp { font-variant-numeric: tabular-nums; font-weight: 600; color: #E879F9; }
.rank-setup select[multiple] {
  width: 100%; min-height: 88px;
  background: rgba(0,0,0,.25); color: inherit;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.08);
  padding: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dark glass restore — bg #0b0b0c, atmosphere, glass cards
   ═══════════════════════════════════════════════════════════════════════════ */

html, body {
  background: var(--bg, #0b0b0c) !important;
}

.app-shell,
.workspace,
.workspace-body,
main,
#main {
  background: transparent !important;
}

.panel,
.tile,
.members-panel,
.workspace-body .panel,
.studio .stage-frame,
.sheet-card,
.gaw {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  /* No backdrop blur on in-page cards: they sit on a near-solid background,
     so it barely showed, but every scroll re-blurred every card on screen —
     the main source of scroll jank. Only the floating sheet keeps it. */
}
.sheet-card {
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* Composer / Appearance: two cards (list + editor), not one square */
.composer {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  gap: 1.1rem;
}

.tpl-list,
.composer-body,
#composer-body,
#appearance-body {
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 14px !important;
  min-height: 12rem;
  padding: 1rem 1.1rem;
  box-sizing: border-box;
}

#composer-body:has(> p.muted:only-child) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
}
#composer-body > p.muted {
  text-align: center;
  margin: 0;
  max-width: 16rem;
}

.bar {
  /* Near-opaque, no live blur: at 88% it barely showed, but a sticky
     backdrop-filter re-blurs everything scrolling under it every frame. */
  background: rgba(11, 11, 12, 0.96) !important;
  border-color: var(--line, #232327) !important;
}

.sidebar {
  background: rgba(11, 11, 12, 0.96) !important; /* no live blur, as .bar */
  border-color: var(--line, #232327) !important;
}

/* Whole panels no longer change background on hover: moving the mouse
   across the page flashed every panel it passed over. Interactive rows and
   buttons inside keep their own hover states. */

.members-roster {
  background: rgba(13, 13, 15, 0.72) !important;
  border: 1px solid var(--line, #232327) !important;
  border-radius: 11px;
}

.members-roster .member-row,
.member-row {
  background: transparent !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: 1px solid var(--line, #232327) !important;
  backdrop-filter: none !important;
}
.member-row:last-child { border-bottom: none !important; }
@media (hover: hover) { .member-row:hover {
  background: rgba(255, 255, 255, 0.012) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
} }
@media (hover: hover) { .member-row.is-owner:hover {
  background: linear-gradient(90deg, rgba(34, 51, 245, 0.06), rgba(255, 255, 255, 0.01) 55%) !important;
} }
@media (hover: hover) { .member-row.is-admin:not(.is-owner):hover {
  background: linear-gradient(90deg, rgba(34, 51, 245, 0.04), rgba(255, 255, 255, 0.01) 50%) !important;
} }

.members-search,
.field input,
.field select,
.field textarea,
.cselect-trigger {
  background: var(--inset, #0d0d0f) !important;
  border-color: var(--line, #232327) !important;
}

.btn.primary,
button.primary {
  background: var(--blue, #2233f5) !important;
  border-color: var(--blue-line, #2a318a) !important;
}
@media (hover: hover) { .btn.primary:hover, button.primary:hover {
  background: var(--blue2, #4d5cff) !important;
} }

.sheet-card {
  background: rgba(15, 17, 48, 0.92) !important;
  border: 1px solid var(--blue-line, #2a318a) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 50px -8px rgba(34, 51, 245, 0.35);
}

.sidebar-nav.sections button[aria-current="true"] {
  color: var(--blue2, #4d5cff) !important;
  background: rgba(34, 51, 245, 0.12) !important;
  font-weight: 500 !important;
}
.sidebar-nav.sections button[aria-current="true"] .nav-label {
  color: var(--blue2, #4d5cff);
  font-weight: 500;
}

/* ── Mobile equal gutters: center content, equal L/R space ─────────────── */
@media (max-width: 52rem) {
  html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }

  #main,
  .app-shell,
  .workspace {
    width: 100% !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .workspace-body {
    width: auto !important;
    max-width: 100% !important;
    margin-left: max(0.75rem, env(safe-area-inset-left)) !important;
    margin-right: max(0.75rem, env(safe-area-inset-right)) !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.85rem !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    box-sizing: border-box !important;
  }

  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: max(0.75rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.75rem, env(safe-area-inset-right)) !important;
    box-sizing: border-box !important;
  }

  .content-toolbar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .panel,
  .members-panel,
  .composer,
  .tpl-list,
  .composer-body,
  #composer-body,
  #appearance-body,
  .section[data-active] {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sidebar-nav.sections {
    padding-left: 0.15rem !important;
    padding-right: 0.15rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-nav.sections::-webkit-scrollbar { display: none; }
}

.roster-name-row{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.roster-entries{font-size:.68rem;font-weight:600;letter-spacing:.02em;padding:.12rem .45rem;border-radius:999px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);color:rgba(255,255,255,.55);white-space:nowrap}
.roster-entries.is-bonus{background:rgba(34,51,245,.18);border-color:rgba(77,92,255,.35);color:#a8b0ff}
.prize-image-row{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin-top:.55rem}
.prize-image-name{font-size:.78rem;color:rgba(255,255,255,.5)}


/* Sidebar focus ring: only while the keyboard is moving focus (html[data-kbd],
 * set in app.full.js), and drawn inset — the nav scrolls, so a ring outside
 * the button was clipped to a stray purple stroke along its bottom edge. */
.sidebar-nav button:focus,
.sidebar-nav button:focus-visible { outline: none; box-shadow: none; }
html[data-kbd] .sidebar-nav button:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.65);
  outline-offset: -2px;
}


/* Composer V2 — compact structure editor */
.composer-v2 .composer-v2-list { margin-top: .35rem; }
.composer-v2-row select { max-width: 72px; }
.composer-v2-row textarea,
.composer-v2-row input[type=url] {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.composer-v2-preview { margin-top: .5rem; }
.composer-v2 .queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}
.composer-v2 .queue-head h2 { margin: 0; }
@media (max-width: 720px) {
  .composer-v2-row {
    grid-template-columns: 1fr !important;
  }
}

/* Composer V2 — stable progressive editor */
.composer-v2 .queue-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.35rem}
.composer-v2 .queue-head h2{margin:0}
.composer-v2-list{margin-top:.25rem}
.composer-v2-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:.5rem .65rem;
  align-items:start;
  padding:.65rem 0;
  border-bottom:1px solid var(--rule,#2a2d38);
}
.composer-v2-types{display:flex;flex-wrap:wrap;gap:.3rem;grid-column:1 / -1}
.composer-v2-types .btn.on{outline:1px solid var(--accent,#5865F2);background:rgba(88,101,242,.12)}
.composer-v2-row textarea,
.composer-v2-row input[type=url]{width:100%;box-sizing:border-box;margin:0}
.composer-v2-tools{display:flex;flex-direction:column;gap:.2rem}
.composer-v2-add{margin-top:.55rem;flex-wrap:wrap;gap:.35rem}
.composer-v2-preview{margin-top:.35rem}
.composer-v2-components{margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--rule,#2a2d38)}
@media (max-width:720px){
  .composer-v2-row{grid-template-columns:1fr}
  .composer-v2-tools{flex-direction:row}
}

.lvl-daily-lb h3{margin:1rem 0 .35rem;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#949ba4)}
.lvl-daily-sched{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.35rem 0}
.lvl-daily-preview{margin-top:.75rem}
.lvl-daily-lb input[type=text],.lvl-daily-lb input[type=time],.lvl-daily-lb select{width:100%;max-width:320px;margin:.25rem 0}
.composer-save-bar{box-shadow:0 -8px 24px rgba(0,0,0,.25)}

/* Composer canvas — stable single preview */
.composer-canvas .composer-mode-row{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;margin-bottom:.75rem}
.composer-canvas-body{display:flex;flex-direction:column;gap:.45rem;min-height:5rem}
.composer-block{display:grid;grid-template-columns:1fr auto;gap:.35rem;align-items:start}
.composer-block textarea{width:100%;min-height:5.5rem;resize:vertical;box-sizing:border-box;margin:0;border-radius:10px;transition:none}
.composer-block textarea.composer-heading-input{min-height:2.6rem;font-size:1.12rem;font-weight:700}
.composer-block.is-sep{min-height:0;padding:.2rem 0}
.composer-sep-line{height:1px;background:#3a3e4a;width:100%;margin:.35rem 0}
.composer-block-tools{display:flex;flex-direction:column;gap:.2rem;opacity:.4}
@media (hover: hover) { .composer-block:hover .composer-block-tools {opacity:1} }
.composer-toolbar{display:flex;flex-wrap:wrap;gap:.4rem;align-items:flex-end;padding:.6rem 0;margin-top:.4rem;border-top:1px solid var(--rule,#2a2d38);position:sticky;bottom:3.4rem;background:var(--panel,#12131a);z-index:5}
.composer-live-preview{margin-top:.5rem}
.composer-live-preview .v2-preview-card{
  background:#1e1f22;border:1px solid #2a2d38;border-radius:12px;
  padding:14px 16px;min-height:3.25rem;max-width:100%;
}
.composer-live-preview .v2-preview-card > * + *{margin-top:.5rem}
.v2-sep{height:1px;background:#3a3e4a;margin:.65rem 0;width:100%}
.v2-h1{font-weight:800;font-size:1.25rem}
.v2-h2{font-weight:700;font-size:1.1rem}
.v2-h3{font-weight:600;font-size:1rem}
.v2-text{line-height:1.5;color:#dbdee1;white-space:pre-wrap}
.v2-text.placeholder,.v2-h1.placeholder,.v2-h2.placeholder,.v2-h3.placeholder{opacity:.4}
.v2-media{padding:18px;border:1px dashed #3a3e4a;border-radius:8px;text-align:center;color:#949ba4;font-size:.85rem}
.composer-bold{font-weight:800}
/* Leveling schedule chips — in-web only */
.lvl-time-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.35rem 0 .5rem}
.lvl-auto-card h3{margin:.9rem 0 .3rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#949ba4)}
.lvl-auto-next{margin:.45rem 0 .6rem}
.lvl-auto-card input[type=time],.lvl-auto-card input[type=text]{max-width:280px;width:100%;margin:.25rem 0}


/* Unified composer preview — single message card */
.composer-live-preview{margin-top:.65rem}
.composer-live-preview .v2-preview-card{
  background:#1e1f22;
  border:1px solid #2a2d38;
  border-radius:12px;
  padding:14px 16px;
  min-height:3.5rem;
  max-width:100%;
}
.composer-live-preview .v2-preview-card > * + *{margin-top:.55rem}
.v2-sep{height:1px;background:#3a3e4a;margin:.85rem 0;border:0;padding:0}
.composer-canvas-body{min-height:4rem}
.composer-toolbar{
  position:sticky;bottom:3.25rem;z-index:5;
  background:var(--panel,#12131a);
  border-top:1px solid var(--rule,#2a2d38);
  padding:.55rem 0;
  display:flex;flex-wrap:wrap;gap:.4rem;align-items:flex-end;
}
/* Prevent layout thrash on cselect open */
.composer-canvas,.composer-canvas .panel{overflow:visible}
.composer-block textarea{transition:none}
.lvl-auto-time{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.35rem 0}
.lvl-auto-time select,.pill-select{min-width:7rem}


/* Leveling schedule chips */
.lvl-time-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.4rem 0 .6rem}
.lvl-time-chips .chip-toggle{min-width:auto}
.lvl-auto-card h3{margin:1rem 0 .35rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#949ba4)}
.lvl-auto-next{margin:.5rem 0 .75rem}
/* Composer: one message preview */
.composer-live-preview .v2-preview-card{
  background:#1e1f22;border:1px solid #2a2d38;border-radius:12px;
  padding:14px 16px;min-height:3rem;
}
.composer-live-preview .v2-preview-card > .v2-text + .v2-sep,
.composer-live-preview .v2-preview-card > .v2-h1 + .v2-sep,
.composer-live-preview .v2-preview-card > .v2-h2 + .v2-sep,
.composer-live-preview .v2-preview-card > .v2-h3 + .v2-sep{margin-top:.75rem}
.v2-sep{display:block;height:1px;background:#3a3e4a;margin:.75rem 0;width:100%}
.composer-block.is-sep{min-height:0;padding:.15rem 0}
.composer-block.is-sep .composer-sep-line{margin:.4rem 0}


/* Composer: separator is a thin rule, not a second section */
.composer-block.is-sep{
  min-height:0;padding:.15rem 0;grid-template-columns:1fr auto;align-items:center;
}
.composer-sep-wrap{display:flex;align-items:center;min-height:1.25rem;width:100%}
.composer-sep-line{height:1px;width:100%;background:#3a3e4a;margin:0}
.composer-block.is-sep .composer-block-tools{opacity:.35;flex-direction:row}
.composer-heading-input{font-size:1.15rem;font-weight:700;min-height:2.75rem!important}
.composer-live-preview .v2-preview-card{
  background:#1e1f22;border:1px solid #2a2d38;border-radius:12px;
  padding:14px 16px;min-height:3rem;
}
.composer-live-preview .v2-preview-card .v2-sep{margin:.65rem 0}

.lvl-time-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:.35rem 0}
.lvl-time-input{width:5.5rem;padding:.45rem .6rem;border-radius:8px;border:1px solid var(--rule,#2a2d38);background:var(--panel,#12131a);color:inherit;font-variant-numeric:tabular-nums}
.lvl-time-err{color:#f23f43;font-size:.8rem}
.composer-canvas .composer-msg{display:flex;flex-direction:column;gap:0;border:1px solid var(--rule,#2a2d38);border-radius:12px;padding:.5rem .65rem;background:#12141a}
.composer-seg{display:grid;grid-template-columns:1fr auto;gap:.35rem;align-items:start;padding:.2rem 0}
.composer-seg textarea{width:100%;border:none;background:transparent;resize:vertical;min-height:2.8rem;box-shadow:none;margin:0}
.composer-block-tools{opacity:0}.composer-seg:focus-within .composer-block-tools {opacity:.85}@media (hover: hover) { .composer-seg:hover .composer-block-tools {opacity:.85} }

/* One continuous contenteditable message canvas */
.composer-msg-canvas{
  min-height:12rem;padding:14px 16px;border:1px solid var(--rule,#2a2d38);border-radius:12px;
  background:#1e1f22;color:#dbdee1;line-height:1.55;outline:none;
}
.composer-msg-canvas:empty:before,.composer-msg-canvas .c-text:empty:before{opacity:.35}
.composer-msg-canvas .c-text{margin:0 0 .35rem;min-height:1.2em}
.composer-msg-canvas .c-heading{font-weight:800;font-size:1.2rem;margin:0 0 .4rem;min-height:1.3em}
.composer-msg-canvas .c-sep{margin:.55rem 0;padding:.15rem 0;user-select:none}
.composer-msg-canvas .c-sep-line{display:block;height:1px;background:#3a3e4a;width:100%}
.composer-msg-canvas .c-media{
  margin:.45rem 0;padding:12px;border:1px dashed #3a3e4a;border-radius:8px;
  color:#949ba4;font-size:.85rem;user-select:none;
}
.composer-msg-canvas .c-btn{display:inline-block;margin:.35rem .35rem 0 0;cursor:pointer;user-select:none}
.composer-btn-editor{margin-top:.5rem;padding:.65rem;border:1px solid var(--rule,#2a2d38);border-radius:10px}
.composer-toolbar{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.55rem;padding-top:.55rem;border-top:1px solid var(--rule,#2a2d38)}


/* Category headers inside cselect menus (channel dropdowns) */
.cselect-menu .cselect-group{
  padding:.45rem .75rem .2rem;
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--muted,#949ba4);
  opacity:.9;
  pointer-events:none;
  user-select:none;
}
.cselect-menu .cselect-group + .cselect-option{margin-top:.1rem}


/* Leveling — daily time picker */
.lvl-time-row{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem 1.1rem;
  align-items:flex-end;
  margin:.4rem 0 .85rem;
}
.lvl-time-field{ min-width:0; flex:0 0 auto; }
.lvl-time-field>span{
  display:block;
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.05em;
  opacity:.6;
  margin-bottom:.28rem;
}
.lvl-time-field .cselect{ min-width:5rem; }
.lvl-time-field .cselect-trigger{
  min-width:5rem;
  justify-content:center;
  font-variant-numeric:tabular-nums;
  font-weight:600;
  font-size:.95rem;
  letter-spacing:.04em;
  padding:.5rem .85rem;
  border-radius:10px;
}
.lvl-time-field .cselect-value{
  text-align:center;
  width:100%;
  font-variant-numeric:tabular-nums;
}
/* Time option rows: plain centered digits (no badge look) */
.lvl-time-field .cselect-menu .cselect-option,
.cselect-menu .cselect-option{
  font-variant-numeric:tabular-nums;
}
.lvl-time-field ~ .cselect-menu .cselect-option,
body > .cselect-menu .cselect-option{
  font-variant-numeric:tabular-nums;
  font-weight:500;
  letter-spacing:.02em;
}
/* Selected time option: subtle fill, not a blue number pill */
body > .cselect-menu .cselect-option.is-selected{
  background:rgba(88,101,242,.18);
  color:inherit;
  font-weight:600;
}

/* Category headers in channel menus */
.cselect-menu .cselect-group{
  padding:.5rem .75rem .15rem;
  font-size:.65rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted,#949ba4);
  pointer-events:none;
  user-select:none;
}


/* Channel names: Discord emoji render cleanly in dropdowns */
.cselect-value,
.cselect-option,
.cselect-group,
.cselect-trigger {
  /* cselect-emoji-fonts */
  font-family: inherit, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.cselect-option { line-height: 1.35; }

/* ── Composer: live preview, split layout, list badges ───────────────────── */
.composer-body { container-type: inline-size; }
.composer-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.15rem; align-items: start; }
.composer-edit { display: flex; flex-direction: column; gap: 1.15rem; min-width: 0; }
.composer-preview-pane {
  border: 1px solid var(--rule); border-radius: 16px; padding: 0.9rem 1rem 0.6rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent); min-width: 0;
}
.composer-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.composer-preview-head h2 { margin: 0; }
.composer-preview-stage { background: #313338; border-radius: 12px; padding: 0.85rem 0.9rem; overflow: hidden; }
.composer-tabs { display: flex; gap: 0.3rem; padding: 0.25rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--sunken); }
.composer-tab {
  flex: 1; font: inherit; font-size: 0.85rem; color: var(--soft); background: none;
  border: 0; border-radius: 9px; padding: 0.5rem; cursor: pointer;
}
.composer-tab[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.composer-split[data-tab="edit"] .composer-preview-pane { display: none; }
.composer-split[data-tab="preview"] .composer-edit { display: none; }
@container (min-width: 50rem) {
  .composer-tabs { display: none; }
  .composer-split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .composer-split[data-tab] .composer-edit { display: flex; }
  .composer-split[data-tab] .composer-preview-pane { display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}

/* A Discord message: avatar, name, APP tag, time */
.dmsg { display: flex; gap: 0.75rem; align-items: flex-start; color: #dbdee1; font-size: 0.92rem; line-height: 1.375; }
.dmsg-av { width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; object-fit: cover; background: #1e1f22; }
.dmsg-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.dmsg-head { display: flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; }
.dmsg-name { font-weight: 600; color: #f2f3f5; }
.dmsg-app { font-size: 0.62rem; font-weight: 700; background: #5865f2; color: #fff; border-radius: 3px; padding: 0.05rem 0.28rem; transform: translateY(-1px); }
.dmsg-time { font-size: 0.72rem; color: #949ba4; }
.dmsg .demb { margin: 0; max-width: 32rem; }
.dmsg .demb-say, .dmsg .demb .d, .dmsg .fv, .dmsg .v2-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.dmsg .demb-say { margin: 0; }
.dmsg img.big { display: block; max-width: 100%; max-height: 22rem; border-radius: 6px; object-fit: contain; }
.dmsg .demb-btns { margin-top: 0.1rem; }
.dmsg .dv2-card { background: #2b2d31; border: 1px solid #3f4147; border-radius: 8px; padding: 12px 14px; max-width: 32rem; }
.dmsg .dv2-card > * + * { margin-top: 0.5rem; }
.dmsg .dv2-card .v2-sep { margin: 0.6rem 0; }
.dmsg .dv2-card .demb-btns { margin-top: 0.6rem; }
.dmsg .v2-h1 { font-size: 1.4rem; font-weight: 700; color: #f2f3f5; line-height: 1.25; }
.dmsg .v2-h2 { font-size: 1.18rem; font-weight: 700; color: #f2f3f5; line-height: 1.25; }
.dmsg .v2-h3 { font-size: 1rem; font-weight: 700; color: #f2f3f5; }
.dmsg .dsub { font-size: 0.75rem; color: #949ba4; }
.dmsg .dquote { border-left: 4px solid #4e5058; padding-left: 0.6rem; }
.dmsg .demb-second { border-top: 0; padding-top: 0; margin-top: 0.2rem; }

/* Canvas */
.composer-msg-canvas .c-heading[data-level="2"] { font-size: 1.08rem; }
.composer-msg-canvas .c-heading[data-level="3"] { font-size: 0.98rem; }
.composer-msg-canvas .c-media { padding: 6px; cursor: pointer; text-align: center; }
@media (hover: hover) { .composer-msg-canvas .c-media:hover { border-color: var(--accent); } }
.composer-msg-canvas .c-media-img { display: block; max-width: 100%; max-height: 14rem; margin: 0 auto; border-radius: 6px; pointer-events: none; }
.composer-msg-canvas .c-media-cap { display: block; padding: 0.5rem; }
.composer-toolbar .composer-fmt { min-width: 2.1rem; }
.composer-count { margin-left: auto; align-self: center; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.composer-count.near { color: #f0b232; }
.composer-count.over { color: #f23f43; font-weight: 700; }

/* Save bar */
.composer-save-left { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; min-width: 0; }
.composer-save-right { display: flex; align-items: center; gap: 0.45rem; }
.composer-dirty { font-size: 0.75rem; color: #f0b232; margin-left: 0.35rem; }
.composer-dirty::before { content: ''; display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; margin-right: 0.35rem; vertical-align: 0.05rem; }

/* Template list: name + kind, one line of what it says */
.tpl-entry { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0.15rem; }
.tpl-entry .tpl-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.tpl-entry .tpl-kind {
  flex: none; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.08rem 0.35rem; border-radius: 5px; border: 1px solid var(--rule); color: var(--muted);
}
.tpl-entry .tpl-kind.k-v2 { color: #a5b4fc; border-color: color-mix(in srgb, #a5b4fc 40%, transparent); }
.tpl-entry .tpl-kind.k-embed { color: #c4b5fd; border-color: color-mix(in srgb, #c4b5fd 40%, transparent); }
.tpl-entry .tpl-snip { font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-entry .mt { font-size: 0.62rem; }
/* ── Whop tracker ─────────────────────────────────────────────────────────── */
.whop-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.55rem; margin: 0.9rem 0 1.1rem; }
.whop-stat { background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.whop-stat .n { font-family: var(--mono); font-size: 1.05rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whop-stat .l { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.whop-stat.good .n { color: var(--good); }
.whop-stat.idle .n { color: var(--off); }
.whop-scan-btn { align-self: stretch; border-radius: 12px; min-height: 3.2rem; }
.whop-alert { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.65rem 0.8rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); font-size: 0.82rem; }
.whop-alert strong { color: var(--warn); font-size: 0.78rem; }
.whop-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.55rem 1.4rem; }
.whop-switches .toggle { background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.8rem; }
.whop-label-row { display: flex; align-items: flex-end; gap: 0.8rem; flex-wrap: wrap; }
.whop-label-row .field { flex: 1 1 14rem; }
.whop-btn-preview { flex: none; background: #4e5058; color: #fff; border-radius: 4px; padding: 0.42rem 0.9rem; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.25rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whop-conn { border: 1px solid var(--rule); border-radius: 12px; background: var(--sunken); }
.whop-conn summary { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.65rem 0.85rem; cursor: pointer; list-style: none; }
.whop-conn summary::-webkit-details-marker { display: none; }
.whop-conn summary::after { content: '›'; color: var(--muted); transition: transform 0.2s; }
.whop-conn[open] summary::after { transform: rotate(90deg); }
.whop-conn-title { font-size: 0.86rem; color: var(--soft); margin-right: auto; }
.whop-conn-body { padding: 0.2rem 0.85rem 0.9rem; display: flex; flex-direction: column; gap: 0.8rem; }
.whop-key { display: flex; align-items: center; gap: 0.55rem; }
.whop-key-mask { font-family: var(--mono); font-size: 0.82rem; color: var(--soft); margin-right: auto; }
.whop-courses { margin-top: 1.3rem; display: flex; flex-direction: column; gap: 0.75rem; }
.whop-sec-head { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.whop-sec-head h3 { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.whop-empty { margin: 0; padding: 0.9rem; border: 1px dashed var(--rule); border-radius: 12px; color: var(--muted); font-size: 0.84rem; text-align: center; }
.whop-thumb { flex: none; width: 2.8rem; height: 2.8rem; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-d), var(--raised)); color: var(--ink); font-weight: 700; border: 1px solid var(--rule); }
.whop-thumb.sm { width: 2.1rem; height: 2.1rem; border-radius: 8px; font-size: 0.85rem; }
.whop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.whop-track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; }
.whop-track { background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.whop-track-head { display: flex; gap: 0.7rem; align-items: center; min-width: 0; }
.whop-track-title { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.whop-track-title b { font-size: 0.92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whop-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.whop-badge { font-size: 0.66rem; padding: 0.12rem 0.45rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--soft); white-space: nowrap; }
.whop-badge.dim { color: var(--muted); }
.whop-badge.is-live { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.whop-badge.is-warm { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.whop-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; }
.whop-track-acts { margin: 0; padding: 0; border: 0; justify-content: space-between; }
.whop-search { width: 100%; }
.whop-lib { display: flex; flex-direction: column; gap: 0.7rem; }
.whop-group { border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--sunken); }
.whop-group-head { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem 0.8rem; background: var(--raised); flex-wrap: wrap; }
.whop-group-title { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.whop-group-title b { font-size: 0.88rem; }
.whop-course { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.8rem; border-top: 1px solid var(--rule); }
.whop-course.is-tracked { opacity: 0.6; }
.whop-course-text { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.whop-course-text b { font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whop-course-text .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.whop-inline { padding: 0.8rem; margin: 0 0.6rem 0.6rem; border: 1px solid var(--blue-line); border-radius: 12px; background: var(--blue-bg); display: flex; flex-direction: column; gap: 0.6rem; animation: whop-in 0.18s ease; }
.whop-inline-title { margin: 0; font-size: 0.82rem; color: var(--ink); }
.whop-inline .actions { margin: 0; padding: 0; border: 0; justify-content: flex-end; }
@keyframes whop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.btn.ghost { background: transparent; }
.btn.primary.ghost { color: var(--accent-2); border-color: var(--blue-line); }

/* Segmented chips (single choice) */
.seg { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.seg-opt { font: inherit; font-size: 0.8rem; color: var(--soft); background: var(--sunken); border: 1px solid var(--rule); border-radius: 999px; padding: 0.38rem 0.85rem; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
@media (hover: hover) { .seg-opt:hover { border-color: var(--line2); color: var(--ink); } }
.seg-opt.on { background: var(--accent-d); border-color: var(--accent); color: #fff; }
.seg-opt.tone-warn.on { background: color-mix(in srgb, var(--warn) 18%, transparent); border-color: var(--warn); color: var(--warn); }
.seg-opt.tone-info.on { background: var(--blue-bg); border-color: var(--accent-2); color: #c7ccff; }
.seg-opt.tone-bad.on { background: rgba(242, 63, 67, 0.14); border-color: #f23f43; color: #ff8a8d; }

/* ── Moderation deck ──────────────────────────────────────────────────────── */
.mod-deck { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: var(--gap-stack); }
.mod-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.mod-tile { font: inherit; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; color: var(--ink); transition: border-color 0.15s, background 0.15s; }
@media (hover: hover) { .mod-tile:hover { border-color: var(--line2); background: var(--raised); } }
.mod-tile .n { font-family: var(--mono); font-size: 1.5rem; line-height: 1.1; color: var(--off); }
.mod-tile .l { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.mod-tile.tone-bad .n { color: #ff6b6e; }
.mod-tile.tone-bad { border-color: rgba(242, 63, 67, 0.35); }
.mod-tile.tone-warn .n { color: var(--warn); }
.mod-tile.tone-info .n { color: var(--ink); }
.mod-shields { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.6rem; }
.mod-shield { font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.9rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--soft); transition: border-color 0.2s, background 0.2s; }
@media (hover: hover) { .mod-shield:hover { border-color: var(--line2); } }
.mod-shield.on { border-color: var(--blue-line); background: linear-gradient(135deg, var(--blue-bg), var(--surface)); color: var(--ink); }
.mod-shield-ic { font-size: 1.25rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 10px; background: var(--sunken); flex: none; filter: grayscale(1); opacity: 0.6; transition: filter 0.2s, opacity 0.2s; }
.mod-shield.on .mod-shield-ic { filter: none; opacity: 1; }
.mod-shield-text { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.mod-shield-text b { font-size: 0.88rem; font-weight: 600; }
.mod-shield-text span { font-size: 0.74rem; color: var(--muted); }
.mod-shield-state { font-family: var(--mono); font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--off); }
.mod-shield.on .mod-shield-state { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
@keyframes mod-flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 2px var(--accent); } }
.mod-flash { animation: mod-flash 1.2s ease; }
.mod-empty { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.84rem; display: flex; align-items: center; gap: 0.45rem; }
.mod-empty::before { content: '✓'; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; font-size: 0.7rem; color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.mod-logline { display: flex; align-items: center; gap: 0.5rem; }
.mod-logline .hint { margin: 0; }
.chip-ic { margin-right: 0.35rem; }
.chip-n { margin-left: 0.4rem; font-family: var(--mono); font-size: 0.68rem; opacity: 0.75; }
.chip-toggle.on .chip-n { opacity: 1; }
.mod-reasons { margin-top: -0.35rem; }
.mod-reasons .chip-toggle { font-size: 0.74rem; padding: 0.25rem 0.6rem; }
.btn.danger-solid { background: #da373c; border-color: #da373c; color: #fff; }
.mod-rule { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.85rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--sunken); }
.mod-rule-lead { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: var(--soft); flex-wrap: wrap; }
.mod-stepper { display: inline-flex; align-items: center; gap: 0.35rem; }
.mod-stepper .btn { width: 2rem; padding: 0.3rem 0; }
.mod-rule-n { min-width: 2.6rem; text-align: center; font-family: var(--mono); font-size: 1.15rem; color: var(--ink); }
.mod-rule-summary { margin: 0; font-size: 0.8rem; color: var(--muted); }
.word-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; padding: 0.5rem; min-height: 3rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--sunken); cursor: text; }
.word-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.3rem 0.2rem 0.6rem; border-radius: 999px; background: var(--raised); border: 1px solid var(--line2); font-size: 0.8rem; color: var(--ink); }
.word-x { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; width: 1.2rem; height: 1.2rem; border-radius: 50%; line-height: 1; }
@media (hover: hover) { .word-x:hover { color: #fff; background: rgba(242, 63, 67, 0.5); } }
.word-input { flex: 1 1 10rem; min-width: 8rem; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0.3rem !important; margin: 0 !important; }#report-card, #link-queue-card, #warned-card, #channel-locks-card, #case-log-card { scroll-margin-top: 5rem; }
@media (max-width: 40rem) {
  .mod-tiles, .whop-status { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
  .mod-tile, .whop-stat { padding: 0.55rem 0.6rem; }
  .mod-tile .n { font-size: 1.15rem; }
  .mod-tile .l, .whop-stat .l { font-size: 0.58rem; letter-spacing: 0.04em; }
  .whop-scan-btn { min-height: 0; }
}

/* ══ Panel re-innovation: Settings · Overview · Desk · Giveaways · Leveling ·
      Appearance · Owner ══════════════════════════════════════════════════ */

/* Settings: jump chips */
.set-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; position: sticky; top: 0.5rem; z-index: 4; padding: 0.45rem; border-radius: 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--rule); }
.set-nav-chip { font: inherit; font-size: 0.78rem; color: var(--soft); background: var(--sunken); border: 1px solid var(--rule); border-radius: 999px; padding: 0.32rem 0.8rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
@media (hover: hover) { .set-nav-chip:hover { color: var(--ink); border-color: var(--line2); background: var(--raised); } }
.section[data-section="settings"] [data-nav] { scroll-margin-top: 4.5rem; }

/* Brand studio */
.brand-studio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; margin-top: 0.9rem; }
@media (min-width: 60rem) { .brand-studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.brand-form { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.45rem; }
.brand-sw { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .15s, border-color .15s; }
@media (hover: hover) { .brand-sw:hover { transform: scale(1.1); } }
.brand-sw.on { border-color: #fff; }
.brand-sw.none { background: var(--sunken); color: var(--muted); font-size: 0.8rem; display: grid; place-items: center; }
.brand-color { width: 2.2rem; height: 1.8rem; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: none; cursor: pointer; }
.brand-preview { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.brand-banner { --brand-accent: #2233F5; position: relative; overflow: hidden; border-radius: 14px; min-height: 9rem; padding: 1.1rem; display: flex; align-items: flex-end;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand-accent) 55%, transparent), transparent 60%), linear-gradient(160deg, #15161D, #0b0b0c);
  border: 1px solid var(--rule); transition: background .4s ease; }
.brand-lattice { position: absolute; inset: -20%; transform: rotate(-12deg); font: 700 0.62rem/1.9 var(--mono); letter-spacing: 0.2em; color: #fff; opacity: 0.05; word-spacing: 2.4rem; pointer-events: none; overflow: hidden; }
.brand-sig { position: relative; display: flex; align-items: center; gap: 0.75rem; }
.brand-chip { width: 2.6rem; height: 2.6rem; border-radius: 12px; padding: 3px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); flex: none; }
.brand-chip img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.brand-words { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.brand-wordmark { font: 800 1.15rem/1 var(--sans); letter-spacing: 0.08em; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-caption { font: 600 0.58rem/1 var(--mono); letter-spacing: 0.16em; color: rgba(255,255,255,.6); }
.brand-embed { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.7rem 0.85rem; border-radius: 6px; background: #2b2d31; border-left: 4px solid #2233F5; font-size: 0.86rem; color: #dbdee1; transition: border-color .3s; }
.brand-embed b { color: #f2f3f5; }
.brand-embed .hint { margin: 0; }
.brand-embed-foot { font-size: 0.72rem; color: #949ba4; }
.brand-real { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.brand-real .hint { margin: 0; }
.brand-real-img { width: 100%; border-radius: 10px; border: 1px solid var(--rule); }
.brand-real-img.pop { animation: ui-pop .45s cubic-bezier(.2,.8,.2,1) both; }

/* Feature cards */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; margin-bottom: 0.4rem; }
.feat-card { font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.85rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--soft); transition: border-color .2s, background .2s, color .2s; }
@media (hover: hover) { .feat-card:hover { border-color: var(--line2); } }
.feat-card.on { border-color: var(--blue-line); background: linear-gradient(135deg, var(--blue-bg), var(--surface)); color: var(--ink); }
.feat-ic { font-size: 1.2rem; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 10px; background: var(--sunken); flex: none; filter: grayscale(1); opacity: .55; transition: filter .2s, opacity .2s; }
.feat-card.on .feat-ic { filter: none; opacity: 1; }
.feat-text { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.feat-text b { font-size: 0.86rem; font-weight: 600; }
.feat-text span { font-size: 0.72rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-switch { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--raised); border: 1px solid var(--rule); position: relative; transition: background .2s, border-color .2s; }
.feat-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--off); transition: transform .22s cubic-bezier(.3,.7,.2,1), background .2s; }
.feat-card.on .feat-switch { background: var(--accent-d); border-color: var(--accent); }
.feat-card.on .feat-switch::after { transform: translateX(16px); background: var(--accent); }

/* Overview */
.ov-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.9rem; margin-bottom: 1rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--rule);
  background: radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface); }
.ov-hello { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ov-hello-k { font-size: 0.8rem; color: var(--soft); }
.ov-hello-v { font-size: 1.3rem; color: var(--ink); letter-spacing: -0.01em; }
.ov-quick { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ov-quick-btn { font: inherit; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--sunken); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
@media (hover: hover) { .ov-quick-btn:hover { background: var(--raised); border-color: var(--line2); } }
.tile[data-goto] { cursor: pointer; transition: border-color .18s, background .18s; }
@media (hover: hover) { .tile[data-goto]:hover { border-color: var(--line2); background: var(--raised); } }
.tile[data-goto]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile .tile-ic { float: right; font-size: 0.95rem; opacity: 0.7; }
.ov-status { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: 0.86rem; }
.ov-status:last-child { border-bottom: 0; }
.ov-status.col { flex-direction: column; align-items: stretch; gap: 0.4rem; }
.ov-status-top { display: flex; justify-content: space-between; }
.ov-k { color: var(--soft); margin-right: auto; }
.ov-v { color: var(--ink); font-family: var(--mono); font-size: 0.8rem; text-align: right; }
.ov-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; background: var(--off); }
.ov-dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.ov-dot.warn { background: var(--warn); }
.ov-dot.bad { background: #f23f43; }
.ov-dot.info { background: var(--accent-2); }
.ov-go { font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; width: 1.5rem; height: 1.5rem; border-radius: 6px; font-size: 1rem; line-height: 1; transition: background .15s, color .15s; }
@media (hover: hover) { .ov-go:hover { background: var(--raised); color: var(--ink); } }
.ov-meter { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; border: 1px solid var(--rule); }
.ov-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* Members */
.members-filter { margin: 0.6rem 0 0.2rem; }
.member-row { animation: ui-rise .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 99) * 22ms); }
.member-row:not([style]) { animation: none; }
.member-row.is-new .member-name::after { content: 'NEW'; margin-left: 0.4rem; font: 700 0.56rem/1 var(--mono); letter-spacing: .06em; padding: 0.15rem 0.35rem; border-radius: 4px; color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); vertical-align: 0.1rem; }
.member-pad-reason { width: 100%; margin: 0.2rem 0 0.6rem; }

/* Channel desk */
.desk-kicker { display: flex; align-items: center; gap: 0.45rem; }
.desk-live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: ui-pulse 2s ease-out infinite; }
.desk-stream-wrap { position: relative; }
.desk-jump { position: absolute; right: 0.8rem; bottom: 0.8rem; font: inherit; font-size: 0.75rem; padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--blue-line); background: var(--blue-bg); color: #c7ccff; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.4); animation: ui-rise .25s ease both; }
.desk-row.is-cont { padding-top: 0.05rem; }
.desk-row.is-cont > .desk-avatar, .desk-row.is-cont > img.desk-avatar { visibility: hidden; height: 0; }
.desk-row.is-cont .desk-meta { display: none; }
.desk-row.is-arriving { animation: ui-rise .35s cubic-bezier(.2,.8,.2,1) both; }
.desk-row.is-arriving .desk-body { animation: desk-glow 1.6s ease both; border-radius: 8px; }
.desk-composer-row { display: flex; align-items: center; gap: 0.6rem; }
.desk-tip { font-size: 0.7rem; color: var(--muted); margin-right: auto; }
.desk-count { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.desk-count.near { color: var(--warn); }
.desk-count.over { color: #f23f43; font-weight: 700; }

/* Giveaways launch pad */
.gaw-launch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
@media (min-width: 64rem) { .gaw-launch { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .gaw-preview { position: sticky; top: 1rem; } }
.gaw-launch-form { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.gaw-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.gaw-step { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.9rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--sunken); transition: border-color .2s; }
.gaw-step:focus-within { border-color: var(--blue-line); }
.gaw-step-head { display: flex; align-items: center; gap: 0.55rem; }
.gaw-step-n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font: 700 0.72rem/1 var(--mono); background: var(--accent-d); color: #c7ccff; border: 1px solid var(--blue-line); }
.gaw-step:focus-within .gaw-step-n { background: var(--accent); color: #fff; }
.gaw-step-head b { font-size: 0.9rem; }
.gaw-preview { display: flex; flex-direction: column; gap: 0.6rem; }
.gaw-preview-k { margin: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gaw-card { background: #2b2d31; border: 1px solid #3f4147; border-radius: 10px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; color: #dbdee1; }
.gaw-card.gaw-launched { animation: gaw-launch .9s cubic-bezier(.2,.8,.2,1); }
.gaw-card-title { font-size: 1.15rem; font-weight: 800; color: #f2f3f5; }
.gaw-card-rows { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.86rem; }
.gaw-card-row b { color: #f2f3f5; margin-right: 0.35rem; }
.gaw-card-img { width: 100%; border-radius: 6px; display: block; }
.gaw-card-btns { display: flex; gap: 0.45rem; flex-wrap: wrap; padding-top: 0.6rem; border-top: 1px solid #3f4147; }
.gaw-card-btn { font-size: 0.82rem; padding: 0.35rem 0.8rem; border-radius: 4px; background: #4e5058; color: #fff; }
.gaw-card-btn.primary { background: #5865F2; }
.gaw-card-foot { font-size: 0.72rem; color: #949ba4; padding-top: 0.5rem; border-top: 1px solid #3f4147; }

/* Leveling XP curve */
.lvl-curve-chart { display: flex; align-items: flex-end; gap: 3px; height: 7.5rem; margin: 0.8rem 0 0.6rem; padding: 0.6rem 0.5rem 0; border-radius: 12px; background: var(--sunken); border: 1px solid var(--rule); }
.lvl-curve-bar { flex: 1 1 0; min-width: 0; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent-2), var(--accent-d)); transition: height .35s cubic-bezier(.2,.8,.2,1), filter .15s; cursor: default; }
.lvl-curve-bar.mark { background: linear-gradient(180deg, var(--gold), #6b5520); }
@media (hover: hover) { .lvl-curve-bar:hover { filter: brightness(1.3); } }

/* Appearance list */
/* Appearance: one bar. The search field fills it, and the "changed" switch
   sits inside its end as an inset pill (same height, same radius family), so
   the two read as one control instead of two mismatched shapes. */
.appear-tools {
  display: flex; align-items: center; gap: 4px; height: 40px; padding: 4px; margin-bottom: 0.6rem; box-sizing: border-box;
  border-radius: 12px; border: 1px solid var(--rule); background: var(--sunken);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
@media (hover: hover) { .appear-tools:hover { border-color: var(--line2); } }
.appear-tools:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.appear-tools input.appear-search {
  flex: 1 1 auto; min-width: 0; width: auto; height: 30px; min-height: 0;
  padding: 0 0.5rem 0 1.9rem !important; border: 0 !important; border-radius: 8px !important;
  background-color: transparent !important; background-position: 0.55rem 50% !important; box-shadow: none !important;
}
.appear-tools input.appear-search:focus { background-color: transparent !important; box-shadow: none !important; }
.appear-tools input.appear-search::-webkit-search-cancel-button { margin-right: 0; }
.appear-changed {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 10px; margin: 0;
  border-radius: 8px; border: 1px solid transparent; background: var(--raised, #1a1a1a); color: var(--muted);
  font: 500 0.78rem/1 var(--sans, inherit); white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
@media (hover: hover) { .appear-changed:hover { color: var(--ink); } }
.appear-changed:active { transform: scale(.96); }
.appear-changed:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the dot is a little switch: hollow when off, lit and ringed when on */
.appear-changed-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; transition: background-color .2s ease, box-shadow .25s ease; }
.appear-changed-n { min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; display: inline-grid; place-items: center;
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 55%, #fff);
  font: 600 0.66rem/1 var(--mono, ui-monospace, monospace); }
.appear-changed[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--raised, #1a1a1a)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink); }
.appear-changed[aria-pressed="true"] .appear-changed-dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.appear-changed[aria-pressed="true"] .appear-changed-n { background: var(--accent); color: #fff; }
.appear-entry .nm { display: inline-flex; align-items: center; gap: 0.45rem; }
.appear-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.appear-dot.none { background: var(--raised); }
.appear-flags { display: inline-flex; gap: 0.25rem; flex: none; }

/* Owner console */
.owner-vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.55rem; margin: 0.9rem 0; }
.owner-bot { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border-radius: 14px; border: 1px solid var(--rule); background: radial-gradient(120% 200% at 0% 0%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 60%), var(--surface); }
.owner-bot img { width: 2.6rem; height: 2.6rem; border-radius: 50%; }
.owner-bot > div { display: flex; flex-direction: column; }
.owner-bot .hint { margin: 0; }
.owner-stat { background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.owner-stat .n { font-family: var(--mono); font-size: 1.1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.owner-stat .l { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.owner-stat.good .n { color: var(--good); }
.owner-stat.warn .n { color: var(--warn); }
.owner-stat.bad .n { color: #ff6b6e; }
.owner-stat.ph .n { color: var(--off); }
.owner-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem; margin-bottom: 0.8rem; }
@media (min-width: 60rem) { .owner-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); } }
.owner-tool { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.85rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--sunken); min-width: 0; }
.owner-tool .hint { margin: 0; }
.owner-tool .actions { margin: 0; padding: 0; border: 0; flex-wrap: wrap; }
.owner-tool textarea { width: 100%; }
.owner-notice-to { max-height: 6.5rem; overflow-y: auto; }
.owner-find { display: flex; gap: 0.5rem; align-items: center; margin: 0.6rem 0; }
.owner-search { flex: 1 1 auto; min-width: 0; }
.owner-sort { flex: 0 0 11rem; margin: 0; }
.owner-sort > span:first-child:empty { display: none; }
.owner-guild summary img { width: 1.6rem; height: 1.6rem; border-radius: 50%; }

/* ── motion ─────────────────────────────────────────────────────────────── */
/* From slightly above, never below: a child pushed below the fold for a frame
   grows the scroll height, and that was the scrollbar thumb jumping. */
@keyframes ui-rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ui-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ui-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes desk-glow { 0% { background: color-mix(in srgb, var(--accent) 16%, transparent); } 100% { background: transparent; } }
@keyframes gaw-launch { 0% { transform: none; box-shadow: 0 0 0 0 rgba(88,101,242,.0); } 30% { transform: translateY(-4px) scale(1.01); box-shadow: 0 0 0 4px rgba(88,101,242,.45); } 100% { transform: none; box-shadow: 0 0 0 0 rgba(88,101,242,0); } }
.feat-card, .mod-shield, .mod-tile, .whop-stat, .owner-stat, .gaw-step, .whop-track, .whop-group { animation: ui-pop .3s cubic-bezier(.2,.8,.2,1) both; }
html[data-entered] .feat-card, html[data-entered] .mod-shield, html[data-entered] .mod-tile, html[data-entered] .whop-stat,
html[data-entered] .owner-stat, html[data-entered] .gaw-step, html[data-entered] .whop-track, html[data-entered] .whop-group { animation: none; }
.btn.primary { transition: filter .15s, transform .12s, box-shadow .2s; }
@media (hover: hover) { .btn.primary:hover:not(:disabled) { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  .member-row, .desk-row.is-arriving, .desk-row.is-arriving .desk-body, .desk-jump, .gaw-card.gaw-launched, .brand-real-img.pop,
  .feat-card, .mod-shield, .mod-tile, .whop-stat, .owner-stat, .gaw-step, .whop-track, .whop-group, .desk-live-dot { animation: none !important; }
  .lvl-curve-bar, .ov-meter i, .feat-switch::after { transition: none !important; }
}
/* ── Search bars: one style everywhere ──────────────────────────────────── */
input[type="search"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 2.5rem; padding: 0.5rem 2.2rem 0.5rem 2.35rem !important;
  border-radius: 999px !important; border: 1px solid var(--rule) !important;
  background-color: var(--sunken) !important; color: var(--ink) !important; font: inherit; font-size: 0.86rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: 0.85rem 50% !important; background-size: 1rem !important;
  box-shadow: none !important; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input[type="search"]::placeholder { color: var(--muted); opacity: 1; }
@media (hover: hover) { input[type="search"]:hover { border-color: var(--line2) !important; } }
input[type="search"]:focus {
  border-color: var(--accent) !important; background-color: var(--surface) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d5cff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") !important;
}
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 1.1rem; height: 1.1rem; margin-right: -1.4rem; cursor: pointer; border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center/0.8rem no-repeat, var(--raised);
}

/* ── Automation ─────────────────────────────────────────────────────────── */
.auto-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; margin-top: 0.8rem; }
@media (max-width: 40rem) { .auto-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auto-stat { background: var(--sunken); border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.auto-stat .n { font-family: var(--mono); font-size: 1.1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-stat .l { font-size: 0.64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-stat.good .n { color: var(--good); }
.auto-stat.live { border-color: var(--blue-line); background: linear-gradient(135deg, var(--blue-bg), var(--sunken)); }
.auto-stat.live .n { color: #c7ccff; }
.sched-item summary, .reply-item summary { display: flex !important; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.sched-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4.3rem; padding: 0.35rem 0.5rem; border-radius: 10px; background: var(--sunken); border: 1px solid var(--rule); }
.sched-clock b { font-family: var(--mono); font-size: 1rem; color: var(--ink); }
.sched-clock span { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.sched-item .nm, .reply-item .reply-flow { flex: 1 1 8rem; min-width: 0; }
.sched-item > summary > .hint { flex-basis: 100%; margin: 0; }
.sched-pause { font: inherit; font-size: 0.72rem; padding: 0.3rem 0.7rem; border-radius: 999px; cursor: pointer; border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); transition: background .15s, color .15s, border-color .15s; }
.sched-pause.is-paused { border-color: var(--rule); color: var(--muted); background: var(--sunken); }
.sched-item.is-paused .sched-clock, .reply-item.is-paused .reply-flow { opacity: 0.55; }
.sched-sentence { margin: 0.2rem 0 0; padding: 0.7rem 0.8rem; border-radius: 12px; border: 1px dashed var(--blue-line); background: var(--blue-bg); color: var(--soft); font-size: 0.86rem; line-height: 1.5; }
.sched-sentence b { color: #fff; }
.reply-flow { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.reply-trigger { color: var(--ink); font-family: var(--mono); font-size: 0.84rem; }
.reply-arrow { color: var(--accent-2); }
.reply-target { color: var(--soft); font-size: 0.84rem; }
.reply-tags { display: inline-flex; gap: 0.3rem; }
.reply-tester { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.reply-test-out p { margin: 0; font-size: 0.8rem; padding: 0.45rem 0.7rem; border-radius: 10px; animation: ui-pop .2s ease both; }
.reply-test-hit { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.reply-test-miss { color: var(--muted); background: var(--sunken); border: 1px solid var(--rule); }

/* ── Feeds ──────────────────────────────────────────────────────────────── */
.feed-power { font: inherit; text-align: left; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0.95rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--soft); transition: border-color .2s, background .2s, color .2s; }
@media (hover: hover) { .feed-power:hover { border-color: var(--line2); } }
.feed-power.on { border-color: var(--blue-line); background: linear-gradient(135deg, var(--blue-bg), var(--surface)); color: var(--ink); }
.feed-power-ic { font-size: 1.35rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 12px; background: var(--sunken); filter: grayscale(1); opacity: .6; transition: filter .2s, opacity .2s; flex: none; }
.feed-power.on .feed-power-ic { filter: none; opacity: 1; }
.feed-power-text { display: flex; flex-direction: column; gap: 0.1rem; margin-right: auto; min-width: 0; }
.feed-power-text b { font-size: 0.95rem; }
.feed-power-text span { font-size: 0.75rem; color: var(--muted); }
.feed-power.on .feat-switch { background: var(--accent-d); border-color: var(--accent); }
.feed-power.on .feat-switch::after { transform: translateX(16px); background: var(--accent); }
.feed-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.feed-fact { font-size: 0.72rem; color: var(--soft); padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--sunken); border: 1px solid var(--rule); }
.feed-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.7rem; }
.feed-sub { margin: 0.6rem 0 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.feed-sentence { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; padding: 0.75rem; border-radius: 12px; background: var(--sunken); border: 1px solid var(--rule); }
.feed-sentence[hidden] { display: none !important; }
.feed-sentence > .field { flex: 1 1 8rem; margin: 0; }
.feed-sentence-k { font-size: 0.86rem; color: var(--soft); padding-bottom: 0.65rem; }
.pick-values .field-head { display: flex; align-items: center; gap: 0.5rem; }
.pick-values .count { font-family: var(--mono); font-size: 0.68rem; color: var(--accent-2); margin-right: auto; }
.pick-values .count.is-all { color: var(--muted); }
.pick-quick { display: inline-flex; gap: 0.25rem; }
.pick-q { font: inherit; font-size: 0.68rem; padding: 0.15rem 0.5rem; border-radius: 6px; border: 1px solid var(--rule); background: none; color: var(--muted); cursor: pointer; }
@media (hover: hover) { .pick-q:hover { color: var(--ink); border-color: var(--line2); } }
.chip-toggle.tone-bad[aria-pressed="true"] { border-color: #f23f43; color: #ff8a8d; background: rgba(242,63,67,.12); }
.chip-toggle.tone-warn[aria-pressed="true"] { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.chip-toggle.tone-low[aria-pressed="true"] { border-color: #eab308; color: #fde047; background: rgba(234,179,8,.1); }
.chip-toggle.tone-muted[aria-pressed="true"] { border-color: var(--line2); color: var(--soft); background: var(--raised); }
.agenda-next { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.8rem; margin-bottom: 0.4rem; border-radius: 12px; border: 1px solid var(--blue-line); background: var(--blue-bg); font-size: 0.84rem; color: var(--soft); position: sticky; top: 0; z-index: 1; }
.agenda-next-title { color: var(--ink); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-next-cd { font-family: var(--mono); color: #c7ccff; white-space: nowrap; }
.agenda-row.is-past { opacity: 0.45; }
.agenda-row.is-next { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; box-shadow: inset 3px 0 0 var(--accent); }
.composer-mode-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
/* Giveaway entry check card */
.ev-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0.6rem; margin: 0.6rem 0 0.8rem; }
@media (max-width: 40rem) { .ev-top { grid-template-columns: 1fr; } }
.ev-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.ev-row .actions { margin-top: 0.4rem; }
/* Alt cases: one card each, a coloured edge for where it stands, the match
   as a row of lit chips, and the same actions as the mod-log dropdown. */
.ev-cases { display: grid; gap: 0.55rem; margin-bottom: 0.8rem; }
.ev-cases-h { margin: 0.2rem 0 0; font-size: 0.72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ev-case { --tone: var(--soft); position: relative; padding: 0.75rem 0.85rem 0.75rem 1rem; border-radius: 14px; border: 1px solid var(--rule); background: var(--sunken); overflow: hidden; }
.ev-case::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); opacity: .9; }
.ev-case.tone-bad { --tone: #f23f43; } .ev-case.tone-good { --tone: var(--good, #22c55e); } .ev-case.tone-warn { --tone: var(--warn, #f59e0b); }
.ev-case.closed { opacity: .72; }
.ev-case-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ev-case-status { font-size: 0.68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  color: var(--tone, var(--soft)); background: color-mix(in srgb, var(--tone, #888) 14%, transparent); }
.ev-case-status.tone-bad { --tone: #ff7a7d; } .ev-case-status.tone-good { --tone: var(--good, #22c55e); } .ev-case-status.tone-warn { --tone: var(--warn, #f59e0b); } .ev-case-status.tone-muted { --tone: var(--soft); }
.ev-case-id { font: 600 0.72rem/1 var(--mono, ui-monospace, monospace); color: var(--soft); }
.ev-case-at { margin-left: auto; font-size: 0.74rem; color: var(--muted); }
.ev-case-who { margin: 0.45rem 0 0.4rem; font-size: 0.9rem; color: var(--soft); }
.ev-case-who b { color: var(--ink); font-weight: 600; }
.ev-sig { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.ev-sig-chip { font-size: 0.72rem; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--rule); color: var(--muted); }
.ev-sig-chip.on { color: #ffb3b5; border-color: rgba(242,63,67,.45); background: rgba(242,63,67,.12); }
.ev-sig-word { margin-left: 0.2rem; font-size: 0.74rem; font-style: italic; color: var(--soft); }
.ev-case-last { margin-top: 0.35rem; }
.ev-case-acts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.ev-case-acts .btn.danger { color: #ff8a8d; }
/* Bot health: one row per incident, the severity as its left edge. */
.inc-list { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
.inc { --sev: var(--warn, #f59e0b); position: relative; padding: 0.6rem 0.8rem 0.6rem 0.95rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--sunken); overflow: hidden; }
.inc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sev); }
.inc.sev-critical { --sev: #ff3b5c; } .inc.sev-high { --sev: #f23f43; } .inc.sev-medium { --sev: var(--warn, #f59e0b); } .inc.sev-low { --sev: #eab308; }
.inc.done { opacity: .6; }
.inc-head { display: flex; align-items: center; gap: 0.5rem; }
.inc-sev { font-size: 0.66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; color: var(--sev); background: color-mix(in srgb, var(--sev) 14%, transparent); }
.inc-title { font-size: 0.88rem; color: var(--ink); }
.inc-at { margin-left: auto; font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
.inc-msg { margin: 0.3rem 0 0.15rem; font: 0.78rem/1.4 var(--mono, ui-monospace, monospace); color: var(--soft); overflow-wrap: anywhere; }
.inc-meta { margin: 0; }
.inc-ok { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; padding: 0.7rem 0.85rem; border-radius: 12px; border: 1px dashed var(--rule); color: var(--soft); font-size: 0.85rem; }
.inc-ok-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good, #22c55e); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good, #22c55e) 20%, transparent); }
.ev-case-acts .btn.armed { background: rgba(242,63,67,.16); border-color: rgba(242,63,67,.6); color: #fff; }
