*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e0e10;
  --bg2: #18181b;
  --bg3: #1f1f23;
  --border: #2a2a2e;
  --text: #efeff1;
  --text2: #adadb8;
  --text3: #6b6b7b;
  --accent: #cc8200;
  --accent-hover: #e69500;
  --green: #00c853;
  --red: #ff4747;
  --yellow: #ffb300;
  --join: #00e676;
  --part: #ff7043;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Center pages (login) ─────────────────────────────────────── */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.login-card .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--accent);
}
.login-card .logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.login-card .subtitle { color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.login-card .hint { color: var(--text3); font-size: 12px; margin-top: 16px; line-height: 1.6; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text2); }
.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────────── */

/* ── Base form controls ───────────────────────────────────────── */
/* Catches inputs/selects placed without a wrapping helper class
   (e.g. Discord webhook fields, fuzz-select, modal add-fields) so they
   never fall back to unstyled native controls. */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus { border-color: var(--accent); }
input::placeholder { color: var(--text3); }

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236b6b7b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select option { background: var(--bg2); color: var(--text); }
html.light-theme select { color-scheme: light; }

/* Flat number inputs — no native spinner arrows, they clash with the theme. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  width: 100%;
  justify-content: center;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-twitch { background: #9147ff; color: #fff; }
.btn-twitch:hover { background: #772ce8; }
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  width: auto;
  padding: 6px 12px;
  font-weight: 500;
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; font-weight: 500; width: auto; }
.btn-download { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-download:hover { color: var(--text); border-color: var(--accent); }

/* ── Error box ────────────────────────────────────────────────── */
.error-box {
  background: rgba(255,71,71,.12);
  border: 1px solid rgba(255,71,71,.3);
  color: #ff7474;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

/* ── Topbar ───────────────────────────────────────────────────── */
.topbar {
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  object-fit: cover;
}
.username { font-weight: 600; }
.badge-dev {
  background: rgba(235, 6, 6, .15);
  color: #eb0606;
  border: 1px solid rgba(235,6,6,.4);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}

/* ── Dashboard layout ─────────────────────────────────────────── */
.dashboard { padding: 24px; max-width: 1400px; margin: 0 auto; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-label { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 28px; font-weight: 700; }
.status-ok { color: var(--green); font-size: 16px; }

.panels {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 16px;
  align-items: start;
}

/* ── Panels ───────────────────────────────────────────────────── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 13px; font-weight: 600; color: var(--text2); }
.panel-header .panel-actions { display: flex; gap: 6px; }
.badge {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 24px;
  text-align: center;
}
.hint-small { padding: 8px 16px; font-size: 11px; color: var(--text3); line-height: 1.5; }

/* ── User list ────────────────────────────────────────────────── */
.user-search { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.user-search input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}
.user-search input:focus { border-color: #cc8200; }

.user-list {
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}
.user-list li {
  padding: 5px 16px;
  font-size: 13px;
  color: var(--text2);
  cursor: default;
  transition: background .1s;
}
.user-list li:hover { background: var(--bg3); color: var(--text); }

/* ── Event list ───────────────────────────────────────────────── */
.event-list {
  list-style: none;
  max-height: 65vh;
  overflow-y: auto;
  padding: 4px 0;
}
.event {
  padding: 6px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  display: flex;
  align-items: baseline;
  gap: 8px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.ev-time { color: var(--text3); font-size: 11px; min-width: 58px; }
.ev-join { color: var(--join); }
.ev-part { color: var(--part); }
.event-message strong { color: var(--accent); }
.event-message { color: var(--text2); }

/* ── Log list ─────────────────────────────────────────────────── */
.log-list { list-style: none; padding: 4px 0; }
.log-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.log-date { font-size: 12px; color: var(--text2); }
.loading-msg { padding: 16px; color: var(--text3); font-size: 12px; }
.empty-msg { padding: 20px 16px; color: var(--text3); font-size: 12px; }

/* ── Dev: search bar ──────────────────────────────────────────── */
.dev-search-bar { margin-bottom: 16px; }
.dev-search-bar input {
  width: 100%;
  max-width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}
.dev-search-bar input:focus { border-color: #cc8200; }

/* ── Channel cards (dev) ──────────────────────────────────────── */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.channel-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.ch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ch-header .avatar { width: 40px; height: 40px; border: none; }
.ch-header > div { flex: 1; }
.ch-header strong { display: block; font-size: 15px; }
.ch-login { font-size: 12px; color: var(--text3); }
.ch-users {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 80px;
  overflow: hidden;
}
.user-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}
.user-chip.muted { color: var(--text3); }
.ch-actions { display: flex; gap: 8px; }
.ch-actions .btn { width: 100%; padding: 8px 16px; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .panels { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .dashboard { padding: 12px; }
  .topbar { padding: 0 12px; }
}

/* ── Stats row 2-col variant ──────────────────────────────────── */
.stats-row-2 { grid-template-columns: repeat(2, 1fr); }

/* ── Bot status dot ───────────────────────────────────────────── */
.bot-status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot-green { background: var(--green); box-shadow: 0 0 4px var(--green); }
.dot-red   { background: var(--red);   box-shadow: 0 0 4px var(--red); }
.ch-header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ── Wide modal ───────────────────────────────────────────────── */
.modal-wide { max-width: 860px; width: 100%; }
.modal-title-row { display: flex; align-items: center; gap: 12px; flex: 1; }
.modal-body-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  max-height: 75vh;
}
.modal-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.modal-col-right { border-right: none; }
.modal-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-col-header h4 { font-size: 12px; font-weight: 600; color: var(--text2); }
.modal-filter {
  background: var(--bg3);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  flex-shrink: 0;
}
.modal-filter:focus { background: var(--bg2); }
.modal-user-list { flex: 1; overflow-y: auto; }
.modal-event-list { flex: 1; overflow-y: auto; min-height: 120px; }
.modal-logs-section { border-top: 1px solid var(--border); flex-shrink: 0; max-height: 200px; overflow-y: auto; }

/* ── Extra styles ─────────────────────────────────────────────── */
.status-err { color: var(--red); font-size: 16px; }
.stats-row-2 { grid-template-columns: repeat(2, 1fr); }

.modal-wide { max-width: 1180px; width: 96vw; }
.modal-title-row { display: flex; align-items: center; gap: 12px; flex: 1; }
.modal-body-split { display: grid; grid-template-columns: 220px minmax(0, 1fr) 230px; gap: 0; padding: 0; overflow: hidden; }
.modal-col { display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow: hidden; min-width: 0; }
.modal-col:last-child { border-right: none; }
.modal-col-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 8px; }
.modal-col-header h4 { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.modal-col-header .inline-filter { flex: 1 1 60px; width: auto; min-width: 0; }
.modal-user-list { max-height: 420px; overflow-y: auto; }
.modal-event-list { max-height: 420px; overflow-y: auto; }
.modal-col-logs { padding: 10px 12px; overflow-y: auto; max-height: 460px; display: flex; flex-direction: column; }

/* Log rows: the whole name is the download link */
.log-link { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--text2); text-decoration: none; font-size: 12px; }
.log-link:hover { color: var(--accent); }
.log-link .log-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-list li:has(.log-link) { padding: 6px 10px; border-radius: 6px; border-bottom: 1px solid rgba(255,255,255,.03); }
.log-list li:has(.log-link):hover { background: var(--bg3); }
.modal-col-events .event { font-size: 12px; padding: 5px 12px; }
.modal-col-events .ev-time { min-width: 50px; font-size: 10px; }

/* ── Stream badges ────────────────────────────────────────────── */
.badge-live { background: rgba(255,71,71,.15); color: #ff4747; border: 1px solid rgba(255,71,71,.3); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.badge-offline { background: var(--bg3); color: var(--text3); border: 1px solid var(--border); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.stream-status-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.stream-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 4px; }
.ch-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ch-info { flex: 1; }
.modal-counts { display: flex; align-items: center; gap: 8px; }
.stats-row-1 { grid-template-columns: 1fr; max-width: 300px; }
.inline-filter { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 4px 8px; font-size: 12px; outline: none; width: 100px; }
.inline-filter:focus { border-color: var(--accent); }

/* ── Tooltip ──────────────────────────────────────────────────── */
.tooltip-wrap { position: relative; cursor: default; }
.tooltip-wrap:hover::after { content: attr(title); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%); background: #1a1a1d; border: 1px solid var(--border); color: var(--text); font-size: 11px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 99; }

/* ── Strackerbot-style login page ──── */
.beast-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 700px 520px at 50% 32%, rgba(204, 130, 0, .16), transparent 65%),
    radial-gradient(ellipse 900px 700px at 50% 30%, rgba(120, 75, 0, .35), transparent 70%),
    #0a0a0d;
}

.beast-card {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.beast-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: -40px;
  filter: drop-shadow(0 0 34px rgba(204, 130, 0, .45)) drop-shadow(0 0 60px rgba(204, 130, 0, .18));
}

.beast-title {
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  font-size: 50px;
  letter-spacing: -1px;
  color: #fdfdfd;
  margin-bottom: -5px;
}

.beast-subtitle {
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9aa3b5;
  margin-bottom: 32px;
}

.beast-form-group { width: 100%; max-width: 340px; margin-bottom: 14px; }
.beast-input {
  width: 100%;
  padding: 13px 16px;
  background: #17171b;
  border: 1px solid #2c2c33;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  text-align: center;
  transition: border-color .15s;
}
.beast-input:focus { border-color: #ff2d82; }
.beast-input::placeholder { color: #6b6b7b; }

.beast-btn {
  width: 100%;
  max-width: 340px;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #e6a640, #cc8200);
  color: #fff;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
}
.beast-btn:hover { filter: brightness(1.1); }
.beast-btn:disabled { opacity: .6; cursor: not-allowed; }

.beast-disclaimer {
  font-size: 12px;
  color: #8a90a2;
  line-height: 1.6;
  margin-top: 22px;
  max-width: 320px;
}

.beast-tagline {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 600;
  color: #cc8200;
  margin-top: 34px;
}

.beast-card .error-box {
  width: 100%;
  max-width: 340px;
  text-align: left;
}

/* ── Streamer landing page (Nightbot-style hero) ─────────────────────── */
.sb-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 40px;
  position: relative;
  z-index: 2;
}
.sb-nav-left { justify-self: start; }
.sb-nav-center { justify-self: center; }
.sb-nav-right { justify-self: end; }
.sb-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fdfdfd;
  text-decoration: none;
  transition: opacity .15s;
}
.sb-nav-brand:hover { opacity: .85; }
.sb-nav-brand img { width: 42px; height: 42px; object-fit: contain; }

.sb-nav-support {
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color .15s;
}
.sb-nav-support:hover { color: #fdfdfd; }

.sb-nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #a970ff, #9147ff);
  color: #fff;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: filter .15s, background .15s, color .15s;
}
.sb-nav-btn:hover { filter: brightness(1.1); }
.sb-nav-btn.is-connected {
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .85);
}
.sb-nav-btn.is-connected:hover { filter: none; background: rgba(255, 255, 255, .22); }

.sb-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0) 0%, rgb(204, 130, 0) 100%);
}
.sb-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 68%);
  mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 68%);
}

