:root {
  --bg: #090a0f;
  --bg-2: #0d0f16;
  --panel: #12141c;
  --panel-2: #171a24;
  --panel-3: #1d2130;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eceef4;
  --text-2: #b9bdca;
  --muted: #7f8496;
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #8b6cff 0%, #5b8cff 50%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --claude: #e08a5f;
  --codex: #3fcf9a;
  --gemini: #5b9bff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 108, 255, 0.12), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(34, 211, 238, 0.07), transparent 60%);
  pointer-events: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #a99bff; text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(139, 108, 255, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.16); }

/* ---------- Estructura ---------- */
.titlebar {
  position: fixed; top: 0; left: 0; right: 0; height: 40px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 150px 0 16px;
  -webkit-app-region: drag;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 15, 0.82);
  backdrop-filter: blur(14px);
}
.titlebar .brand-mini { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.titlebar .spacer { flex: 1; }
.titlebar .pill { -webkit-app-region: no-drag; }

.layout { position: absolute; top: 40px; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(13, 15, 22, 0.6);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(91, 140, 255, 0.35);
}
.logo svg { width: 20px; height: 20px; color: white; }
.logo.sm { width: 22px; height: 22px; border-radius: 7px; box-shadow: none; }
.logo.sm svg { width: 13px; height: 13px; }
.brand-name { font: 700 17px/1.1 var(--font-display); letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); cursor: pointer; border: 0; background: none; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(139, 108, 255, 0.18), rgba(139, 108, 255, 0.04)); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 20px; background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.nav-item .count.warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.sidebar .grow { flex: 1; }
.side-foot { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--muted); }
.side-foot b { color: var(--text-2); font-weight: 600; }

.main { overflow-y: auto; padding: 32px 40px 60px; }
.view { max-width: 1120px; margin: 0 auto; }
.view.anim { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.page-head h1 { font: 700 26px/1.15 var(--font-display); letter-spacing: -0.02em; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); max-width: 680px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Componentes ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card.flat { box-shadow: none; }
.card h3 { margin: 0 0 4px; font: 600 15px/1.3 var(--font-display); }
.card .sub { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { margin-left: auto; }
.section-title { font: 600 13px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 30px 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text);
  cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: #232838; border-color: rgba(255, 255, 255, 0.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border: 0; color: white; box-shadow: 0 6px 18px rgba(91, 140, 255, 0.28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 32px; padding: 0; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: rgba(255, 255, 255, 0.06); color: var(--text-2); border: 1px solid var(--line);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); }
.pill.warn { color: var(--warn); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); }
.pill.err { color: var(--err); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); }
.pill.off { color: var(--muted); }
.pill.live .dot { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--text-2); font-size: 13px; }
.chip:hover { border-color: rgba(255, 255, 255, 0.22); color: var(--text); }
.chip.on { background: rgba(139, 108, 255, 0.16); border-color: rgba(139, 108, 255, 0.5); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  outline: none; width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: rgba(139, 108, 255, 0.7); box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.18); }
.input.sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input option { background: var(--panel-2); }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--panel-3); border: 1px solid var(--line-2); cursor: pointer; transition: 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c9ccd6; transition: 0.2s; }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(18px); background: white; }

