/* ═══════════════════════════════════════════════════════════
   ReplicatorNT — panel web (tema zinc institucional, acento índigo)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #09090b;
  --bg-soft: #0c0c0f;
  --card: #18181b;
  --card-2: #1c1c20;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #4f46e5;
  --accent-2: #818cf8;
  --accent-rgb: 79, 70, 229;
  --accent2-rgb: 129, 140, 248;
  --accent-hover: #4338ca;
  --grad: #4f46e5;
  --error: #f87171;
  --ok: #059669;
  --pnl-up: #34d399;
  --pnl-down: #fb7185;
  --warn: #d97706;
  --violet: #818cf8;
  --control-h: 2.5rem;
  --input-bg: rgba(0, 0, 0, 0.2);
  --input-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --key-fg: #6ee7b7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.40), 0 4px 6px -4px rgba(0, 0, 0, 0.40);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.hidden { display: none !important; }
.error { color: var(--error); font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.9rem; }
.hint.tiny { font-size: 0.78rem; }
.hint code { font-family: var(--mono); font-size: 0.85em; color: var(--accent-2); }

::selection { background: rgba(var(--accent-rgb), 0.35); }

/* ── Marca ─────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand-mark { display: inline-flex; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-accent { color: var(--accent); }
.brand-lg .brand-name { font-size: clamp(1.55rem, 3vw, 1.9rem); }
.brand-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.brand-link:hover { opacity: 0.92; }

.text-gradient { color: var(--accent); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.4rem; }
.card-icon { margin-right: 0.35rem; }

.pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  white-space: nowrap;
}
.pill-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }

/* ── Formularios ───────────────────────────────────────── */
label { display: block; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 500; color: var(--muted); }

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]),
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  height: var(--control-h);
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  box-shadow: var(--input-inset);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.25;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
textarea {
  height: auto;
  min-height: 7.5rem;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  line-height: 1.5;
}
select {
  background-color: var(--input-bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23a1a1aa' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  color-scheme: dark;
}
select option,
select optgroup {
  background-color: #151922;
  color: #e8eaed;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-width: 1.05rem;
  max-width: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  max-width: none;
}
.inline-check input[type="checkbox"] {
  width: 1.05rem !important;
  height: 1.05rem !important;
}
.admin-user-modal-panel {
  max-width: 640px;
  width: min(640px, 94vw);
  max-height: 90vh;
  overflow: auto;
  text-align: left;
}
.admin-user-modal-panel .form-grid {
  margin-top: 0.75rem;
}
.admin-user-section {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.admin-user-section h4 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
input::placeholder,
textarea::placeholder { color: rgba(161, 161, 170, 0.55); }
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: var(--input-inset), 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

button,
.btn-primary,
.btn-mkt {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  padding: 0 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  line-height: 1;
  border: 1px solid transparent;
  color: #fafafa;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 42%),
    #4338ca;
  box-shadow: none;
  transition: filter 0.15s, opacity 0.15s, border-color 0.15s, background-color 0.15s;
}
button:hover,
.btn-primary:hover,
.btn-mkt:hover { filter: brightness(1.1); }
button:active { filter: brightness(0.96); }
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.btn-mkt-outline {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  padding: 0 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  filter: none;
}
.btn-mkt-outline:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); filter: none; }

.btn-block { width: 100%; margin-top: 0.25rem; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  font-weight: 500;
  filter: none;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); box-shadow: none; border-color: var(--border-strong); filter: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
  font-weight: 500;
  filter: none;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); box-shadow: none; filter: none; }

.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.35); box-shadow: none; filter: none; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); box-shadow: none; filter: none; }

.btn-xs {
  height: 1.75rem;
  padding: 0 0.55rem;
  font-size: 0.72rem;
}
.input-xs {
  width: 6.5rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  margin: 0;
  display: inline-block;
}

.tabs button,
.dash-tabs button,
.admin-tabs button,
.pub-filter-group button,
.profile-window-tabs button,
.canales-tabs button,
.icon-btn,
.pay-method-btn,
.btn-mkt-ghost,
.landing-cta button,
.share-act {
  height: auto;
  min-height: 0;
  filter: none;
}
.tabs button:hover,
.dash-tabs button:hover,
.admin-tabs button:hover,
.pub-filter-group button:hover,
.profile-window-tabs button:hover,
.canales-tabs button:hover,
.icon-btn:hover,
.pay-method-btn:hover,
.btn-mkt-ghost:hover,
.btn-mkt-outline:hover,
.share-act:hover {
  filter: none;
}
.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  font-weight: 500;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  filter: none;
}
.landing-cta button { min-height: 2.75rem; }

/* ══════════ PANTALLA DE ACCESO ══════════ */
.auth-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
  gap: 3.5rem;
  align-items: center;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
  min-height: min(100vh, 820px);
}

.auth-hero .brand { margin-bottom: 1.75rem; animation: fadeUp 0.55s ease both; }