.sb-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

@keyframes sb-badge-in {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}

.sb-logo-badge {
  width: 160px;
  height: 160px;
  border: none;
  border-radius: 54px;
  background: linear-gradient(135deg, #e6a640, #cc8200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  animation: sb-badge-in .35s ease-out;
  cursor: pointer;
  padding: 0;
  transition: transform .15s ease;
}
#logo-cta:hover { transform: scale(1.06); }
#logo-cta:active { transform: scale(0.92); }

.sb-hero-logo {
  width: 170px;
  height: 170px;
  object-fit: contain;
}

.sb-hero-title {
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  font-size: 52px;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #f0f1f7;
  margin-bottom: 24px;
  max-width: 780px;
}

.sb-hero-subtitle {
  font-size: 19px;
  color: #f6e9d8;
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 36px;
}

.sb-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 31px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a970ff, #9147ff);
  color: #fff;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: filter .15s, background .15s, color .15s;
}
.sb-hero-cta:hover { filter: brightness(1.1); }
.sb-hero-cta.is-connected {
  background: #ffffff;
  color: #17171b;
}
.sb-hero-cta.is-connected:hover { filter: none; background: #f0f0f0; }

.sb-hero-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  line-height: 1.6;
  max-width: 420px;
  margin-top: 22px;
}