.code {
  position: relative; font: 12.5px/1.6 var(--mono); color: #d7dbea;
  background: #07080c; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; white-space: pre-wrap; word-break: break-all; margin: 0;
}
.code .copy { position: absolute; top: 8px; right: 8px; }
.code:has(> .copy) { padding-top: 50px; }
.kbd { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.tab { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.tab.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset; }

.mono-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font: 700 16px var(--font-display); color: #0b0c10; flex: none; }
.mono-badge.claude { background: linear-gradient(135deg, #f2a27a, var(--claude)); }
.mono-badge.codex { background: linear-gradient(135deg, #6ee7b7, var(--codex)); }
.mono-badge.gemini { background: linear-gradient(135deg, #93c5fd, var(--gemini)); }
.mono-badge.antigravity { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.mono-badge.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }

/* ---------- Inicio ---------- */
.hero { position: relative; overflow: hidden; padding: 28px; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: var(--grad); opacity: 0.13; filter: blur(30px); }
.hero h2 { margin: 0 0 6px; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.01em; }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font: 13px var(--mono); color: var(--text-2); }
.endpoint b { font: 600 11px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; width: 54px; }
.endpoint span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kpi { padding: 18px 20px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font: 700 28px/1.1 var(--font-display); margin-top: 6px; letter-spacing: -0.02em; }
.kpi .value small { font-size: 15px; color: var(--muted); font-weight: 500; }

.steps { display: grid; gap: 12px; }
.step { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
.step .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 1px solid var(--line-2); color: var(--text-2); flex: none; }
.step.done .num { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.4); color: var(--ok); }
.step.done .num svg { width: 16px; height: 16px; }
.step .txt { flex: 1; }
.step .txt b { display: block; font-weight: 600; }
.step .txt span { color: var(--muted); font-size: 13px; }

/* ---------- Cuentas ---------- */
.acc { display: flex; flex-direction: column; gap: 14px; }
.acc-head { display: flex; gap: 14px; align-items: flex-start; }
.acc-head .meta { flex: 1; min-width: 0; }
.acc-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .detail { font-size: 13px; color: var(--text-2); min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .usage { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.acc .u-head { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.acc .u-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.acc .u-head .pill.sm { padding: 1px 8px; font-size: 11px; }
.acc .u-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.acc .u-top b { color: var(--text); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acc .u-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 6px; }
.acc .u-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.4s ease; }
.acc .u-bar.warn i { background: var(--warn); }
.acc .u-bar.err i { background: var(--err); }
.acc .u-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.acc .u-nexo { display: grid; gap: 2px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 8px; }
.acc .u-nexo span { color: var(--muted); }
.acc .u-note { font-size: 11px; color: var(--muted); line-height: 1.4; }
.acc .err-box { --tone: var(--err); --tone-bg: rgba(248, 113, 113, 0.07); --tone-line: rgba(248, 113, 113, 0.2); display: grid; gap: 6px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); background: var(--tone-bg); border: 1px solid var(--tone-line); padding: 10px 12px; border-radius: 10px; }
.acc .err-box.temp { --tone: var(--warn); --tone-bg: rgba(251, 191, 36, 0.05); --tone-line: rgba(251, 191, 36, 0.22); }
.acc .err-head { display: flex; gap: 8px; align-items: flex-start; color: var(--tone); }
.acc .err-head svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.acc .err-head b { font-weight: 600; font-size: 13px; line-height: 1.35; }
.acc .err-tag { font-size: 11.5px; color: var(--muted); padding-left: 23px; margin-top: -4px; }
.acc .err-box p { margin: 0; }
.acc .err-box p span { color: var(--text); font-weight: 600; }
.acc .err-box summary { cursor: pointer; font-size: 11.5px; color: var(--muted); width: fit-content; }
.acc .err-box summary:hover { color: var(--text-2); }
.acc .err-box code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: auto; }
.acc .stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.acc .stats b { color: var(--text-2); font-weight: 600; }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.acc.disabled { opacity: 0.55; }
.add-card { border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; min-height: 210px; cursor: pointer; color: var(--muted); transition: 0.15s; }
.add-card:hover { border-color: rgba(139, 108, 255, 0.6); color: var(--text); background: rgba(139, 108, 255, 0.04); }
.add-card svg { width: 26px; height: 26px; }

.provider-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.provider-opt { padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: 0.15s; }
.provider-opt:hover { border-color: rgba(255, 255, 255, 0.22); }
.provider-opt.on { border-color: var(--accent); background: rgba(139, 108, 255, 0.08); box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.15); }
.provider-opt b { font-weight: 600; }
.provider-opt span { font-size: 12px; color: var(--muted); }

/* ---------- Roles ---------- */
.role { padding: 0; overflow: hidden; }
.role-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.role-head .name { font: 600 16px var(--font-display); }
.role-head .desc { flex: 1; }
.role-head .desc input { background: transparent; border-color: transparent; height: 32px; color: var(--text-2); }
.role-head .desc input:hover { border-color: var(--line-2); }
.chain { padding: 12px 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.link { display: grid; grid-template-columns: 96px minmax(170px, 1.2fr) minmax(170px, 1.2fr) 130px auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); }
.link .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.link.first .tag { color: #b9a8ff; }
.link .ops { display: flex; gap: 2px; }
.link.extra { opacity: 0.6; border-style: dashed; }
.role-empty { padding: 14px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); text-align: center; font-size: 13px; }

.savebar { position: sticky; bottom: 0; margin-top: 20px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: rgba(23, 26, 36, 0.92); border: 1px solid rgba(139, 108, 255, 0.4); backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); animation: fade 0.2s; }

/* ---------- Conexiones ---------- */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.sys-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.sys-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; text-align: left; }
.sys-item:hover { background: rgba(255, 255, 255, 0.03); }
.sys-item.on { background: rgba(139, 108, 255, 0.1); border-color: rgba(139, 108, 255, 0.35); }
.sys-item .ico { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); }
.sys-item .ico svg { width: 15px; height: 15px; }
.sys-item b { font-weight: 600; display: block; font-size: 13.5px; }
.sys-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.sys-name > span { font-size: 12px; color: var(--muted); }
.connection-history { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.connection-history .sys-item { flex-wrap: wrap; }
.connection-history .sys-name { flex-basis: 160px; }
.connection-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px 16px; margin: 12px 0; }
.connection-report dt { font-size: 12px; color: var(--muted); }
.connection-report dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); cursor: pointer; text-align: left; font-size: 13.5px; transition: 0.15s; }
.choice:hover { border-color: rgba(255, 255, 255, 0.2); color: var(--text); }
.choice .radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.choice.on { border-color: var(--accent); background: rgba(139, 108, 255, 0.09); color: var(--text); }
.choice.on .radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px); }
.conn-body { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.live-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.pair-code { text-align: center; font: 700 34px/1.1 var(--mono); letter-spacing: 0.14em; padding: 18px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px dashed rgba(139, 108, 255, 0.55); color: #fff; }
.token-box { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 10px; background: #07080c; border: 1px solid var(--line); font: 13px var(--mono); }
.token-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

/* ---------- Probar ---------- */
.answer { white-space: pre-wrap; line-height: 1.65; font-size: 14.5px; }
.answer img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.test-video-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.test-video-options select { width: 100%; }
.answer video { display: block; max-width: 100%; max-height: 65vh; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.trail { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.trail div { display: flex; gap: 8px; align-items: baseline; color: var(--muted); }
.trail div b { color: var(--text-2); font-weight: 600; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-2); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Actividad ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.err { color: var(--err); max-width: 380px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: 0.5; margin-bottom: 8px; }

/* ---------- Ajustes ---------- */
.setting { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; }
.setting .txt b { display: block; font-weight: 600; }
.setting .txt { min-width: 0; }
.setting .txt span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.setting .input { width: 140px; }

/* ---------- Modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(3, 4, 8, 0.66); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; animation: fadein 0.15s; padding: 30px; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 80px); overflow-y: auto; background: linear-gradient(180deg, #1a1d29, #13151e); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: scale(0.97) translateY(6px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font: 700 18px var(--font-display); flex: 1; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; }

.flow { display: flex; flex-direction: column; gap: 2px; }
.flow-step { display: flex; gap: 14px; padding: 12px 0; }
.flow-step .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.flow-step .ic svg { width: 14px; height: 14px; }
.flow-step.active .ic { border-color: var(--accent-2); color: var(--accent-2); }
.flow-step.done .ic { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.45); color: var(--ok); }
.flow-step.fail .ic { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.45); color: var(--err); }
.flow-step b { display: block; font-weight: 600; }
.flow-step span { font-size: 13px; color: var(--muted); }
.success { text-align: center; padding: 10px 0 4px; }
.success .big { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: rgba(52, 211, 153, 0.14); color: var(--ok); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.06); animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.success .big svg { width: 30px; height: 30px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.more pre { max-height: 160px; overflow: auto; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(91, 140, 255, 0.25); background: rgba(91, 140, 255, 0.06); font-size: 13px; color: var(--text-2); }
.notice svg { width: 18px; height: 18px; color: #8fb0ff; flex: none; margin-top: 1px; }
.notice.warn { border-color: rgba(251, 191, 36, 0.25); background: rgba(251, 191, 36, 0.05); }
.notice.warn svg { color: var(--warn); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: #1d2130; border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: pop 0.2s; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--err); }

/* ---------- Pantalla de acceso ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 300; background: var(--bg); }
.gate .card { width: 420px; text-align: center; padding: 32px; }

@media (max-width: 1100px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .link { grid-template-columns: 1fr 1fr; }
  .link .tag { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 24px 18px 60px; }
  .grid.c2, .grid.c3, .provider-pick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