.hero-title {
  font-family: var(--font);
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 1rem;
  max-width: 18ch;
  animation: fadeUp 0.55s ease 0.06s both;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 32rem;
  margin: 0 0 1.4rem;
  animation: fadeUp 0.55s ease 0.12s both;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.55s ease 0.18s both;
}
.hero-trust span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.hero-visual { animation: fadeUp 0.55s ease 0.24s both; }
.hero-terminal {
  max-width: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.hero-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.hero-terminal-bar span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--border-strong);
}
.hero-terminal-bar span:nth-child(1) { background: #f87171; }
.hero-terminal-bar span:nth-child(2) { background: #fbbf24; }
.hero-terminal-bar span:nth-child(3) { background: #34d399; }
.hero-terminal-bar em {
  margin-left: 0.5rem;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.hero-terminal-body {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: #c5d0e0;
}
.ht-ok { color: var(--ok); }
.ht-accent { color: var(--accent-2); }
.ht-dim { color: var(--muted); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.auth-card {
  padding: 2rem;
  animation: fadeUp 0.55s ease 0.1s both;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}
.auth-hint { margin: 0 0 1.25rem; }
.auth-note { text-align: center; margin: 0.85rem 0 0; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; background: var(--bg-soft); padding: 0.3rem; border-radius: 12px; border: 1px solid var(--border); }
.tabs button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0.55rem;
  font-weight: 600;
}
.tabs button:hover { transform: none; color: var(--text); background: transparent; }
.tabs button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

/* Tabs del panel de control */
.dash-tabs {
  position: sticky;
  top: 64px;
  z-index: 15;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs button {
  flex: 1 0 auto;
  white-space: nowrap;
  min-width: 0;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}
.dash-tab { animation: dashTabIn 0.22s ease; }
@keyframes dashTabIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.steps-strip li[data-goto-tab] {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.steps-strip li[data-goto-tab]:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
.steps-strip li[data-goto-tab]:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.7);
  outline-offset: 2px;
}

/* ══════════ TOPBAR + PÁGINA ══════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem; }
.page-eyebrow,
.landing-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}
.page-head { margin-bottom: 1.5rem; }
.landing-section .landing-eyebrow { text-align: center; }

/* Pasos 1-2-3 */
.steps-strip {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.steps-strip li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.step-n {
  flex: none;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.steps-strip strong { display: block; font-size: 0.88rem; letter-spacing: -0.01em; }
.steps-strip div span { color: var(--muted); font-size: 0.76rem; }

/* Grid del dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }

/* API key / License Key — pozo, no botón */
.key-field {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
}
#api-key-display,
.license-key,
code.license-key,
.crypto-wallet,
.admin-lic-info code {
  display: flex;
  align-items: center;
  min-height: var(--control-h);
  word-break: break-all;
  padding: 0 0.85rem;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--input-inset);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--key-fg);
  line-height: 1.4;
  white-space: nowrap;
  overflow-x: auto;
}
#api-key-display {
  flex: 1 1 16rem;
  margin: 0;
  min-width: 0;
}
.license-key,
code.license-key {
  margin: 0.45rem 0;
}
.admin-lic-info code {
  min-height: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
}
.key-field .channel-actions {
  margin: 0;
  flex: 0 0 auto;
}

.ws-hint {
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-x: auto;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--input-inset);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

/* ── Tienda de licencias ───────────────────────────────── */
.license-store {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
  align-items: stretch;
}
.license-product-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  background: var(--card-2);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.license-product-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.license-product-card.featured { border-color: rgba(var(--accent-rgb), 0.35); }
/* Badge configurable desde el panel admin (texto libre por producto) */
.card-badge {
  position: absolute;
  top: -0.7rem;
  right: 1rem;
  max-width: calc(100% - 2rem);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-icon {
  width: 2.7rem; height: 2.7rem;
  display: grid; place-items: center;
  font-size: 1.3rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.8rem;
}
.license-product-card h4 { margin: 0 0 0.3rem; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.license-product-card .product-desc { font-size: 0.82rem; color: var(--muted); margin: 0 0 1rem; min-height: 2.5em; }
.license-product-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.license-product-actions button { flex: 1; min-width: 7rem; }
.license-product-foot { margin-top: auto; padding-top: 0.35rem; }
.btn-trial { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); box-shadow: none; filter: none; }
.btn-trial:hover:not(:disabled) { background: rgba(52, 211, 153, 0.24); box-shadow: none; filter: none; }
.license-trial-used { font-size: 0.75rem; color: var(--muted); margin: 0.6rem 0 0; }

.license-list-title { margin: 1.6rem 0 0.6rem; font-size: 0.8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

#license-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.license-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}
.license-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.license-head strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.license-badge {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.16rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.license-badge.ok {
  color: var(--accent-2);
  border-color: rgba(var(--accent2-rgb), 0.28);
  background: rgba(var(--accent2-rgb), 0.12);
}
.license-badge.revoked { color: var(--pnl-down); border-color: rgba(251, 113, 133, 0.32); background: rgba(251, 113, 133, 0.10); }
.license-badge.expired { color: var(--warn); border-color: rgba(217, 119, 6, 0.35); background: rgba(217, 119, 6, 0.10); }
.license-expired-note { color: var(--warn); margin-top: 0.3rem; }

.activation-list {
  list-style: none;
  padding: 0.7rem 0 0 1rem;
  margin: 0.6rem 0 0;
  border-left: 2px solid var(--border-strong);
}
.activation-item { margin-bottom: 0.7rem; font-size: 0.88rem; }
.activation-item .hint { font-family: var(--mono); font-size: 0.74rem; }

/* ── Canales ───────────────────────────────────────────── */
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }
.inline-form input,
.inline-form select { flex: 1; min-width: 160px; margin: 0; height: var(--control-h); }
.inline-form button { white-space: nowrap; height: var(--control-h); }
.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
}
.channel-actions button { height: var(--control-h); }

#channel-list.channel-rows {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.channel-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  transition: border-color 0.15s, background 0.15s;
}
.channel-row:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(255, 255, 255, 0.02); }
.channel-row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.65rem;
  min-height: 44px;
}
.channel-row-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.channel-row-toggle:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}
.channel-chevron {
  flex: 0 0 auto;
  width: 0.7rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.channel-row.is-open .channel-chevron { transform: rotate(90deg); }
.channel-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; min-width: 0; }
.channel-row-title strong { font-size: 0.9rem; letter-spacing: -0.01em; }
.channel-row-summary {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42%;
}
.channel-row .ch-id {
  font-family: var(--mono);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-row-meta { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.channel-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}
.channel-icon-btn svg { width: 18px; height: 18px; }
.channel-row-details {
  display: none;
  padding: 0.35rem 0.15rem 0.55rem;
  border-top: 1px solid var(--border);
}
.channel-row.is-open .channel-row-details { display: block; }
.channel-row-actions button { font-size: 0.8rem; }
.channel-icon-btn { padding: 0; }
.channel-row .btn-log-live { background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); border: 1px solid rgba(var(--accent-rgb), 0.28); box-shadow: none; filter: none; }
.channel-row .btn-log-live:hover { background: rgba(var(--accent-rgb), 0.2); box-shadow: none; filter: none; }
.channel-row .btn-delete-channel { background: rgba(248, 113, 113, 0.1); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.35); box-shadow: none; filter: none; }
.channel-row .btn-delete-channel:hover { background: rgba(248, 113, 113, 0.2); filter: none; }