.sb-hero-error {
  max-width: 420px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .sb-nav { padding: 16px 20px; }
  .sb-hero-title { font-size: 36px; }
}

/* ── Evitar el parpadeo de "Connect with Twitch" antes de saber el estado real ── */
.sb-fade {
  opacity: 0;
  transition: opacity .2s ease;
}
.sb-fade.is-visible {
  opacity: 1;
}

/* ── El logo, además de aparecer, hace un pequeño "pop" de escala ── */
.sb-fade-pop {
  transform: scale(.82);
  transition: opacity .2s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.sb-fade-pop.is-visible {
  transform: scale(1);
}

/* ══════════════════════════════════════════════════════════════
   Streamer dashboard — sidebar shell (estilo Nightbot)
   ══════════════════════════════════════════════════════════════ */

.db-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Lexend', 'Segoe UI', system-ui, sans-serif;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.db-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  width: 240px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.db-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  padding: 0 8px;
  margin-bottom: 24px;
  text-decoration: none;
  transition: opacity .15s;
}
.db-brand:hover { opacity: .8; }
.db-brand-logo { width: 32px; height: 32px; object-fit: contain; }

.db-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border-radius: 8px;
  background: rgba(204, 130, 0, .12);
  border: 1px solid rgba(204, 130, 0, .35);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), height .22s ease;
  z-index: 0;
  opacity: 0;
}
.db-nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.db-nav-item svg { flex-shrink: 0; opacity: .8; }
.db-nav-item:hover { color: var(--text); }
.db-nav-item.is-active { color: #cc8200; }
.db-nav-item.is-active svg { opacity: 1; }

.db-sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.db-side-link:hover { color: var(--text); background: var(--bg3); }

/* ── User row + dropdown ─────────────────────────────────────── */
.db-user-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  cursor: pointer;
  border-radius: 8px;
}
.db-user-row:hover { background: var(--bg3); }
.db-user-row .avatar { width: 28px; height: 28px; border-radius: 50%; border: none; }
.db-user-row .username { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-user-chevron { color: var(--text3); transition: transform .15s; flex-shrink: 0; }
.db-user-row.is-open .db-user-chevron { transform: rotate(180deg); }

.db-user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.db-user-row.is-open .db-user-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }

