/* ─────────────────────────────────────────────────────────────────────────────
   Vortexs Bot · sistema de diseño
   Marca: vortexs.es (fondo #09090C, morado #C09AFD, amarillo #EDE103)
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* Superficies */
  --bg: #09090c;
  --surface-1: #0f0f14;
  --surface-2: #14141b;
  --surface-3: #1b1b24;
  --overlay: rgba(9, 9, 12, 0.78);

  /* Bordes */
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);

  /* Texto */
  --text: #f4f4f5;
  --text-2: #b4b4bd;
  --text-3: #7c7c88;

  /* Marca */
  --purple: #c09afd;
  --purple-strong: #a77bf7;
  --lilac: #e3d5ff;
  --yellow: #ede103;
  --gradient: linear-gradient(135deg, #c09afd 0%, #ede103 100%);
  --gradient-text: linear-gradient(135deg, #c09afd, #e3d5ff 45%, #ede103);
  --purple-soft: rgba(192, 154, 253, 0.1);
  --purple-line: rgba(192, 154, 253, 0.3);

  /* Estados */
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ff5c6a;
  --info: #7dd3fc;

  /* Forma y ritmo */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --ring: 0 0 0 3px rgba(192, 154, 253, 0.28);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Outfit', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --topbar-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(192, 154, 253, 0.11), transparent 60%),
    radial-gradient(700px 420px at 100% -5%, rgba(237, 225, 3, 0.05), transparent 60%);
}
::selection { background: rgba(192, 154, 253, 0.32); color: #fff; }
a { color: var(--purple); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--lilac); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
code { font: 500 0.85em var(--mono); padding: 2px 6px; border-radius: var(--r-xs); background: var(--surface-3); border: 1px solid var(--line); color: var(--lilac); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

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

/* ── Iconos (Material Symbols Rounded) ─────────────────────────────────────── */
.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  flex-shrink: 0;
  width: 1em;
  overflow: hidden;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.mi.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.mi.sm { font-size: 18px; }
.mi.lg { font-size: 24px; }
.mi.xl { font-size: 40px; }

/* ── Utilidades ────────────────────────────────────────────────────────────── */
.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.eyebrow { font: 600 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--purple); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); }
.small { font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Botones ───────────────────────────────────────────────────────────────── */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 13px var(--font); white-space: nowrap; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.2s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .mi { font-size: 18px; margin-left: -2px; }
.btn-primary { background: var(--gradient); color: #0b0b0f; border-color: transparent; box-shadow: 0 6px 20px -6px rgba(237, 225, 3, 0.35); }
.btn-primary:hover { background: var(--gradient); color: #0b0b0f; border-color: transparent; box-shadow: 0 8px 28px -6px rgba(192, 154, 253, 0.55); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { background: rgba(255, 92, 106, 0.08); border-color: rgba(255, 92, 106, 0.28); color: #ff8f99; }
.btn-danger:hover { background: rgba(255, 92, 106, 0.16); border-color: rgba(255, 92, 106, 0.45); color: #ffb3ba; }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { --h: 46px; padding: 0 22px; font-size: 14px; border-radius: var(--r-md); }
.btn-icon { width: var(--h); padding: 0; }
.btn-icon .mi { margin: 0; }
.btn.is-active { background: var(--purple-soft); border-color: var(--purple-line); color: var(--lilac); }

/* ── Barra superior ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 28px);
  background: var(--overlay); backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 700 17px var(--display); letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(192, 154, 253, 0.45)); transition: transform 0.6s var(--ease); }
.brand:hover img { transform: rotate(-25deg); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Menú de usuario (details/summary: accesible y sin JS) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-1); transition: border-color 0.15s; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { border-color: var(--line-3); }
.menu > summary img { width: 30px; height: 30px; border-radius: 50%; }
.menu > summary .name { font-weight: 600; font-size: 13px; max-width: 140px; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7); animation: pop 0.18s var(--ease); }
.menu-panel .head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font: 500 13px var(--font); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.danger:hover { color: #ff8f99; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* ── Landing ───────────────────────────────────────────────────────────────── */
.hero { max-width: 860px; margin: 0 auto; padding: clamp(56px, 10vw, 112px) 20px 40px; text-align: center; }
.hero-logo { width: clamp(96px, 16vw, 132px); margin: 0 auto; filter: drop-shadow(0 0 32px rgba(192, 154, 253, 0.5)); animation: spin-in 1.1s var(--ease); }
@keyframes spin-in { from { transform: rotate(-180deg) scale(0.6); opacity: 0; } }
.hero .eyebrow { margin-top: 24px; }
.hero h1 { font-size: clamp(40px, 7.5vw, 72px); font-weight: 800; letter-spacing: -0.03em; margin: 12px 0 16px; }
.hero p { font-size: clamp(15px, 2vw, 17px); color: var(--text-2); max-width: 580px; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; max-width: 1120px; margin: 24px auto 96px; padding: 0 20px; }
.feature h3 { font-size: 17px; margin: 16px 0 6px; }
.feature p { color: var(--text-2); font-size: 13.5px; }

/* ── Tarjetas ──────────────────────────────────────────────────────────────── */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 24px); box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.interactive { transition: border-color 0.2s, transform 0.2s var(--ease); }
.card.interactive:hover { border-color: var(--purple-line); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; font-family: var(--font); letter-spacing: -0.005em; }
.card-head p { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.icon-tile { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--purple-soft); border: 1px solid var(--purple-line); color: var(--purple); }
.icon-tile.yellow { background: rgba(237, 225, 3, 0.07); border-color: rgba(237, 225, 3, 0.25); color: var(--yellow); }
.icon-tile.green { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.25); color: var(--success); }
.icon-tile.red { background: rgba(255, 92, 106, 0.08); border-color: rgba(255, 92, 106, 0.25); color: var(--danger); }
.icon-tile.lg { width: 48px; height: 48px; border-radius: var(--r-md); }
.divider { height: 1px; background: var(--line); margin: 4px 0; border: 0; }

/* ── Layout del panel ──────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.guild-switch { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 14px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line); color: var(--text); transition: border-color 0.15s; }
.guild-switch:hover { border-color: var(--line-3); color: var(--text); }
.guild-switch .grow { flex: 1; min-width: 0; }
.guild-switch strong { display: block; font-size: 13.5px; font-weight: 600; }
.guild-switch span.dim { font-size: 12px; }
.avatar { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.avatar.lg { width: 52px; height: 52px; border-radius: var(--r-md); }
.avatar.round { border-radius: 50%; }
.avatar.fallback { display: grid; place-items: center; color: var(--purple); font: 700 15px var(--display); background: var(--purple-soft); border: 1px solid var(--purple-line); }
.nav-label { padding: 16px 12px 6px; font: 600 10.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav-link .mi { color: var(--text-3); transition: color 0.15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link:hover .mi { color: var(--text-2); }
.nav-link.active { background: var(--purple-soft); color: var(--text); font-weight: 600; }
.nav-link.active .mi { color: var(--purple); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gradient); }
.nav-link .trail { margin-left: auto; font-size: 16px; }
.nav-spacer { flex: 1; min-height: 16px; }
.nav-cta { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: linear-gradient(135deg, rgba(192, 154, 253, 0.12), rgba(237, 225, 3, 0.06)); border: 1px solid rgba(192, 154, 253, 0.22); color: var(--text); }
.nav-cta:hover { border-color: rgba(192, 154, 253, 0.45); color: var(--text); }
.nav-cta strong { display: block; font-size: 13.5px; }
.nav-cta span.dim { font-size: 12px; }

.content { padding: 28px clamp(16px, 3.5vw, 48px) 120px; max-width: 1240px; width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; margin-top: 8px; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 620px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs .mi { font-size: 16px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: var(--topbar-h); z-index: 40; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); background: var(--overlay); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .guild-switch, .nav-label, .nav-spacer { display: none; }
  .nav-link { flex-shrink: 0; height: 36px; white-space: nowrap; }
  .nav-link.active::before { left: 12px; right: 12px; top: auto; bottom: -8px; width: auto; height: 2px; border-radius: 2px; }
  .nav-cta { flex-shrink: 0; padding: 0 12px; height: 36px; border-radius: var(--r-sm); }
  .nav-cta span.dim, .nav-cta .trail { display: none; }
  .nav-cta .icon-tile { width: auto; height: auto; background: none; border: 0; }
  .content { padding-top: 22px; }
}

/* ── Estadísticas ──────────────────────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 14px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .value { font: 700 30px var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.stat.highlight { background: linear-gradient(160deg, rgba(192, 154, 253, 0.09), rgba(237, 225, 3, 0.03) 70%), var(--surface-1); border-color: var(--purple-line); }
.stat.highlight .value { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Formularios ───────────────────────────────────────────────────────────── */
.field { display: grid; gap: 7px; align-content: start; }
.field > label, .field-label { font-weight: 500; font-size: 13px; color: var(--text); }
.help { font-size: 12.5px; color: var(--text-3); }
.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  font: 400 13.5px var(--font); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: var(--purple); box-shadow: var(--ring); background: var(--surface-1); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
select.input { appearance: none; cursor: pointer; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%237c7c88'%3E%3Cpath d='M12 15.4 6.6 10l1.4-1.4 4 4 4-4 1.4 1.4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input option, select.input optgroup { background: var(--surface-2); color: var(--text); }
input[type='color'].input { padding: 4px; cursor: pointer; }
input[type='color'].input::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color'].input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.input-group { display: flex; gap: 10px; flex-wrap: wrap; }
.input-group > .input, .input-group > select { flex: 1 1 220px; }
.input-icon { position: relative; }
.input-icon .mi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: border-color 0.15s; }
.setting:hover { border-color: var(--line-2); }
.setting strong { display: block; font-weight: 500; font-size: 13.5px; }
.setting span.help { display: block; margin-top: 2px; }
.settings-list { display: grid; gap: 1px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.settings-list .setting { border: 0; border-radius: 0; background: var(--surface-1); }
.settings-list .setting:hover { background: var(--surface-2); }

.switch { position: relative; width: 40px; height: 24px; flex-shrink: 0; margin: 0; appearance: none; cursor: pointer; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background 0.2s, border-color 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform 0.25s var(--ease), background 0.2s; }
.switch:checked { background: var(--purple); border-color: var(--purple); }
.switch:checked::after { transform: translateX(16px); background: #0b0b0f; }
.switch:focus-visible { box-shadow: var(--ring); border-radius: 999px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--purple); margin: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 13px; transition: border-color 0.15s, background 0.15s; }
.choice:hover { border-color: var(--line-3); }
.choice:has(input:checked) { border-color: var(--purple-line); background: var(--purple-soft); }
.choice input { accent-color: var(--purple); margin: 0; }

/* Chips: multiselección y etiquetas */
.chips-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 6px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color 0.15s, box-shadow 0.15s; }
.chips-input:hover { border-color: var(--line-3); }
.chips-input:focus-within { border-color: var(--purple); box-shadow: var(--ring); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: var(--r-xs); background: var(--surface-3); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 500; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer; }
.chip button:hover { background: rgba(255, 92, 106, 0.18); color: #ffb3ba; }
.chip button .mi { font-size: 16px; }
.chips-input select, .chips-input input { flex: 1 1 140px; min-width: 120px; height: 28px; border: 0; padding: 0 6px; background: transparent; color: var(--text-2); font: 400 13px var(--font); outline: none; }
.chips-input select { cursor: pointer; }
.chips-input select option { background: var(--surface-2); color: var(--text); }

/* Editores repetibles */
.repeater { display: grid; gap: 12px; }
.rep-item { display: grid; gap: 16px; padding: 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rep-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.rep-title .badge { font-weight: 500; }
.rep-actions { display: flex; gap: 4px; }
.rep-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; align-items: end; }
.q-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--line); }
.q-item .input { height: 36px; }
@media (max-width: 720px) { .q-item { grid-template-columns: 1fr 1fr; } }
.rep-add { justify-self: start; }

/* Barra de guardado */
.savebar {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px; border-radius: var(--r-md);
  background: rgba(27, 27, 36, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-3); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, calc(100% + 40px)); transition: transform 0.4s var(--ease);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar .msg { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; color: var(--text-2); }
.savebar .msg .mi { color: var(--warning); }
@media (max-width: 520px) { .savebar .msg span:last-child { display: none; } }

/* ── Tablas ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; padding: 11px 16px; text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.015); }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── Badges, pestañas, avisos ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--line); white-space: nowrap; }
.badge .mi { font-size: 15px; }
.badge::before { content: none; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--success); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.22); }
.badge.red { color: #ff8f99; background: rgba(255, 92, 106, 0.08); border-color: rgba(255, 92, 106, 0.22); }
.badge.yellow { color: var(--yellow); background: rgba(237, 225, 3, 0.06); border-color: rgba(237, 225, 3, 0.2); }
.badge.purple { color: var(--purple); background: var(--purple-soft); border-color: var(--purple-line); }
.badge.orange { color: var(--warning); background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.22); }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--line); }
.segmented a, .segmented button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 7px; border: 0; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; transition: background 0.15s, color 0.15s; }
.segmented a:hover, .segmented button:hover { color: var(--text); }
.segmented .active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.segmented .count { font: 500 11px var(--mono); color: var(--text-3); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--purple-soft); border: 1px solid rgba(192, 154, 253, 0.2); color: var(--text-2); font-size: 13px; line-height: 1.6; }
.callout > .mi { color: var(--purple); margin-top: 1px; }
.callout strong { color: var(--text); font-weight: 600; }
.callout.warn { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.2); }
.callout.warn > .mi { color: var(--warning); }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; }

.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--text-3); }
.empty .mi { font-size: 36px; color: var(--text-3); opacity: 0.6; }
.empty strong { color: var(--text-2); font-weight: 600; }

/* ── Servidores ────────────────────────────────────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 36px clamp(16px, 3vw, 32px) 96px; }
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.server-card { display: flex; flex-direction: column; gap: 18px; }
.server-card .top { display: flex; align-items: center; gap: 14px; }
.server-card h3 { font-size: 15.5px; font-family: var(--font); font-weight: 600; }
.server-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.server-card .actions .btn { flex: 1 1 auto; }

/* ── Visor de clips ────────────────────────────────────────────────────────── */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; max-width: 1440px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 64px; transition: grid-template-columns 0.4s var(--ease); }
.viewer.theater { grid-template-columns: minmax(0, 1fr) 0; gap: 0; }
.viewer.theater .side { opacity: 0; pointer-events: none; overflow: hidden; }
@media (max-width: 1100px) { .viewer, .viewer.theater { grid-template-columns: minmax(0, 1fr); } .viewer.theater .side { display: none; } }

.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.viewer-head .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.viewer-head h1 { font-size: 20px; font-weight: 700; }
.viewer-head .sub { font-size: 12.5px; color: var(--text-3); }
.queue-pill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.queue-pill b { font: 700 16px var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.queue-pill .sep { width: 1px; height: 18px; background: var(--line-2); }

.stage { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: var(--r-xl); overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02); }
.stage::after { content: ''; position: absolute; inset: -40% -10% auto; height: 60%; z-index: -1; background: radial-gradient(closest-side, rgba(192, 154, 253, 0.18), transparent); filter: blur(30px); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(500px 300px at 50% 40%, rgba(192, 154, 253, 0.1), transparent 70%), #07070a; }
.stage-state img { width: 72px; margin: 0 auto 18px; filter: drop-shadow(0 0 20px rgba(192, 154, 253, 0.45)); }
.stage-state .spin { animation: spin 2.6s linear infinite; }
.stage-state h3 { font-size: 20px; }
.stage-state p { color: var(--text-2); margin-top: 8px; max-width: 420px; }
.stage-state .btn { margin-top: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

.dock { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 10px; border-radius: var(--r-lg); background: var(--surface-1); border: 1px solid var(--line); }
.dock .group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dock .btn { --h: 44px; }
.dock .btn-primary { padding: 0 22px; }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; font: 600 10.5px var(--mono); color: var(--text-3); background: var(--surface-3); border: 1px solid var(--line-2); border-bottom-width: 2px; }
.btn .kbd { margin-left: 2px; }
.btn-primary .kbd { color: #0b0b0f; background: rgba(0, 0, 0, 0.1); border-color: rgba(0, 0, 0, 0.15); }

.clip-card { margin-top: 16px; }
.clip-card h2 { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; }
.clip-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.person { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; }
.person img { width: 22px; height: 22px; border-radius: 50%; }
.clip-desc { margin-top: 14px; color: var(--text-2); white-space: pre-wrap; font-size: 13.5px; }
.streamer-mode .submitter-name { filter: blur(5px); transition: filter 0.2s; }
.streamer-mode .person:hover .submitter-name { filter: none; }

.side { display: grid; gap: 16px; align-content: start; position: sticky; top: calc(var(--topbar-h) + 24px); transition: opacity 0.3s; }
.side-list { display: grid; gap: 4px; max-height: 420px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--text); font: 500 13px var(--font); text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.side-item:hover { background: var(--surface-2); border-color: var(--line); }
.side-item .grow { flex: 1; min-width: 0; }
.side-item .sub { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.session-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.session-stats div { padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.session-stats b { display: block; font: 700 20px var(--display); font-variant-numeric: tabular-nums; }
.session-stats span { font-size: 12px; color: var(--text-3); }
.shortcuts { display: grid; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.shortcuts div { display: flex; align-items: center; justify-content: space-between; }

.platform-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.p-twitch { background: #9146ff; } .p-youtube { background: #ff3b3b; } .p-medal { background: #ffb800; }
.p-streamable { background: #2f9bff; } .p-kick { background: #53fc18; } .p-tiktok { background: #fe2c55; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-xs); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Toasts ────────────────────────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7); font-size: 13px; font-weight: 500; animation: toast-in 0.3s var(--ease); }
.toast .mi { font-size: 20px; }
.toast.ok .mi { color: var(--success); }
.toast.err .mi { color: var(--danger); }
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ── Error / pie ───────────────────────────────────────────────────────────── */
.center-page { min-height: calc(100vh - var(--topbar-h) - 90px); display: grid; place-items: center; padding: 40px 20px; text-align: center; }
.center-page .code { font: 800 72px var(--display); letter-spacing: -0.04em; line-height: 1; margin-top: 20px; }
.center-page h2 { font-size: 20px; margin: 10px 0 8px; }
.center-page p { color: var(--text-2); max-width: 480px; margin: 0 auto; }
.footer { display: flex; justify-content: center; gap: 6px; padding: 28px 16px 36px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.footer a { color: var(--text-2); }
.sr-only:focus { position: fixed; top: 12px; left: 12px; z-index: 200; width: auto; height: auto; clip: auto; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); box-shadow: var(--ring); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }

/* Ajuste con control a la derecha (número, select corto) */
.setting.inline { cursor: default; }
.setting.inline .control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.setting.inline .input { width: 110px; }
.setting.inline .unit { font-size: 12.5px; color: var(--text-3); }

/* Tabla editable de sanciones automáticas */
.th-table { display: grid; gap: 8px; }
.th-head, .th-row { display: grid; grid-template-columns: minmax(110px, 0.8fr) minmax(150px, 1.2fr) minmax(130px, 1fr) 40px; gap: 12px; align-items: center; }
.th-head { padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.th-row { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.th-row .suffix { position: relative; }
.th-row .suffix .input { padding-right: 52px; }
.th-row .suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }
.th-row .na { font-size: 12.5px; color: var(--text-3); padding-left: 2px; }
@media (max-width: 640px) {
  .th-head { display: none; }
  .th-row { grid-template-columns: 1fr 1fr 40px; }
  .th-row > :nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
}

/* ── Adivina el rango ─────────────────────────────────────────────────────── */
.guess-card { margin-top: 16px; }
.guess-card .card-head { margin-bottom: 16px; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.rank-btn {
  --rank: var(--purple);
  position: relative; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font: 600 13px var(--font); text-align: left; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease), opacity 0.2s;
}
.rank-btn:hover:not(:disabled) { border-color: var(--rank); background: color-mix(in srgb, var(--rank) 12%, var(--surface-2)); transform: translateY(-1px); }
.rank-btn .gem { width: 11px; height: 11px; flex-shrink: 0; border-radius: 3px; transform: rotate(45deg); background: var(--rank); box-shadow: 0 0 10px color-mix(in srgb, var(--rank) 60%, transparent); }
.rank-btn .kbd { margin-left: auto; }
.rank-btn:disabled { cursor: default; opacity: 0.4; }
.rank-btn.is-answer, .rank-btn.is-guess { opacity: 1; }
.rank-btn.is-answer { border-color: var(--success); background: rgba(52, 211, 153, 0.12); animation: pop 0.35s var(--ease); }
.rank-btn.is-guess:not(.is-answer) { border-color: var(--danger); background: rgba(255, 92, 106, 0.1); }
.rank-btn.is-answer::after, .rank-btn.is-guess::after { font-family: 'Material Symbols Rounded'; font-size: 18px; margin-left: auto; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.rank-btn.is-answer::after { content: 'check_circle'; color: var(--success); }
.rank-btn.is-guess:not(.is-answer)::after { content: 'close'; color: var(--danger); }
.rank-btn.is-answer .kbd, .rank-btn.is-guess .kbd { display: none; }
.guess-result { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; animation: pop 0.3s var(--ease); }
.guess-result.ok { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); color: var(--success); }
.guess-result.ko { background: rgba(255, 92, 106, 0.08); border: 1px solid rgba(255, 92, 106, 0.28); color: #ff8f99; }
.guess-result.info { background: var(--purple-soft); border: 1px solid var(--purple-line); color: var(--lilac); }
.guess-result .sub { font-weight: 400; color: var(--text-2); }
.session-stats .wide { grid-column: 1 / -1; }

/* ── Panel de mods de Twitch ──────────────────────────────────────────────── */
.btn-twitch { background: #9146ff; border-color: #9146ff; color: #fff; }
.btn-twitch:hover { background: #a46bff; border-color: #a46bff; color: #fff; }
.icon-tile.twitch-tile { background: rgba(145, 70, 255, 0.14); border-color: rgba(145, 70, 255, 0.4); color: #b892ff; }
.mods { max-width: 1520px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 32px) 64px; }
.mods-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.mods-head .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mods-head h1 { font-size: 20px; }
.mods-head .sub { font-size: 12.5px; color: var(--text-3); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4655; margin-right: 6px; box-shadow: 0 0 0 0 rgba(255, 70, 85, 0.6); animation: live 1.8s infinite; vertical-align: 1px; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(255, 70, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 70, 85, 0); } }
.mods-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .mods-grid { grid-template-columns: minmax(0, 1fr); } }
.mods-stage { position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1100px) { .mods-stage { position: static; } }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--line); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-bottom: 1px solid var(--line); }
.player iframe, .chat-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chat-frame { position: relative; height: min(72vh, 760px); min-height: 420px; background: #0e0e10; }
.mods-stage.both .chat-frame { height: min(46vh, 480px); }
.mods-tools { display: grid; gap: 16px; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.availability.on { border-color: rgba(52, 211, 153, 0.35); background: linear-gradient(160deg, rgba(52, 211, 153, 0.07), transparent 60%), var(--surface-1); }
.availability .switch { width: 52px; height: 30px; }
.availability .switch::after { width: 22px; height: 22px; }
.availability .switch:checked { background: var(--success); border-color: var(--success); }
.availability .switch:checked::after { transform: translateX(22px); }
.team-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.team-status.on { background: var(--success); box-shadow: 0 0 10px rgba(52, 211, 153, 0.6); }
.list-item .avatar.sm { width: 32px; height: 32px; }

.link-field { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 4px 4px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.link-field a { flex: 1; min-width: 0; font-size: 13px; color: var(--lilac); }
.link-field a:hover { color: #fff; text-decoration: underline; }

/* ── Panel de mods: pestañas ──────────────────────────────────────────────── */
.mods-tools { display: block; }
.tabbar { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--surface-1); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar [role='tab'] { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; background: none; color: var(--text-3); font: 500 13.5px var(--font); white-space: nowrap; cursor: pointer; border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color 0.15s, background 0.15s; }
.tabbar [role='tab']:hover { color: var(--text); background: var(--surface-2); }
.tabbar [role='tab'][aria-selected='true'] { color: var(--text); font-weight: 600; }
.tabbar [role='tab'][aria-selected='true'] .mi { color: var(--purple); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.tabbar [role='tab'][aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gradient); }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px var(--mono); color: var(--success); background: rgba(52, 211, 153, 0.12); }
.tab-count:empty { display: none; }
.tabpanel { padding: 4px 22px 22px; animation: fade-in 0.2s var(--ease); }
.tabpanel > section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.tabpanel > section:last-child { border-bottom: 0; padding-bottom: 0; }
.section-title { font: 600 13px var(--font); color: var(--text-2); text-transform: none; letter-spacing: 0; margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.section-head .section-title { margin: 0; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.danger-zone strong { display: block; font-weight: 500; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

/* Interruptor de disponibilidad en la cabecera */
.avail-pill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-1); cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color 0.2s, background 0.2s; }
.avail-pill.on { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); color: var(--success); }
.avail-pill .switch:checked { background: var(--success); border-color: var(--success); }

/* Buscador de usuarios (combobox) */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 340px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line-3); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.75); animation: pop 0.15s var(--ease); }
.combo-list .group { padding: 8px 10px 4px; font: 600 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.combo-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.combo-option[aria-selected='true'], .combo-option:hover { background: rgba(192, 154, 253, 0.12); }
.combo-option img, .combo-option .ph { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--surface-2); }
.combo-option .grow { flex: 1; min-width: 0; }
.combo-option .name { font-weight: 600; font-size: 13.5px; }
.combo-option .login { font-size: 12px; color: var(--text-3); }
.combo-option mark { background: none; color: var(--purple); }
.combo-empty { padding: 14px 10px; color: var(--text-3); font-size: 13px; text-align: center; }
/* La tarjeta de pestañas no recorta: así el desplegable flota por encima y nada se desplaza por dentro */
.card.flush.mods-tools { overflow: visible; }
.combo-list { animation: none; }
@media (max-width: 1100px) {
  .mods-stage { order: 2; }
  .chat-frame { height: 60vh; min-height: 360px; }
  .tabbar { top: var(--topbar-h); }
}
@media (max-width: 560px) {
  .tabpanel { padding: 4px 16px 18px; }
  .tabbar [role='tab'] { padding: 0 11px; }
  .avail-pill { padding-left: 12px; }
  .mods-head .menu > summary .name { display: none; }
}

/* Los elementos de las listas pueden encoger (si no, el texto largo empuja los botones fuera) */
.list > * { min-width: 0; }
.list-item .btn, .list-item .badge { flex-shrink: 0; }

/* ── Apelaciones ──────────────────────────────────────────────────────────── */
.tab-count.warn { color: var(--warning); background: rgba(251, 191, 36, 0.14); }
.appeals { display: grid; gap: 12px; }
.appeal { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.appeal-head { display: flex; align-items: center; gap: 12px; }
.appeal-head .grow { flex: 1; min-width: 0; }
.appeal-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--purple); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-1); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.6; }
.appeal-quote.empty-text { color: var(--text-3); font-style: italic; }
.appeal-context { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
.appeal-context .mi { color: var(--danger); margin-top: 1px; }
.appeal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.appeal-actions .input { flex: 1 1 200px; height: 36px; }
.appeal-result { font-size: 12.5px; color: var(--text-2); }

/* Con muchas pestañas y poco ancho, se ocultan los iconos para que quepan los nombres */
.mods-tools { container-type: inline-size; }
@container (max-width: 680px) {
  .tabbar [role='tab'] { padding: 0 11px; gap: 6px; }
  .tabbar [role='tab'] > .mi { display: none; }
}

/* ── Barra de pestañas desplazable ────────────────────────────────────────── */
.tabbar { scroll-behavior: smooth; }
.tabbar.fade-left { mask-image: linear-gradient(90deg, transparent, #000 40px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); }
.tabbar.fade-right { mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.tabbar.fade-left.fade-right { mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tab-count.live { color: #fff; background: #e5485f; }

/* ── Recompensas ──────────────────────────────────────────────────────────── */
.reward-group { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.reward-group + .reward-group { margin-top: 12px; }
.reward-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.reward-head .grow { flex: 1; min-width: 0; }
.reward-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; background: var(--purple); }
.cost { display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--mono); color: var(--yellow); }
.cost .mi { font-size: 15px; }
.redemption { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.redemption:last-child { border-bottom: 0; }
.redemption .grow { flex: 1; min-width: 0; }
.redemption .input-text { margin-top: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-1); border-left: 3px solid var(--purple); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.redemption .actions { display: flex; gap: 6px; flex-shrink: 0; }
.catalog-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.catalog-item:last-child { border-bottom: 0; }
.catalog-item .grow { flex: 1 1 180px; min-width: 0; }
.catalog-item .controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.catalog-item .cost-input { width: 110px; height: 32px; }
.needs-broadcaster .callout { margin-top: 18px; }

/* ── Predicciones ─────────────────────────────────────────────────────────── */
.prediction { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-md); background: linear-gradient(160deg, rgba(145, 70, 255, 0.1), transparent 60%), var(--surface-2); border: 1px solid rgba(145, 70, 255, 0.35); }
.prediction-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prediction-head h3 { font-size: 17px; }
.outcome { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--line); cursor: default; }
.outcome.pickable { cursor: pointer; }
.outcome.pickable:hover { border-color: var(--line-3); }
.outcome.picked { border-color: var(--success); background: rgba(52, 211, 153, 0.08); }
.outcome .top { display: flex; align-items: center; gap: 10px; }
.outcome .top .grow { flex: 1; min-width: 0; font-weight: 600; }
.outcome .pct { font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
.outcome .bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.outcome .bar span { display: block; height: 100%; border-radius: inherit; background: #387aff; transition: width 0.6s var(--ease); }
.outcome.pink .bar span { background: #f5009b; }
.outcome .meta { font-size: 12px; color: var(--text-3); }
.outcomes-edit { display: grid; gap: 8px; }
.outcomes-edit .row { flex-wrap: nowrap; }
.outcomes-edit .input { flex: 1; }
.countdown { font: 700 13px var(--mono); }

.suffix-input { position: relative; }
.suffix-input .input { padding-right: 64px; }
.suffix-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }
.tabpanel .broadcaster-only > section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.tabpanel .broadcaster-only > section:last-child { border-bottom: 0; padding-bottom: 0; }
.tabpanel .broadcaster-only > section[hidden] + section { border-top: 0; }

/* ── Chat del equipo (canal de Discord) ─────────────────────────────────── */
.tc-panel { position: relative; display: flex; flex-direction: column; padding: 0 14px 14px; height: min(72vh, 760px); min-height: 420px; }
.tc-panel[hidden] { display: none; }
.tc-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tc-head strong::before { content: '#'; color: var(--text-3); margin-right: 2px; font-weight: 500; }
.tc-head strong.no-hash::before { content: none; }
.team-status.warn { background: var(--warning); }
.tc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; outline: none; }
.tc-log:focus-visible { box-shadow: var(--ring); border-radius: var(--r-sm); }
.tc-log > .empty { margin: auto; text-align: center; }
.tc-msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; padding: 6px 8px; border-radius: var(--r-sm); }
.tc-msg:hover { background: var(--surface-2); }
.tc-msg.grouped { padding-top: 1px; }
.tc-msg.grouped .tc-avatar, .tc-msg.grouped .tc-meta { display: none; }
.tc-msg.grouped .tc-body { grid-column: 2; }
.tc-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); object-fit: cover; grid-row: span 2; }
.tc-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tc-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tag { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 4px; background: rgba(145, 70, 255, 0.18); color: #bf94ff; flex-shrink: 0; }
.tc-tag.bot { background: rgba(88, 101, 242, 0.2); color: #a5b0ff; }
.tc-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.tc-body { font-size: 14px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.tc-body .dim { font-size: 12px; }
.tc-body .emoji { width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.tc-body.jumbo .emoji { width: 40px; height: 40px; }
.tc-body a { color: var(--info); }
.tc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tc-files img { max-width: min(100%, 320px); max-height: 220px; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }
.tc-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.tc-day { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 11.5px; color: var(--text-3); }
.tc-day::before, .tc-day::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.tc-jump { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 0; background: var(--purple); color: #120a1f; font-weight: 600; font-size: 12.5px; cursor: pointer; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6); }
.tc-compose { display: flex; gap: 8px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.tc-compose textarea { resize: none; min-height: 40px; max-height: 160px; line-height: 1.4; padding-block: 9px; }
.tc-compose .btn-icon { height: 40px; width: 40px; flex-shrink: 0; }

/* Chat del equipo dentro del panel izquierdo y avisos de mensajes nuevos */
.segmented .tab-count { margin-left: 6px; }
.stage-bar [hidden] { display: none !important; }
.btn-icon[aria-pressed="true"] .mi { color: var(--purple); }
.toast.msg { width: 100%; text-align: left; align-items: center; cursor: pointer; color: var(--text); font: inherit; border-color: rgba(88, 101, 242, 0.45); }
.toast.msg:hover { border-color: rgba(88, 101, 242, 0.8); }
.toast.msg img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--surface-2); object-fit: cover; }
.msg-text { display: grid; gap: 2px; min-width: 0; }
.msg-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-text span { font-size: 12.5px; font-weight: 400; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 760px) { .tc-panel { height: 70vh; min-height: 360px; } }
#discord-count { color: #fff; background: #5865f2; }