.publish-avatar-field { margin: 0.85rem 0 1rem; }
.publish-avatar-label { display: block; font-weight: 600; margin-bottom: 0.45rem; font-size: 0.9rem; }
.publish-avatar-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.publish-avatar-preview {
  width: 64px; height: 64px; flex: 0 0 64px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.publish-avatar-preview.has-img { color: transparent; font-size: 0; }
.publish-avatar-controls { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.publish-avatar-controls input[type="file"] { font-size: 0.82rem; max-width: 100%; }
.pub-avatar.has-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
}

/* ══════════ LOG EN VIVO ══════════ */
#channel-log-panel .page { max-width: 1300px; }

.log-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.log-title-wrap h2 { margin: 0; font-size: 1.15rem; }
.log-title-wrap .hint { margin: 0.1rem 0 0; font-family: var(--mono); font-size: 0.78rem; }
.log-status {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.log-status.live { color: var(--ok); border-color: rgba(52, 211, 153, 0.5); }
.log-status.live::before { content: "●"; margin-right: 0.4rem; animation: pulse 1.6s infinite; }
.log-status.paused { color: var(--warn); border-color: rgba(251, 191, 36, 0.5); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.log-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 0.9rem 1.5rem; margin-bottom: 1rem; }
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}
.inline-check input[type="checkbox"] {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-width: 1.05rem;
  max-width: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.log-console-wrap { padding: 0; overflow: hidden; }
.console-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}
.console-chrome span { width: 0.72rem; height: 0.72rem; border-radius: 50%; background: var(--border-strong); }
.console-chrome span:nth-child(1) { background: #f87171; }
.console-chrome span:nth-child(2) { background: #fbbf24; }
.console-chrome span:nth-child(3) { background: #34d399; }
.console-chrome em { margin-left: 0.6rem; font-style: normal; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.log-console {
  margin: 0;
  padding: 1.1rem 1.2rem;
  min-height: 460px;
  max-height: 70vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  background: #07090f;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line-master { color: #79c0ff; }
.log-line-slave { color: #7ee787; }
.log-line-server { color: #d2a8ff; }
.log-line-system { color: #8b949e; }
.log-line-error { color: #ff7b72; }
.log-line-relay { color: #ffa657; }

/* ── Precios de producto ───────────────────────────────── */
.product-price { display: flex; align-items: baseline; gap: 0.5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.price-now { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 0.95rem; }
.price-period { color: var(--muted); font-size: 0.78rem; }
.offer-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
}
.product-included { font-size: 0.76rem; color: var(--muted); margin: -0.4rem 0 1rem; }
.btn-renew-lic { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35); box-shadow: none; filter: none; }
.btn-renew-lic:hover { background: rgba(52, 211, 153, 0.24); box-shadow: none; filter: none; }
.btn-manage-sub { background: rgba(var(--accent-rgb), 0.12); color: var(--accent-2); border: 1px solid rgba(var(--accent-rgb), 0.28); box-shadow: none; filter: none; }
.btn-manage-sub:hover { background: rgba(var(--accent-rgb), 0.22); box-shadow: none; filter: none; }

/* ── Administración ────────────────────────────────────── */
.admin-tabs { margin: 1rem 0 1.2rem; max-width: none; flex-wrap: wrap; }
.admin-tab { min-height: 4rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.admin-table,
.payments-table,
.journal-table,
table.data {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.85rem;
}
.admin-table { min-width: 720px; }
.payments-table { min-width: 860px; }

.admin-table th,
.payments-table th,
.journal-table th,
table.data th {
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.admin-table td,
.payments-table td,
.journal-table td,
table.data td {
  padding: 0.7rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td,
.payments-table tbody tr:last-child td,
.journal-table tbody tr:last-child td,
table.data tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td,
.payments-table tbody tr:hover td,
.journal-table tbody tr:hover td,
table.data tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table code,
.payments-table code,
table.data code {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent-2);
}

.col-id,
.col-concept { text-align: left; }
.col-num,
.col-date,
.col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  white-space: nowrap;
}
.col-date { color: var(--muted); font-weight: 400; }
.col-money { font-weight: 500; }

th.col-num,
th.col-date,
th.col-money {
  font-family: var(--font);
  color: #9ca3af;
}

/* ── Tabla comparativa (landing) ── */
.comparison-table-wrap { max-width: 920px; margin: 2rem auto 0; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: center; }
.comparison-table thead th { background: var(--card-bg); padding: 1rem 0.7rem; border-bottom: 2px solid var(--border); font-weight: 700; }
.comparison-table thead th:first-child { text-align: left; padding-left: 1rem; }
.comparison-table .comp-prod { color: var(--accent-2); }
.comparison-table .comp-highlight { background: rgba(var(--accent-rgb), 0.08); }
.comparison-table thead .comp-highlight { border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--accent-2); }
.comparison-table tbody td { padding: 0.7rem 0.7rem; border-bottom: 1px solid var(--border); }
.comparison-table tbody td:first-child { text-align: left; padding-left: 1rem; font-weight: 500; color: var(--muted); }
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table .product-icon { font-size: 1.2rem; display: block; margin-bottom: 3px; }
.row-blocked td { opacity: 0.55; }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-lics-row td { background: var(--bg-soft); }
.admin-lic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
}
.admin-lic-info { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.admin-lic-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.admin-add-lic { margin-top: 0.9rem; }
.admin-add-lic select { flex: 0 1 10rem; min-width: 8rem; }
.admin-tab > .inline-form { margin-bottom: 0.9rem; }

/* ── Topbar acciones ───────────────────────────────────── */
.topbar-actions { display: flex; gap: 0.6rem; align-items: center; }

/* ── Landing pública ───────────────────────────────────── */
.landing { max-width: 1200px; margin: 0 auto; padding: 0 2rem 4rem; }
.landing-section { margin-top: 5rem; }
.landing-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 0.45rem;
}
.landing-sub { color: var(--muted); text-align: center; margin: 0 auto 2.1rem; max-width: 38rem; }

.landing-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.landing-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-step:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-2px);
}
.landing-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0.8rem 0 0.35rem;
  letter-spacing: -0.02em;
}
.landing-step p { color: var(--muted); font-size: 0.83rem; margin: 0; line-height: 1.5; }

.landing-pricing { margin-top: 0; }
.plan-perks { list-style: none; padding: 0; margin: 0 0 1rem; }
.plan-perks li { font-size: 0.8rem; color: var(--muted); padding: 0.22rem 0; }
.landing-note { text-align: center; margin-top: 1.4rem; max-width: 46rem; margin-left: auto; margin-right: auto; }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-feat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-feat:hover {
  border-color: rgba(var(--accent2-rgb), 0.35);
  transform: translateY(-2px);
}
.landing-feat .feat-mark {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.15rem;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
}
.landing-feat h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin: 0.75rem 0 0.3rem;
  letter-spacing: -0.02em;
}
.landing-feat p { color: var(--muted); font-size: 0.82rem; margin: 0; line-height: 1.5; }

.landing-faq { max-width: 720px; margin-left: auto; margin-right: auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 0.65rem;
  background: var(--card);
}
.faq-item h3 { font-size: 0.95rem; margin: 0 0 0.35rem; }
.faq-item p { color: var(--muted); font-size: 0.86rem; margin: 0; }

.landing-cta {
  margin-top: 5rem;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.landing-cta .landing-eyebrow { margin-bottom: 0.6rem; }
.landing-cta h2 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}
.landing-cta button { margin-top: 1.35rem; padding: 0.9rem 2.4rem; font-size: 1rem; }

/* ── Canales públicos ──────────────────────────────────── */
#public-channel-list { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.public-channel { cursor: default; }
.public-channel:hover { transform: none; border-color: var(--border); }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 2rem 1rem 1.6rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.footer a,
.hint a,
.legal-nav a,
.help-nav a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 500;
}
.footer a:hover,
.hint a:hover,
.legal-nav a:hover,
.help-nav a:hover {
  color: var(--text);
}

/* ── Scrollbars ────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

/* ── Suscripciones / historial de pagos ─────────────────── */
.subscription-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.subscription-row:hover { border-color: var(--accent); }
.sub-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.sub-icon { font-size: 1.5rem; flex-shrink: 0; }
.sub-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.sub-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
  word-break: break-word;
}
.sub-meta code {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.subscription-row .btn-manage-sub {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Tabla historial de pagos ───────────────────────────── */
.payments-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.payments-table .pay-id {
  font-size: 0.72rem;
  font-family: var(--mono);
  word-break: break-all;
}
.pay-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.pay-kind-sub { background: rgba(79, 70, 229, 0.14); color: #a5b4fc; }
.pay-kind-pay { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.pay-st-active { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pay-st-expired { background: rgba(148, 163, 184, 0.14); color: var(--muted); }
.pay-st-pending { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.pay-st-failed { background: rgba(248, 113, 113, 0.14); color: var(--error); }
.pay-actions {
  vertical-align: middle;
}
.pay-actions-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-height: 100%;
}
.pay-actions .btn-secondary,
.pay-actions .btn-danger {
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
}

.notify-admin-grid {
  display: grid;
  gap: 1.25rem;
}
.notify-admin-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
}
.notify-admin-block h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.notify-admin-block label { display: block; margin-bottom: 0.55rem; font-size: 0.85rem; }
.notify-admin-block input[type="text"],
.notify-admin-block input[type="email"],
.notify-admin-block input[type="password"],
.notify-admin-block input[type="number"],
.notify-admin-block textarea {
  width: 100%;
  margin-top: 0.25rem;
}
#ns-tg-token,
#ns-smtp-pass,
#ns-vapid-public {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--key-fg);
  letter-spacing: 0.01em;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}
.form-grid > .check-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  grid-column: 1 / -1;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.notify-prefs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.notify-sub { margin: 0 0 0.5rem; font-size: 0.9rem; }
@media (max-width: 720px) {
  .form-grid, .form-grid-2, .notify-prefs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .payments-table { min-width: 0; }
  .payments-table thead { display: none; }
  .payments-table,
  .payments-table tbody,
  .payments-table tr,
  .payments-table td { display: block; width: 100%; }
  .payments-table tr {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
  }
  .payments-table td {
    border: none;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
    font-family: inherit;
  }
  .payments-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
  }
  .pay-actions-inner { justify-content: flex-end; }
}

/* ── Productos: lista + página de configuración (admin) ── */
.admin-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.admin-toolbar h3 { margin: 0 0 0.15rem; font-size: 1.05rem; font-weight: 700; }
.admin-toolbar .hint { margin: 0; }
.admin-toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.prod-list { display: flex; flex-direction: column; gap: 0.6rem; }
.prod-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  transition: border-color 0.15s, background 0.15s;
}
.prod-row:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.prod-row.is-disabled { opacity: 0.6; }
.prod-main { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.prod-icon {
  width: 2.4rem; height: 2.4rem; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
}
.prod-info { min-width: 0; }
.prod-name { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.prod-meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.15rem; }
.prod-meta code { font-size: 0.72rem; }
.prod-price { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.prod-price .prod-per { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.prod-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.status-dot.off { background: #6b7280; }
.prod-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.tag {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.42rem; border-radius: 999px;
}
.tag-core { background: rgba(148, 163, 184, 0.18); color: var(--muted); }
.tag-offer { background: rgba(52, 211, 153, 0.16); color: var(--ok); }

/* Página de configuración */
.cfg-card { padding: 0; overflow: hidden; }
.cfg-section { padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--border); }
.cfg-section:last-of-type { border-bottom: none; }
.cfg-section h3 { margin: 0 0 0.9rem; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cfg-actions {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  padding: 1rem 1.3rem; background: var(--bg-soft); border-top: 1px solid var(--border);
}
.cfg-label { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }
.pe-check-group { display: flex; flex-direction: column; }
.pe-check-group .pe-check { display: inline-flex; margin-right: 1rem; }

.admin-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.admin-block h3 { margin: 0 0 0.4rem; font-size: 0.98rem; font-weight: 700; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.field-grid label {
  display: flex; flex-direction: column; gap: 0.28rem;
  font-size: 0.76rem; color: var(--muted); font-weight: 600;
}
.field-grid label.col-2 { grid-column: span 2; }
.field-grid label.col-3 { grid-column: 1 / -1; }
.field-grid label.pe-check {
  flex-direction: row; align-items: center; gap: 0.4rem;
  align-self: end; padding: 0.4rem 0;
}
.field-grid label.pe-check input { width: auto; }
.field-grid input,
.field-grid textarea {
  width: 100%;
}

/* ── Responsive ────────────────────────────────────────── */

/* Tablet — ≤960px */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 1.25rem; }
  .hero-title { max-width: none; }
  .hero-terminal { max-width: 100%; }
  .landing { padding: 0 1.25rem 2.5rem; }
  .landing-steps { grid-template-columns: 1fr 1fr; }
  .landing-features { grid-template-columns: 1fr 1fr; }
  .auth-hero { text-align: left; }
  .span-7, .span-5 { grid-column: span 12; }
  .steps-strip { grid-template-columns: 1fr; }
  .dash-tabs { top: 56px; }
  .dash-tabs button { font-size: 0.82rem; padding: 0.55rem 0.75rem; }
  .page { padding: 1.25rem; }
  .topbar { padding: 0.7rem 1.25rem; }
  .topbar .brand-name { font-size: 1rem; }
  .topbar-actions { gap: 0.35rem; }
  .topbar-actions button { font-size: 0.8rem; padding: 0 0.7rem; }
}

/* Teléfono grande — ≤720px */
@media (max-width: 720px) {
  .topbar { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .topbar .brand { gap: 0.4rem; }
  .topbar .brand-name { font-size: 0.95rem; }
  .topbar .brand-mark svg { width: 24px; height: 24px; }
  .topbar-actions { gap: 0.3rem; }
  .topbar-actions button { font-size: 0.76rem; padding: 0 0.6rem; border-radius: 8px; }
  .license-store { grid-template-columns: 1fr 1fr; }
  .channel-row-top { flex-wrap: wrap; }
  .channel-row-actions { width: 100%; justify-content: flex-end; }
  #public-channel-list { grid-template-columns: 1fr; }
  .channel-row { flex-direction: column; align-items: stretch; }
  .channel-row-actions { justify-content: flex-start; }
  #license-list { grid-template-columns: 1fr; }
  .page { padding: 1rem; }
  .page-head h1 { font-size: 1.35rem; }
  .dash-grid { gap: 0.8rem; }
  .steps-strip li { padding: 0.7rem 0.9rem; }
  .steps-strip strong { font-size: 0.82rem; }
  .steps-strip .step-n { width: 30px; height: 30px; font-size: 0.8rem; }
  .inline-form { flex-direction: column; }
  .inline-form input { flex: none; min-width: 0; }
  .inline-form button { width: 100%; }
  .subscription-row { flex-direction: column; align-items: flex-start; }
  .subscription-row .btn-manage-sub { align-self: flex-end; }
  .channel-row-actions button { flex: 1 1 auto; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid label.col-2 { grid-column: 1 / -1; }
  /* Lista de productos: apilar en móvil */
  .prod-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main price" "status status" "actions actions";
    row-gap: 0.6rem;
  }
  .prod-main { grid-area: main; }
  .prod-price { grid-area: price; text-align: right; }
  .prod-status { grid-area: status; }
  .prod-actions { grid-area: actions; justify-content: flex-start; }
  .prod-actions button { flex: 1; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar-actions button { flex: 1; }
  .cfg-actions { flex-direction: column-reverse; }
  .cfg-actions button { width: 100%; }
}

/* Teléfono pequeño — ≤480px */
@media (max-width: 480px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.8rem;
    gap: 0.5rem;
  }
  .topbar .brand {
    justify-content: center;
  }
  .topbar .brand-name { font-size: 0.85rem; }
  .topbar .brand-mark svg { width: 22px; height: 22px; }
  .topbar-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .topbar-actions button {
    font-size: 0.72rem;
    padding: 0 0.55rem;
    flex: 0 1 auto;
  }
  .dash-tabs {
    top: auto;
    position: relative;
    gap: 0.25rem;
    padding: 0.25rem;
  }
  .dash-tabs button {
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.78rem;
    padding: 0.5rem 0.4rem;
  }
  .hero-title { font-size: 1.5rem; }
  .hero-sub { font-size: 0.9rem; }
  .hero-trust { gap: 0.4rem; }
  .hero-terminal { max-width: 100%; }
  .license-store { grid-template-columns: 1fr; }
  .license-product-card { padding: 1rem; }
  .license-product-card h4 { font-size: 0.95rem; }
  .landing-steps { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-title { font-size: 1.25rem; }
  .card { padding: 1rem; }
  .card-head h2 { font-size: 0.95rem; }
  .log-header { flex-direction: column; align-items: flex-start; }
  .log-header > * { width: 100%; }
  .log-title-wrap h2 { font-size: 1rem; }
  .auth-card { padding: 1.25rem; }
  .auth-card h2 { font-size: 1.1rem; }
  .tabs button { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
  .admin-tabs { gap: 0.3rem; }
  .admin-tabs button { font-size: 0.72rem; padding: 0.45rem 0.6rem; }
  .admin-table { font-size: 0.75rem; }
  .subscription-row { padding: 0.7rem 0.8rem; }
  .sub-info strong { font-size: 0.85rem; }
  .sub-meta { font-size: 0.72rem; }
  .btn-block { font-size: 0.85rem; padding: 0 0.65rem; }
  #api-key-display { font-size: 0.72rem; padding: 0 0.7rem; }
  .ws-hint { font-size: 0.68rem; padding: 0.5rem 0.7rem; }
  .pill { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
  .publish-pricing-grid { grid-template-columns: 1fr; }
  .finance-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Publicar canal (copy trading) ─────────────────────── */
.publish-form { max-width: 720px; }
.publish-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.publish-section:last-of-type { border-bottom: none; margin-bottom: 1rem; }
.publish-section h3 {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.publish-form label { margin-bottom: 1rem; }
.publish-form textarea {
  min-height: 120px;
}
.publish-id-row { margin-top: 0.35rem; }
.publish-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.publish-id-ok { color: var(--ok) !important; }
.publish-id-bad { color: var(--error) !important; }
.channel-pricing-summary {
  color: var(--accent-2) !important;
  font-weight: 600;
}

/* ── Finanzas admin ────────────────────────────────────── */
.finance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-soft, rgba(255, 255, 255, 0.03));
}
.finance-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
}
.finance-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 9rem;
}
.finance-filters select,
.finance-filters input.finance-date,
.finance-date {
  color-scheme: dark;
  min-height: var(--control-h, 2.35rem);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--bg, #0f141c);
  color: var(--text, #f3f5f8);
  font-size: 0.9rem;
  font-family: inherit;
}
.finance-filters select:focus,
.finance-date:focus {
  outline: 2px solid rgba(var(--accent-rgb, 96, 165, 250), 0.45);
  outline-offset: 1px;
}
.finance-date::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  opacity: 0.9;
  cursor: pointer;
}
.finance-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.btn-finance-export,
.finance-exports .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h, 2.35rem);
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong, var(--border));
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-finance-export:hover,
.finance-exports .btn-secondary:hover {
  background: rgba(var(--accent-rgb, 96, 165, 250), 0.14);
  border-color: var(--accent, #60a5fa);
  color: var(--text);
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.finance-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.finance-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.finance-value {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.aff-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.aff-link-row #aff-url {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--key-fg);
  overflow-wrap: anywhere;
  word-break: break-all;
  min-width: 0;
}

@media (max-width: 720px) {
  .finance-grid { grid-template-columns: 1fr; }
  .finance-toolbar { flex-direction: column; align-items: stretch; }
  .finance-filters label { min-width: 0; flex: 1 1 42%; }
}

/* ═══════════════════════════════════════════════════════════
   Directorio de canales públicos (copy trading)
   ═══════════════════════════════════════════════════════════ */

.canales-shell { padding-top: 0.85rem; }
.canales-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  max-width: none;
}
.canales-tabs button {
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
}
.canales-subtab .card-head { margin-top: 0.25rem; }
.pub-capital-note {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}
.pub-stat-sub {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.25;
}
.pub-card-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.pub-card-ctas button { margin: 0; }

.pnl-up { color: var(--pnl-up); }
.pnl-down { color: var(--pnl-down); }

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.4rem;
}
.pub-search {
  flex: 1;
  min-width: 200px;
  margin: 0;
}
.pub-filter-group { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.pub-filter-group button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}
.pub-filter-group button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.pub-filter-group button.active { background: var(--accent); color: #fff; }
.pub-sort-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.pub-sort-label select {
  width: auto;
  margin: 0;
  min-width: 10rem;
}

.pub-grid {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.pub-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1rem;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pub-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pub-card-top { display: flex; align-items: center; gap: 0.7rem; }
.pub-avatar {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 600; font-size: 0.95rem; letter-spacing: -0.02em;
  color: #fff;
  background: var(--grad);
}
.pub-avatar.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.2rem; border-radius: 16px; }
.pub-id-wrap { flex: 1; min-width: 0; }
.pub-name { margin: 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-owner { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.pub-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.3rem; flex: 0 0 auto; }

.pub-share-btn {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: none;
  font-weight: 500;
  filter: none;
}
.pub-share-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  filter: none;
}
.pub-share-btn svg { display: block; }
.pub-badge,
.pub-live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.16rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.pub-badge.is-public {
  color: var(--accent-2);
  border-color: rgba(var(--accent2-rgb), 0.28);
  background: rgba(var(--accent2-rgb), 0.12);
}
.pub-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pub-live.on {
  color: var(--pnl-up);
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.12);
}
.pub-live.on .dot { background: var(--pnl-up); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.pub-card-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.85rem; padding: 0.15rem 0 0.1rem; }
.pub-roi { display: flex; flex-direction: column; min-width: 0; }
.pub-roi-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.pub-roi-value {
  font-family: var(--mono);
  font-size: clamp(1.7rem, 2.4vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.pub-spark { width: 148px; height: 52px; flex: 0 0 148px; color: var(--muted); }
.spark { display: block; width: 100%; height: 100%; overflow: visible; }

.pub-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
  background: none;
}
.pub-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0 0.7rem;
  border-right: 1px solid var(--border);
}
.pub-stat:first-child { padding-left: 0; }
.pub-stat:last-child { border-right: none; padding-right: 0; }
.pub-stat span { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
.pub-stat strong { font-family: var(--mono); font-size: 0.88rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.pub-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pub-chips-empty { color: var(--muted); font-size: 0.78rem; }
.instr-chip {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  color: var(--accent-2);
  background: rgba(var(--accent2-rgb), 0.1);
  border: 1px solid rgba(var(--accent2-rgb), 0.28);
  padding: 0.14rem 0.5rem; border-radius: 6px;
}
.pub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; }
.pub-followers { font-size: 0.76rem; color: var(--muted); }
.pub-followers-n { color: var(--text); font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pub-card-foot button { font-size: 0.8rem; padding: 0 0.9rem; white-space: nowrap; height: var(--control-h); }
.btn-copy-card { background: rgba(52, 211, 153, 0.13); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.4); box-shadow: none; filter: none; }
.btn-copy-card:hover { background: rgba(52, 211, 153, 0.22); box-shadow: none; filter: none; }

/* ── Ficha del canal ─────────────────────────────────────── */
#channel-profile-page .page { max-width: 1200px; }
.profile-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1rem; }
.profile-summary { grid-column: 1 / -1; }
.profile-summary-head { display: flex; align-items: center; gap: 0.9rem; }
.profile-summary-head .profile-head-text { flex: 1; min-width: 0; }
.profile-summary-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.02em; }
.profile-desc { margin: 0.6rem 0 0; }
.profile-window-tabs { display: inline-flex; gap: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; margin: 0.9rem 0; }
.profile-window-tabs button { border: none; background: transparent; color: var(--muted); font-weight: 500; font-size: 0.8rem; padding: 0.35rem 0.95rem; border-radius: 6px; cursor: pointer; box-shadow: none; }
.profile-window-tabs button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.profile-window-tabs button.active { background: var(--accent); color: #fff; }
.profile-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; }
.kpi { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.15rem; }
.kpi span { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
.kpi strong { font-family: var(--mono); font-size: 1.05rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi.big { grid-column: span 2; }
.kpi.big strong { font-size: 1.7rem; font-weight: 500; }
.profile-allnote { margin-top: 0.75rem; }
.profile-banner { margin-top: 0.85rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.85rem; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.profile-banner.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.07); }
.profile-banner.owner { color: var(--accent-2); border-color: rgba(var(--accent2-rgb), 0.4); background: rgba(var(--accent2-rgb), 0.07); }
.profile-cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.profile-cta-row button { font-size: 0.85rem; }

.curve { display: block; width: 100%; }
.profile-curve-card, .profile-journal-card { grid-column: 1 / -1; }

.donut-wrap { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.donut { flex: 0 0 auto; }
.donut-center-n { fill: var(--text); font-size: 1.3rem; font-weight: 500; font-family: var(--mono); }
.donut-center-l { fill: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 0.4rem; }
.donut-legend li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.donut-legend .instr-name { font-family: var(--mono); font-weight: 600; color: var(--text); }
.donut-legend .instr-meta { color: var(--muted); font-size: 0.76rem; margin-left: auto; }

.journal-table { width: 100%; }
.journal-table .jr-date { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.journal-table .pnl-up,
.journal-table .pnl-down { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.journal-note { margin-top: 0.6rem; }
.dir-tag { font-size: 0.625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.12rem 0.4rem; border-radius: var(--radius-sm); }
.dir-long { color: var(--pnl-up); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.22); }
.dir-short { color: var(--pnl-down); background: rgba(251, 113, 133, 0.10); border: 1px solid rgba(251, 113, 133, 0.22); }

.live-locked { text-align: center; padding: 1.4rem 1rem; color: var(--muted); }
.live-locked .lock-ico { font-size: 1.6rem; display: block; margin-bottom: 0.4rem; }
.live-pos { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.live-pos:last-child { border-bottom: none; }
.live-pos-main { display: flex; align-items: center; gap: 0.5rem; }
.live-pos-main strong { font-family: var(--mono); font-size: 0.9rem; }
.live-qty { color: var(--muted); font-size: 0.82rem; }
.live-pos-prices { display: flex; gap: 0.9rem; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.live-pos-prices b { color: var(--text); font-family: var(--mono); }
.live-pos-prices .sl b { color: var(--error); }
.live-pos-prices .tp b { color: var(--ok); }
.price-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.12em;
}
.price-locked svg { flex: 0 0 auto; opacity: 0.8; }
.live-entry-hint { margin: 0.65rem 0 0; }

/* ── Modal compartir canal ─────────────────────────────── */
.share-modal-panel {
  width: min(440px, 100%);
  padding: 1.1rem 1.15rem 1.2rem;
  max-height: min(92vh, 960px);
  overflow-y: auto;
}
.share-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.share-modal-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.share-preview-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #09090b;
}
#share-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
}
.share-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 1rem;
}
.share-act {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0.15rem;
  height: auto;
  min-height: 0;
  filter: none;
  box-shadow: none;
}
.share-act:hover { color: var(--text); filter: none; background: transparent; }
.share-act-ico {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.share-act:hover .share-act-ico { background: rgba(255, 255, 255, 0.1); border-color: var(--border-strong); }
.share-act-tg { background: #229ed9; border-color: #229ed9; color: #fff; }
.share-act:hover .share-act-tg { background: #1c8ec4; border-color: #1c8ec4; }

/* ── Modal método de pago + página crypto ── */
.pay-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.pay-modal.hidden { display: none; }
.pay-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(4px);
}
.pay-modal-panel {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.pay-modal-panel h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.pay-method-grid { display: flex; flex-direction: column; gap: 0.55rem; margin: 1rem 0 0.75rem; }
.pay-method-btn {
  display: flex; align-items: flex-start; gap: 0.75rem;
  text-align: left; width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-method-btn:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }
.pay-method-btn .pm-ico { font-size: 1.35rem; line-height: 1; }
.pay-method-btn strong { display: block; font-size: 0.95rem; }
.pay-method-btn span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.pay-token-row { display: flex; gap: 0.5rem; margin-top: 0.55rem; align-items: center; }
.pay-token-row button {
  flex: 1;
  height: var(--control-h);
  padding: 0 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  filter: none;
}
.pay-token-row button:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.08); filter: none; }
.pay-modal-cancel { width: 100%; margin-top: 0.25rem; }

/* ── Diálogo UI (reemplazo de alert/confirm) ── */
.ui-dialog-panel { width: min(440px, 100%); }
.ui-dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.ui-dialog-head h3 { margin: 0; font-size: 1.1rem; }
.ui-dialog-message {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ui-dialog-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end;
}
.ui-dialog-actions .btn-danger,
.ui-dialog-actions .btn-secondary,
.ui-dialog-actions button[type="button"] {
  min-height: var(--control-h, 2.25rem);
  padding: 0 0.95rem;
}
.ui-dialog-modal--danger #ui-dialog-title { color: #c45c5c; }
.ui-dialog-modal--success #ui-dialog-title { color: #3d9a6a; }

.crypto-pay-body-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.crypto-pay-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.crypto-pay-amount {
  font-size: 1.75rem; font-weight: 800; font-family: var(--mono);
  margin: 0.4rem 0 0.15rem;
}
.crypto-pay-network { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.crypto-qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  margin: 1rem 0;
}
.crypto-qr-wrap img {
  width: 200px; height: 200px; border-radius: 10px;
  background: #fff; padding: 8px; border: 1px solid var(--border);
}
.crypto-wallet {
  width: 100%;
  justify-content: center;
  text-align: center;
  margin: 0;
}
.crypto-pay-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; justify-content: center; }
.crypto-countdown { font-size: 0.85rem; color: var(--muted); margin-top: 0.85rem; }
.crypto-poll-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.crypto-paid-banner {
  padding: 0.85rem 1rem; border-radius: 10px;
  background: rgba(52, 211, 153, 0.12); color: var(--ok);
  font-weight: 600; margin-bottom: 0.75rem;
}

/* ── Estado Stripe Connect / KYC ── */
.connect-status-card {
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.connect-status-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}
.connect-phase-pill {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}
.connect-payout-flag {
  font-size: 0.78rem; font-weight: 600;
}
.connect-payout-flag.ok { color: var(--ok, #3d9a6a); }
.connect-payout-flag.off { color: var(--muted); }
.connect-phase-detail { margin: 0.25rem 0 0.5rem; font-size: 0.9rem; line-height: 1.4; }
.connect-req-block {
  margin: 0.65rem 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
}
.connect-req-block.eventual { opacity: 0.95; }
.connect-req-block strong { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; }
.connect-req-list {
  margin: 0.2rem 0 0.45rem; padding-left: 1.1rem;
  font-size: 0.88rem;
}
.connect-req-list li { margin: 0.2rem 0; }
.connect-actions { margin-top: 0.75rem; }

.connect-phase-ready {
  border-color: rgba(61, 154, 106, 0.45);
  background: rgba(61, 154, 106, 0.08);
}
.connect-phase-ready .connect-phase-pill {
  color: #3d9a6a; border-color: rgba(61, 154, 106, 0.4);
}
.connect-phase-eventual_kyc {
  border-color: rgba(212, 168, 75, 0.45);
  background: rgba(212, 168, 75, 0.08);
}
.connect-phase-eventual_kyc .connect-phase-pill {
  color: #d4a84b; border-color: rgba(212, 168, 75, 0.4);
}
.connect-phase-under_review {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.08);
}
.connect-phase-under_review .connect-phase-pill {
  color: #60a5fa; border-color: rgba(96, 165, 250, 0.4);
}
.connect-phase-pending_onboarding,
.connect-phase-not_started {
  border-color: var(--border);
}
.connect-phase-action_required,
.connect-phase-restricted {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.08);
}
.connect-phase-action_required .connect-phase-pill,
.connect-phase-restricted .connect-phase-pill {
  color: #f87171; border-color: rgba(248, 113, 113, 0.45);
}

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .kpi.big { grid-column: span 2; }
}
@media (max-width: 520px) {
  .pub-grid { grid-template-columns: 1fr; }
  .pub-stats-row { grid-template-columns: repeat(2, 1fr); row-gap: 0.55rem; }
  .pub-stat { border-right: none; padding: 0.15rem 0.5rem 0.15rem 0; }
  .pub-stat:nth-child(odd) { padding-right: 0.7rem; border-right: 1px solid var(--border); }
  .pub-toolbar { flex-direction: column; align-items: stretch; }
  .pub-spark { width: 120px; height: 44px; flex-basis: 120px; }
  .pub-roi-value { font-size: 1.65rem; }
  .channel-row-summary { display: none; }
}

/* ── Ayuda contextual (i) ──────────────────────────────── */
.card-head h2 { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
a.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: var(--control-h);
  padding: 0 1.1rem;
  border-radius: var(--radius-sm);
}
.help-i {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 !important;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(79, 70, 229, 0.18) !important;
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font);
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  box-shadow: none;
  filter: none;
}
.help-i:hover, .help-i:focus {
  background: rgba(79, 70, 229, 0.32) !important;
  color: #fff;
  filter: none;
}
.help-popover {
  position: fixed;
  z-index: 90;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.75rem 0.85rem;
  background: #18181b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}
.help-popover strong { display: block; margin-bottom: 0.35rem; }
.help-popover p { margin: 0 0 0.4rem; color: var(--muted); overflow-wrap: anywhere; }
.help-popover-hint { font-size: 0.72rem; color: var(--accent-2); }
.help-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
}
.help-sheet.hidden { display: none !important; }
.help-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9,9,11,0.72);
}
.help-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 28rem);
  overflow: auto;
  background: #0c0c0f;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
}
.help-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.help-sheet-head h3 { margin: 0; font-size: 1.05rem; }
.help-sheet-text { color: var(--muted); margin: 0 0 1rem; overflow-wrap: anywhere; }
.help-sheet-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-2);
}
.legal-admin-grid { display: grid; gap: 1rem; }
@media (min-width: 861px) {
  .legal-admin-grid { grid-template-columns: 1fr 1fr; }
  .help-sheet-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(28rem, calc(100vw - 2rem));
    max-height: 80vh;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
  }
}
.legal-preview {
  max-height: 16rem;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 0.82rem;
}
.legal-preview h1 { font-size: 1.1rem; }
.legal-preview h2 { font-size: 0.95rem; }