.db-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.db-menu-item:hover { background: var(--bg3); color: var(--text); }
.db-menu-item-danger:hover { color: var(--red); }

/* ── Main content ─────────────────────────────────────────────── */
.db-main {
  flex: 1;
  min-width: 0;
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.db-topline {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.db-view { display: none; }
.db-view.is-active { display: block; }

.db-two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .db-two-col { grid-template-columns: 1fr; }
  .db-sidebar { width: 200px; }
}
@media (max-width: 700px) {
  .db-shell { flex-direction: column; }
  .db-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; }
  .db-brand { margin-bottom: 0; }
  .db-nav { flex-direction: row; }
  .db-sidebar-bottom { margin-top: 0; margin-left: auto; flex-direction: row; }
}

.db-steamid-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.db-steamid-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
}
.db-account-row { padding: 16px; display: flex; flex-direction: column; gap: 2px; }

/* ── Light theme override ─────────────────────────────────────── */
html.light-theme {
  --bg: #f5f6f8;
  --bg2: #ffffff;
  --bg3: #eef0f3;
  --border: #e2e4e8;
  --text: #17171b;
  --text2: #55575e;
  --text3: #8a8d94;
}
html.light-theme .db-user-menu { box-shadow: 0 8px 24px rgba(0,0,0,.12); }

.db-greeting { margin-bottom: 20px; }
.db-greeting h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.db-greeting p { font-size: 14px; color: var(--text2); }

/* ── Dev dashboard extras ─────────────────────────────────────── */
.db-test-banner {
  background: #e0a52d;
  color: #1a1a1a;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.db-test-banner code { background: rgba(0,0,0,.12); padding: 1px 5px; border-radius: 4px; }

.db-brand .badge-dev { margin-left: auto; font-size: 10px; padding: 2px 7px; }

/* ── Streamer onboarding card ─────────────────────────────────── */
.onb-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  text-align: left;
}
.onb-card .log-list li { background: rgba(0,0,0,.15); border-radius: 8px; margin-bottom: 6px; }
.onb-card .log-list { max-height: 220px; overflow-y: auto; }

/* ── Dashboard setup notice (SteamID64 pending) ──────────────────────────── */
.db-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: rgba(204, 130, 0, .12);
  border: 1px solid rgba(204, 130, 0, .35);
  border-radius: 10px;
}
.db-notice strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.db-notice span { font-size: 13px; color: var(--text2); }
.db-notice .btn { background: #cc8200; color: #fff; flex-shrink: 0; }
.db-notice .btn:hover { filter: brightness(1.1); }

/* ── Input flagged from the "add SteamID64" notice ───────────────────────── */
.input-flag { border-color: #eb0606 !important; }
.input-flag:focus { border-color: #eb0606 !important; }
