/* Onyx Panel — "Noche Índigo" (oscuro) y "Día Índigo" (claro) */
:root, [data-theme="dark"] {
  --bg: #070912; --bg-2: #0a0d1a; --side: #080b16;
  --card: #0e1222; --card-2: #121730; --input: #0a0e1c;
  --line: rgba(160, 172, 255, .10); --line-2: rgba(160, 172, 255, .18);
  --text: #eef0ff; --text-2: #c4c8e6; --muted: #8a90b2; --faint: #5d6385;
  --accent: #8e9bff; --accent-2: #5b67e8; --accent-soft: rgba(142, 155, 255, .13);
  --grad: linear-gradient(135deg, #9aa6ff 0%, #6b77f2 55%, #5260dc 100%);
  --ok: #4ade9b; --ok-bg: rgba(74, 222, 155, .12);
  --warn: #fbbf5a; --warn-bg: rgba(251, 191, 90, .12);
  --bad: #ff7a8a; --bad-bg: rgba(255, 122, 138, .12);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5fb; --bg-2: #eceefa; --side: #ffffff;
  --card: #ffffff; --card-2: #f6f7fd; --input: #ffffff;
  --line: rgba(40, 48, 110, .10); --line-2: rgba(40, 48, 110, .18);
  --text: #141833; --text-2: #3b4166; --muted: #6a7093; --faint: #9aa0bf;
  --accent: #5b67e8; --accent-2: #4652d6; --accent-soft: rgba(91, 103, 232, .10);
  --ok: #12a46b; --ok-bg: rgba(18, 164, 107, .10); --warn: #c27c0e; --warn-bg: rgba(194, 124, 14, .10);
  --bad: #d63650; --bad-bg: rgba(214, 54, 80, .09);
  --shadow: 0 20px 50px -24px rgba(30, 36, 90, .35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text-2); font: 400 14.5px/1.5 "Instrument Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: "Sora", system-ui, sans-serif; color: var(--text); margin: 0; letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
[hidden] { display: none !important; }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand b { font: 800 16px "Sora", system-ui, sans-serif; color: var(--text); letter-spacing: -.02em; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.nav h6 { margin: 16px 10px 6px; font: 600 11.5px "Instrument Sans", system-ui, sans-serif; color: var(--faint); letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; position: relative; }
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--accent-soft); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav a.on svg { color: var(--accent); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .soon { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.side-foot { padding: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.pick:hover { border-color: var(--line-2); }
.pick .av { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; font: 700 13px "Sora", system-ui, sans-serif; flex: none; overflow: hidden; }
.pick .av img { width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 17px; height: 17px; }
.pick small { display: block; font-size: 11px; color: var(--faint); line-height: 1.2; }
.pick b { display: block; color: var(--text); font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick > span { min-width: 0; flex: 1; }
.pick svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.main { min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.search { flex: 0 1 340px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); }
.search kbd { white-space: nowrap; font: 600 11px "JetBrains Mono", ui-monospace, monospace; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.top .grow { flex: 1; }
.page { width: min(1120px, 100%); margin: 0 auto; padding: 30px 28px 120px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .grow { flex: 1; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -12px rgba(91, 103, 232, .9); }
.btn.green { background: #22a565; border-color: transparent; color: #fff; }
.btn.danger { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.btn.danger.solid { background: #e5485f; color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: .75; }
.btn.busy::after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.card + .card { margin-top: 16px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.card h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.card h3 svg { width: 17px; height: 17px; color: var(--accent); }
.card .sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head .grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .k { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stat .k i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-style: normal; }
.stat .k svg { width: 13px; height: 13px; }
.stat .v { font: 800 30px/1.1 "Sora", system-ui, sans-serif; color: var(--text); letter-spacing: -.03em; }
.stat .s { font-size: 12.5px; color: var(--faint); }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line-2); }
.empty .ic svg { width: 22px; height: 22px; }
.empty h4 { font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 auto 16px; max-width: 34em; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; flex: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.mute { background: var(--card-2); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- formularios ---------- */
.field { display: grid; gap: 7px; align-content: start; }
.field + .field, .field + .row, .row + .field { margin-top: 16px; }
.row > .field, .row > .field + .field { margin-top: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.help { font-size: 12.5px; color: var(--faint); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--input); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.big { height: 46px; font-size: 16px; font-weight: 600; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip .x { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: grid; }
.chip .x svg { width: 13px; height: 13px; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-2); font: 500 12px "JetBrains Mono", ui-monospace, monospace; color: var(--text-2); cursor: pointer; background: var(--card); }
.tag:hover { border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; color: var(--text); font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent-2); margin: 0; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--accent-2); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(17px); background: #fff; }
.set { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.set + .set { border-top: 1px solid var(--line); }
.set .t { flex: 1; }
.set .t b { display: block; color: var(--text); font-weight: 600; }
.set .t small { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: none; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.seg button svg { width: 14px; height: 14px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.option:hover { border-color: var(--accent); }
.option.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.option .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); color: var(--accent); flex: none; }
.option .ic svg { width: 17px; height: 17px; }
.option b { display: block; color: var(--text); font-size: 14px; }
.option small { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }
.option .radio { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.option.on .radio { border: 5px solid var(--accent-2); }

/* ---------- tablas / listas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; }
.table b { color: var(--text); font-weight: 600; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { color: var(--text); }
.av { width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); display: grid; place-items: center; overflow: hidden; flex: none; font: 700 13px "Sora", system-ui, sans-serif; color: var(--accent); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av svg { width: 17px; height: 17px; }
.av.round { border-radius: 50%; }

/* ---------- instancias ---------- */
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.inst { position: relative; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; }
.inst:hover { border-color: var(--line-2); transform: translateY(-2px); }
.inst .art { aspect-ratio: 16 / 8.5; background: linear-gradient(135deg, #1a1f48, #0d1027); position: relative; overflow: hidden; }
.inst .art img { width: 100%; height: 100%; object-fit: cover; }
.inst .art .badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.inst .art .badges .badge { backdrop-filter: blur(6px); background: rgba(7, 9, 18, .72); }
.inst .body { padding: 13px 15px 15px; display: flex; gap: 12px; align-items: center; }
.inst .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--card-2); flex: none; overflow: hidden; display: grid; place-items: center; font: 800 13px "Sora", system-ui, sans-serif; color: var(--accent); margin-top: -30px; border: 2px solid var(--card); }
.inst .ico img { width: 100%; height: 100%; object-fit: cover; }
.inst h4 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inst small { color: var(--muted); font-size: 12.5px; }
.inst .play { margin-left: auto; text-align: right; font: 700 15px "Sora", system-ui, sans-serif; color: var(--text); }
.inst .play small { display: block; font: 500 11px "Instrument Sans", system-ui, sans-serif; color: var(--faint); }
.new-card { border: 1.5px dashed var(--line-2); border-radius: 18px; display: grid; place-items: center; min-height: 200px; color: var(--muted); cursor: pointer; background: none; }
.new-card:hover { border-color: var(--accent); color: var(--text); }
.new-card div { display: grid; justify-items: center; gap: 8px; font-weight: 600; }
.new-card svg { width: 22px; height: 22px; }

/* Vista previa (como en el launcher) */
.preview { position: relative; border-radius: 18px; overflow: hidden; background: #0b0e1d; border: 1px solid var(--line-2); aspect-ratio: 16 / 9; color: #fff; box-shadow: var(--shadow); }
.preview .bg { position: absolute; inset: 0; background: radial-gradient(500px 260px at 70% 0%, rgba(91, 103, 232, .35), transparent 70%), #0b0e1d; }
.preview .bg img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.preview .vig { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 7, 16, .1) 0%, rgba(5, 7, 16, .25) 40%, rgba(5, 7, 16, .92) 100%); }
.preview .inner { position: absolute; left: 22px; right: 22px; bottom: 20px; }
.preview .cat { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.preview h2 { font-size: 26px; color: #fff; margin: 2px 0 2px; word-break: break-word; }
.preview .logo { max-height: 64px; max-width: 70%; object-fit: contain; margin-bottom: 6px; }
.preview .desc { font-size: 12.5px; color: rgba(255, 255, 255, .75); margin-bottom: 6px; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview .meta { display: flex; gap: 12px; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .8); margin-bottom: 12px; }
.preview .meta span { display: inline-flex; align-items: center; gap: 4px; }
.preview .meta svg { width: 12px; height: 12px; }
.preview .go { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 13px; color: #fff; }
.preview .go svg { width: 12px; height: 12px; }
.preview .by { position: absolute; right: 22px; bottom: 26px; font-size: 11.5px; color: rgba(255, 255, 255, .75); }
.preview .by b { color: #fff; }
.preview .snow { position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 120px 80px, #fff, transparent), radial-gradient(2px 2px at 220px 20px, #fff, transparent), radial-gradient(1.5px 1.5px at 300px 120px, #fff, transparent); background-size: 340px 160px; opacity: .55; }
.preview-cap { text-align: center; font-size: 12px; color: var(--faint); margin-top: 10px; }

/* Cabecera de instancia */
.ihead { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--card); min-height: 170px; display: flex; align-items: flex-end; }
.ihead .bg { position: absolute; inset: 0; }
.ihead .bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.55); transform: scale(1.04); }
.ihead .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--card) 15%, color-mix(in srgb, var(--card) 60%, transparent) 60%, transparent); }
.ihead .in { position: relative; display: flex; align-items: flex-end; gap: 16px; padding: 22px; width: 100%; }
.ihead h1 { font-size: 30px; font-weight: 800; }
.ihead .meta { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ihead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: 2px; margin: 16px 0 20px; padding: 4px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.tabs a svg { width: 15px; height: 15px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--accent-soft); color: var(--text); }
.subnav { position: sticky; top: 84px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.subnav a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.subnav a svg { width: 15px; height: 15px; color: var(--muted); }
.subnav a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.split { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kv div { padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.kv small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.kv b { color: var(--text); font-weight: 600; }

/* Huecos de imagen */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot { border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2); padding: 10px; display: grid; gap: 8px; }
.slot .pv { aspect-ratio: 16 / 7; border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: var(--faint);
  background-color: var(--input); background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%), linear-gradient(-45deg, var(--line) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--line) 75%), linear-gradient(-45deg, transparent 75%, var(--line) 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.slot .pv img, .slot .pv video { width: 100%; height: 100%; object-fit: cover; }
.slot .pv svg { width: 22px; height: 22px; }
.slot b { color: var(--text); font-size: 13px; }
.slot .ctl { display: flex; gap: 6px; }
.slot .ctl .input { height: 32px; font-size: 12.5px; padding: 0 9px; }
.slot.off { opacity: .55; }
.colors { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.color-pick { display: flex; align-items: center; gap: 10px; }
.color-pick input[type=color] { width: 44px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2); padding: 2px; background: var(--input); cursor: pointer; }

/* Gráfica */
.chart { width: 100%; height: 170px; display: block; }
.chart .area { fill: url(#cgrad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--faint); font-size: 11px; font-family: "Instrument Sans", system-ui, sans-serif; }
.nums { display: flex; gap: 34px; margin: 6px 0 12px; }
.nums b { display: block; font: 800 22px "Sora", system-ui, sans-serif; color: var(--text); }
.nums small { color: var(--muted); font-size: 12px; }

/* ---------- barra de guardar ---------- */
.savebar { position: fixed; left: calc(50% + 120px); bottom: 22px; transform: translate(-50%, 120px); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 9px 9px 9px 16px; border-radius: 15px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.savebar.show { transform: translate(-50%, 0); }
.savebar span { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 13.5px; margin-right: 18px; }
.savebar span svg { width: 15px; height: 15px; color: var(--warn); }

/* ---------- ventanas ---------- */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 4, 10, .66); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal.wide { width: min(980px, 100%); }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { font-size: 16px; flex: 1; display: flex; align-items: center; gap: 8px; }
.modal .mh h3 svg { width: 17px; height: 17px; color: var(--accent); }
.modal .mb { padding: 20px 18px; }
.modal .mf { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--card-2); }
.modal .mf .grow { flex: 1; }
.wiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 470px; }
.wiz .l { padding: 26px 26px 20px; border-right: 1px solid var(--line); }
.wiz .r { padding: 26px; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(400px 300px at 70% 20%, var(--accent-soft), transparent 70%); }
.wiz .stepno { font-size: 12px; font-weight: 700; color: var(--accent); }
.wiz h2 { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.wiz .lead { color: var(--muted); margin: 0 0 20px; }
.steps { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.steps i { width: 24px; height: 1px; background: var(--line-2); }
.steps span { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 4px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); }
.steps span b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--muted); }
.steps span.on { background: var(--accent-soft); color: var(--text); }
.steps span.on b { background: var(--accent-2); border-color: transparent; color: #fff; }
.steps span.done b { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.steps span.done b svg { width: 12px; height: 12px; }
.loaders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.loaders .option { padding: 11px; flex-direction: column; gap: 6px; }
.loaders .option .ic { width: 28px; height: 28px; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--accent); }
.code-box b { font: 700 20px "JetBrains Mono", ui-monospace, monospace; color: var(--text); letter-spacing: .08em; }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); font-weight: 500; animation: pop .2s; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--bad); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; }
.note svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 2px; }
.note.warn { background: var(--warn-bg); }
.note.warn svg { color: var(--warn); }

/* ---------- entrada ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 20% -10%, rgba(91, 103, 232, .3), transparent 60%), radial-gradient(700px 500px at 110% 110%, rgba(142, 155, 255, .12), transparent 60%), var(--bg); }
.gate .box { width: min(420px, 100%); text-align: center; padding: 38px 32px 32px; border-radius: 24px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.gate .box img.logo { height: 44px; width: auto; margin: 0 auto 26px; }
[data-theme="light"] .gate .box img.logo { filter: invert(1) hue-rotate(180deg); }
.gate h1 { font-size: 24px; font-weight: 800; }
.gate p { color: var(--muted); margin: 8px 0 24px; }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; width: 100%; height: 46px; font-size: 15px; }
.btn.discord svg { width: 20px; height: 20px; }
.skel { background: linear-gradient(90deg, var(--card-2), var(--line), var(--card-2)); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 12px; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- móvil ---------- */
.menu-btn { display: none; }
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .g3, .g2, .g-main, .split, .wiz { grid-template-columns: 1fr; }
  .wiz .l { border-right: 0; border-bottom: 1px solid var(--line); }
  .slots { grid-template-columns: 1fr 1fr; }
  .savebar { left: 50%; }
  .page { padding: 20px 16px 120px; }
  .ihead .in { flex-direction: column; align-items: flex-start; }
  .ihead .acts { margin-left: 0; justify-content: flex-start; }
  .subnav { position: static; display: flex; overflow-x: auto; }
  .steps span:not(.on) em { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { font-size: 11.5px; font-weight: 700; color: var(--faint); text-align: center; text-transform: capitalize; padding-bottom: 4px; }
.cal-d { min-height: 104px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d.out { opacity: .45; }
.cal-d.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-d .n { font: 700 12.5px "Sora", system-ui, sans-serif; color: var(--text); padding: 0 2px; }
.cal-e { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-e b { color: var(--c); font-weight: 700; }
.cal-e.sel { box-shadow: 0 0 0 1.5px var(--c); }
.cal-d .more { font-size: 11px; color: var(--muted); padding-left: 4px; }
@media (max-width: 920px) { .cal-d { min-height: 64px; } .cal-e { font-size: 0; padding: 0; height: 6px; } }

.refcode { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.refcode .grow { flex: 1; min-width: 220px; }
.code-big { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 17px; font-weight: 700; letter-spacing: .06em; padding: 9px 14px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