.addon-downloads {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}
.addon-dl-head h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.addon-dl-grid { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.75rem; }
.addon-dl-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  min-width: 0;
}
.addon-dl-card.is-locked { opacity: 0.72; }
.addon-dl-card .font-mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.78rem; }
.addon-dl-card button { min-height: 44px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.15rem;
  background: rgba(255,255,255,0.04);
}
.lang-switch button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #a1a1aa);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch button.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Health de servicios (Conexión) ─────────────────────── */
.health-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.2rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.health-item:last-child { border-bottom: none; }
.health-name { font-size: 0.84rem; color: var(--muted); }
.health-dot {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}
.health-dot.ok {
  color: #34d399;
  background: rgba(5, 150, 105, 0.14);
}
.health-dot.fail {
  color: var(--error);
  background: rgba(248, 113, 113, 0.12);
}
.health-updated { margin: 0.45rem 0 0; }

/* ── Ayuda y legales in-app ─────────────────────────────── */
.help-layout {
  display: grid;
  gap: 1.1rem;
  margin-top: 0.75rem;
}
@media (min-width: 861px) {
  .help-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .help-toc { position: sticky; top: 1rem; }
}
.help-toc {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}
.help-toc a,
.help-toc button.help-toc-link {
  display: block;
  width: 100%;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  padding: 0.45rem 0.35rem;
  min-height: 44px;
  height: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.help-toc a:hover,
.help-toc a:focus,
.help-toc button.help-toc-link:hover,
.help-toc button.help-toc-link:focus {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.help-search { width: 100%; margin: 0 0 0.75rem; }
.help-article { min-width: 0; }
.help-section { margin-bottom: 1.75rem; scroll-margin-top: 1rem; }
.help-section h2 { font-size: 1.1rem; margin: 0 0 0.55rem; }
.help-section p,
.help-section li { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.help-hidden { display: none !important; }
.help-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  min-width: 0;
}
.help-page h1 { font-size: 1.6rem; margin: 0.35rem 0 0.5rem; }
.legal-doc {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.legal-doc h1 { font-size: 1.45rem; color: var(--text); margin: 0 0 0.6rem; }
.legal-doc h2 { font-size: 1.05rem; color: var(--text); margin: 1.5rem 0 0.5rem; }
.legal-doc .meta { font-size: 0.85rem; opacity: 0.85; }
.legal-nav, .help-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
  .license-store { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


