/* =============================================================
   1. Tokens — oscuro siempre; claro solo si el usuario lo elige en Ajustes
   ============================================================= */
:root {
  color-scheme: dark;
  --bg: #09090b; --surface: #111113; --surface-2: #18181b; --line: #222226; --line-strong: #303036;
  --tx: #ededf0; --mu: #97979f; --mu-2: #6c6c75;
  --accent: #6d67f2; --accent-hover: #7f7af5; --accent-soft: rgba(109, 103, 242, .14); --accent-tx: #ffffff;
  --ok: #46c98f; --ok-soft: rgba(70, 201, 143, .12); --warn: #d9a93f; --warn-soft: rgba(217, 169, 63, .12); --err: #f26d6d; --err-soft: rgba(242, 109, 109, .12);
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 8px; --r: 10px; --r-lg: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
/* Los dos bloques siguientes son idénticos: «claro» elegido a mano, y «como el sistema» en un sistema claro. */
:root[data-tema=claro] {
  --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f1f1f4; --line: #e5e5ea; --line-strong: #d2d2da;
  --tx: #15151a; --mu: #6a6a76; --mu-2: #8e8e9a;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: rgba(79, 70, 229, .09); --accent-tx: #ffffff;
  --ok: #0f7b56; --ok-soft: #e4f4ec; --warn: #8f5f00; --warn-soft: #fdf3d7; --err: #c22b2b; --err-soft: #fdeaea;
  --shadow-sm: 0 1px 2px rgba(18, 18, 30, .05); --shadow: 0 1px 2px rgba(18, 18, 30, .04), 0 10px 30px -12px rgba(18, 18, 30, .12); --shadow-lg: 0 24px 60px -20px rgba(18, 18, 30, .28);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-tema=sistema] {
    --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f1f1f4; --line: #e5e5ea; --line-strong: #d2d2da;
    --tx: #15151a; --mu: #6a6a76; --mu-2: #8e8e9a;
    --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: rgba(79, 70, 229, .09); --accent-tx: #ffffff;
    --ok: #0f7b56; --ok-soft: #e4f4ec; --warn: #8f5f00; --warn-soft: #fdf3d7; --err: #c22b2b; --err-soft: #fdeaea;
    --shadow-sm: 0 1px 2px rgba(18, 18, 30, .05); --shadow: 0 1px 2px rgba(18, 18, 30, .04), 0 10px 30px -12px rgba(18, 18, 30, .12); --shadow-lg: 0 24px 60px -20px rgba(18, 18, 30, .28);
    color-scheme: light;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--tx);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; font-feature-settings: "cv11", "ss01"; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 650; line-height: 1.15; letter-spacing: -0.022em; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-tx); }

/* =============================================================
   3. Utilities
   ============================================================= */
.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.mu { color: var(--mu); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.enlace { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.enlace:hover { text-decoration-color: currentColor; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--tx); color: var(--bg); z-index: 99; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.etiqueta { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); }

/* =============================================================
   4. Components
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r);
  font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .15s var(--ease-out); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-tx); border-color: transparent; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: none; border-color: transparent; box-shadow: none; color: var(--mu); }
.btn-ghost:hover { background: var(--surface-2); color: var(--tx); }
.btn-block { width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-cab h2 { font-size: 15px; letter-spacing: -0.01em; }
.card.sin-relleno { padding: 0; overflow: hidden; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--mu); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.demo-badge { display: inline-flex; padding: 6px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; background: var(--warn-soft); color: var(--warn); }

.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 6px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; margin-right: auto; }
.logo img { width: 24px; height: 24px; border-radius: 6px; }
.logo span { color: var(--mu); font-weight: 600; }
.nav a:not(.btn):not(.logo) { color: var(--mu); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: var(--r-sm); }
.nav a:not(.btn):not(.logo):hover { color: var(--tx); background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-weight: 500; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--mu); margin-right: 6px; }
.pill b { color: var(--tx); font-weight: 650; }
.pill::before { content: ""; width: 15px; height: 15px; flex: none; background: linear-gradient(135deg, #c4b5fd, var(--accent));
  -webkit-mask: var(--rayo) center / contain no-repeat; mask: var(--rayo) center / contain no-repeat; filter: drop-shadow(0 0 5px var(--accent));
  --rayo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.6 1.6 3.9 13.3c-.5.6-.1 1.5.7 1.5h5.9l-1.3 7c-.2.9 1 1.4 1.6.7l9.7-11.8c.5-.6.1-1.5-.7-1.5h-5.8l1.3-6.9c.2-.9-1-1.400-1.600-.7z'/%3E%3C/svg%3E"); }
.pill { padding-left: 10px; transition: border-color .15s; }
.pill:hover { border-color: var(--accent); }
body:not(.con-sesion) .solo-sesion, body.con-sesion .solo-anon { display: none; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--mu); margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=url], select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; }
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.campo { margin-bottom: 14px; }

dialog { margin: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--tx);
  padding: 28px; width: min(420px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8, 8, 12, .55); backdrop-filter: blur(4px); }
dialog h2 { font-size: 20px; margin-bottom: 6px; }
dialog .cerrar { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: var(--r-sm); font-size: 20px; line-height: 1; color: var(--mu); }
dialog .cerrar:hover { background: var(--surface-2); color: var(--tx); }
.msg-error { color: var(--err); font-size: 13px; min-height: 1.4em; margin: 8px 0; }
.tarjeta-falsa { padding: 12px 14px; border-radius: var(--r); border: 1px dashed var(--line-strong); background: var(--surface-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--mu); margin: 14px 0; font-size: 13px; }

#avisos { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(480px, calc(100% - 32px)); }
.aviso { padding: 12px 16px; border-radius: var(--r); background: var(--tx); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--mu-2); animation: sube .3s var(--ease-out); }
.aviso.error { border-left-color: #ff6b6b; }
.aviso.ok { border-left-color: #46c98f; }
@keyframes sube { from { opacity: 0; transform: translateY(10px); } }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; padding: 10px 20px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--mu);
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .12s; }
.tabla tbody tr:hover { background: var(--surface-2); }
.tabla .der { text-align: right; }
.tabla td.num { font-weight: 600; }
.tabla .mas { color: var(--ok); }
.tabla-scroll { overflow-x: auto; }
.vacio { padding: 36px 20px; text-align: center; color: var(--mu); }

/* Selector de idioma */
.idioma { position: relative; display: inline-flex; align-items: center; margin: 0 4px 0 0; color: var(--mu); }
.idioma svg { position: absolute; left: 9px; pointer-events: none; }
.idioma select { height: 34px; width: auto; padding: 0 30px 0 32px; border-radius: 999px; border: 1px solid var(--line-strong); background-color: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--tx); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.idioma select:hover { border-color: var(--accent); background-color: var(--surface-2); }
.idioma:has(select:open) svg, .idioma:hover svg { color: var(--accent); }
.idioma svg { transition: color .15s; }
.idioma select option { color: var(--tx); background: var(--surface); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  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='%238e8e9a' stroke-width='3' 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 12px center; }

/* Ventanas: entran flotando y el fondo se desvanece */
dialog[open] { animation: flota .32s var(--ease-out); }
dialog[open]::backdrop { animation: aparece .25s ease-out; }
@keyframes flota { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes aparece { from { opacity: 0; } }
dialog.tiembla { animation: tiembla .36s; }
@keyframes tiembla { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.dlg-acceso { width: min(404px, calc(100% - 32px)); padding: 36px 32px 28px; border-radius: 20px; text-align: center; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 2px 4px rgba(18, 18, 30, .04), 0 30px 80px -24px rgba(18, 18, 30, .45); border: 0; }
.dlg-acceso > * { position: relative; }
.dlg-acceso .cerrar { position: absolute; }
.dlg-logo { width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 10px; }
.dlg-acceso h2 { font-size: 22px; letter-spacing: -0.03em; margin-bottom: 6px; }
.dlg-sub { font-size: 14px; margin-bottom: 20px; }
.dlg-acceso form { text-align: left; }
.dlg-pie { margin-top: 18px; line-height: 1.5; }
.segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: var(--r); background: var(--surface-2); margin-bottom: 20px; }
.segmento button { height: 32px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--mu); transition: background .2s, color .2s, box-shadow .2s; }
.segmento button[aria-selected=true] { background: var(--surface); color: var(--tx); box-shadow: 0 1px 2px rgba(18, 18, 30, .12), 0 0 0 1px var(--line); }
.con-boton { position: relative; }
.con-boton input { padding-right: 78px; }
.ver-clave { position: absolute; right: 6px; top: 6px; height: 28px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--mu); }
.ver-clave:hover { background: var(--surface-2); color: var(--tx); }
.btn.cargando { color: transparent; position: relative; }
.btn.cargando::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Ajustes */
.ajustes { display: grid; gap: 24px; align-items: start; }
.ajustes-nav { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ajustes-nav a { flex: none; padding: 7px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--mu); }
.ajustes-nav a:hover { background: var(--surface-2); color: var(--tx); }
.ajustes-nav a:last-child { color: var(--err); }
.adm-cred { display: inline-flex; gap: 6px; align-items: center; }
.adm-cred input { width: 92px; height: 32px; text-align: right; }
.adm-cifras { margin-bottom: 20px; }
.ajustes-cuerpo { display: grid; gap: 20px; min-width: 0; }
.ajustes-cuerpo > section { scroll-margin-top: 80px; }
.ajustes-cuerpo .pagina-cab, .ajustes-cuerpo .cuenta-datos { margin-bottom: 0; }
.card-cab p { margin-top: 2px; }
.card-cuerpo { padding: 20px; }
.card-fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--mu); }
.dos, .cuatro { display: grid; gap: 0 16px; }
.form-pie { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 4px; }
.form-pie .msg-error { margin: 0 auto 0 0; min-height: 0; }
.label { display: block; font-size: 13px; font-weight: 500; color: var(--mu); margin-bottom: 6px; }
.datos-tecnicos { display: grid; margin: 0; }
.datos-tecnicos > div { display: grid; gap: 2px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.datos-tecnicos > div:last-child { border-bottom: 0; }
.datos-tecnicos dt { color: var(--mu); }
.datos-tecnicos dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.peligro { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.btn-peligro { background: var(--err); color: #fff; border-color: transparent; }
.btn-peligro:hover { background: color-mix(in srgb, var(--err) 85%, #000); }

/* =============================================================
   5. Landing
   ============================================================= */
.hero { position: relative; padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }
.hero .wrap { position: relative; display: grid; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 62px); font-weight: 700; letter-spacing: -0.038em; line-height: 1.04; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: clamp(16px, 1.8vw, 19px); color: var(--mu); margin: 20px 0 28px; max-width: 33em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.movil { width: min(270px, 70vw); aspect-ratio: 9 / 16; margin-inline: auto; border-radius: 34px; border: 7px solid #17171c; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #3b2a6b, #14324a 55%, #0d1a16); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-strong); }
.movil-gancho { position: absolute; top: 14%; left: 8%; right: 8%; background: #fff; color: #111; font-family: "Montserrat", var(--sans); font-weight: 800;
  text-align: center; padding: 10px; border-radius: 12px; font-size: 16px; line-height: 1.2; }
.movil-cara { position: absolute; left: 50%; top: 46%; width: 44%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 38%, #f3c9a5 0 34%, #2a2f3c 35%); opacity: .9; }
.movil-subs { position: absolute; bottom: 20%; left: 0; right: 0; font-family: "Montserrat", var(--sans); font-weight: 900; font-size: 23px; color: #fff;
  text-transform: uppercase; text-shadow: 0 0 6px #000, 0 2px 0 #000; display: flex; justify-content: center; gap: 8px; }
.movil-subs span { animation: palabra 2.4s infinite; }
.movil-subs span:nth-child(2) { animation-delay: .8s; }
.movil-subs span:nth-child(3) { animation-delay: 1.6s; }
@keyframes palabra { 0%, 32% { color: #ffe14d; transform: scale(1.12); } 33%, 100% { color: #fff; transform: none; } }

section.bloque { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.bloque h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.03em; margin-bottom: 10px; }
.bloque > .wrap > p { color: var(--mu); max-width: 46em; margin-bottom: 32px; font-size: 16px; }
.grid-3 { display: grid; gap: 16px; }
.paso b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-size: 14px; margin-bottom: 14px; }
.paso h3, .plan h3 { font-size: 16px; margin-bottom: 6px; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; }
button.chip:hover { border-color: var(--accent); color: var(--accent); }

.sub-bloque { font-size: 18px; margin: 40px 0 14px; letter-spacing: -0.02em; }
.tabla.consumo td:first-child { font-weight: 600; }
.grid-planes { display: grid; gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 10px; padding: 24px; position: relative; }
.plan-etiqueta { position: absolute; top: -11px; left: 20px; background: var(--accent); color: var(--accent-tx); }
.plan.destacado { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.plan .precio { font-size: 38px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.plan .precio small { font-size: 14px; font-weight: 500; color: var(--mu); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; color: var(--mu); display: grid; gap: 8px; margin: 6px 0 12px; flex: 1; font-size: 14px; }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 15px; }
details p { color: var(--mu); margin-top: 10px; }

footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--mu); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
footer a:hover { color: var(--tx); }

.legal { padding: 48px 0; max-width: 720px; }
.legal h1 { font-size: 32px; margin-bottom: 20px; letter-spacing: -0.03em; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--mu); margin-bottom: 10px; }

/* =============================================================
   6. App
   ============================================================= */
.app { padding: 28px 0 80px; }
.pagina-cab { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.pagina-cab h1 { font-size: 24px; letter-spacing: -0.03em; }

.soltar { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); padding: clamp(36px, 8vw, 72px) 24px; text-align: center;
  transition: border-color .2s, background .2s; }
.soltar.encima { border-color: var(--accent); background: var(--accent-soft); }
.soltar-icono { width: 44px; height: 44px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.soltar h1 { font-size: clamp(20px, 3vw, 24px); margin-bottom: 8px; letter-spacing: -0.025em; }
.soltar p { color: var(--mu); margin: 0 auto 20px; max-width: 34em; }

.proyectos { margin-top: 28px; }
.proyectos > .etiqueta { margin-bottom: 10px; }
.proy { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.proy:last-child { border-bottom: 0; }
.proy-info { min-width: 0; grid-column: 1 / -1; }
.proy-info b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proy .badge { justify-self: start; }
.proy-acc { display: flex; gap: 6px; }

.estudio { display: grid; gap: 28px; align-items: start; }
.visor { position: relative; width: min(320px, 100%); margin-inline: auto; }
.visor canvas { width: 100%; height: auto; border-radius: 18px; background: #000; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-strong); }
.visor-barra { display: block; width: 100%; min-width: 0; margin: 14px 0 0; cursor: pointer; }
.visor-barra:disabled { opacity: .4; cursor: not-allowed; }
.visor-barra + .visor-ctrl { margin-top: 8px; }
.visor-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--mu); font-size: 13px; font-variant-numeric: tabular-nums; }
#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.panel { display: grid; gap: 18px; }
.panel fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 18px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.panel legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.panel legend + * { clear: both; }
.subetiqueta { font-size: 12px; font-weight: 500; color: var(--mu); margin: 0 0 8px; }
.opciones { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.opciones:last-child { margin-bottom: 0; }
/* Rejilla compacta para las opciones con muchos valores (estilos, tonos): columnas iguales, sin filas kilométricas */
.opciones.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; }
.opciones.rejilla span { width: 100%; justify-content: center; height: 32px; padding: 0 6px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opciones label { margin: 0; cursor: pointer; }
.opciones input { position: absolute; opacity: 0; pointer-events: none; }
.opciones span { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--tx); font-size: 13px; font-weight: 500; transition: border-color .15s, background .15s, color .15s; }
.opciones span:hover { background: var(--surface-2); }
.opciones input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.opciones input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fila:last-child { margin-bottom: 0; }
.fila > label { margin: 0; color: var(--tx); display: inline-flex; align-items: center; gap: 8px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=color] { width: 40px; height: 32px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
input[type=range] { flex: 1; accent-color: var(--accent); min-width: 120px; }

#selector { width: 100%; max-width: 460px; height: auto; border-radius: var(--r); border: 1px solid var(--line-strong); cursor: move; touch-action: none; background: #000; }
#caja-reaccion { margin-top: 4px; }
.ajustes-finos { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; }
.ajustes-finos summary { font-size: 13px; font-weight: 600; }
.ajustes-finos .rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 14px; margin-top: 14px; }
.ajustes-finos select, .ajustes-finos input[type=range] { width: 100%; }
.ajustes-finos .fila { margin-bottom: 10px; }
#linea { display: block; width: 100%; height: 96px; border-radius: var(--r); border: 1px solid var(--line-strong); cursor: ew-resize; touch-action: none; }
#linea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.linea-cab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.linea-ctrl { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 10px; }
.lt-grupo { display: flex; align-items: center; gap: 6px; }
.lt-grupo output { min-width: 78px; text-align: center; font-weight: 650; font-size: 15px; }
.lt-grupo .btn-sm { min-width: 32px; padding: 0 9px; }
.cambio input[type=text] { height: 32px; font-size: 13px; }
.cambio { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cambio .num { font-weight: 650; }
.coste { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.coste strong { color: var(--tx); font-weight: 650; }
.sello { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 22px auto 0; max-width: 44em; color: var(--mu); font-size: 13px; text-align: left; line-height: 1.45; }
.sello svg { flex: none; }
.soltar p.sello { color: var(--mu); margin-bottom: 0; }
.sello svg { color: var(--ok); }
.pasos { list-style: none; padding: 0; margin: 16px 0 4px; display: grid; gap: 8px; }
.pasos li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mu-2); transition: color .2s; }
.pasos li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pasos li[data-estado=activo] { color: var(--tx); font-weight: 600; }
.pasos li[data-estado=activo]::before { border-color: var(--accent-soft); border-top-color: var(--accent); animation: gira .8s linear infinite; }
.pasos li[data-estado=hecho] { color: var(--mu); }
.pasos li[data-estado=hecho]::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.progreso i { background-image: linear-gradient(110deg, var(--accent) 0 40%, #a78bfa 50%, var(--accent) 60% 100%); background-size: 200% 100%; animation: corre 1.4s linear infinite; }
@keyframes corre { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.progreso { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 16px 0 8px; }
.progreso i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }

.clips { margin-top: 36px; }
.clips-cab { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.clips-cab > div { display: flex; gap: 8px; flex-wrap: wrap; }
.clips h2 { font-size: 18px; }
.lista { display: grid; gap: 8px; }
.clip { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%;
  padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.clip:hover { border-color: var(--line-strong); }
.clip[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.clip .nota { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.clip h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; margin-bottom: 2px; }
.editor { margin-top: 14px; }
.editor .frase { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--mu); font-variant-numeric: tabular-nums; }
.editor .frase input { height: 34px; font-size: 13px; }
.editor details { border: 0; padding: 0; }
.tiempos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Cuenta */
.cuenta-datos { display: grid; gap: 14px; margin-bottom: 20px; }
.dato .etiqueta { display: block; margin-bottom: 8px; }
.dato b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.dato-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cuenta-bloque { margin-bottom: 20px; }

/* =============================================================
   7. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .grid-planes { grid-template-columns: repeat(2, 1fr); }
  .proy { grid-template-columns: 1fr auto auto; }
  .proy-info { grid-column: auto; }
  .proy .badge { justify-self: end; }
}
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cuenta-datos { grid-template-columns: repeat(3, 1fr); }
  .dos { grid-template-columns: 1fr 1fr; }
  .cuatro { grid-template-columns: repeat(4, 1fr); }
  .datos-tecnicos > div { grid-template-columns: 240px 1fr; gap: 16px; }
}
@media (min-width: 960px) {
  .hero .wrap { grid-template-columns: 1.2fr 1fr; }
  .grid-planes { grid-template-columns: repeat(4, 1fr); }
  .grid-planes .plan { padding: 22px 18px; }
  .grid-planes .plan .precio { font-size: 32px; }
  .estudio { grid-template-columns: 320px 1fr; gap: 32px; }
  .visor { position: sticky; top: 84px; }
  .ajustes { grid-template-columns: 190px 1fr; gap: 40px; }
  .ajustes-nav { position: sticky; top: 84px; flex-direction: column; overflow: visible; }
}
/* Iconos, esqueletos de carga y micro-animaciones */
.ico { display: inline-block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
label .ico, .label .ico, .etiqueta .ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.card-cab h2 { display: flex; align-items: center; gap: 10px; }
.card-cab h2 .ico { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.card-cab h2:has(.ico) + p { margin-left: 38px; }
.peligro .card-cab h2 .ico { background: var(--err-soft); color: var(--err); }
.ajustes-nav a { display: flex; align-items: center; gap: 9px; transition: background .15s, color .15s; }
.ajustes-nav a .ico { transition: transform .2s var(--ease-out); }
.ajustes-nav a:hover .ico { transform: scale(1.15); }
.opciones span { gap: 7px; transition: background .15s, border-color .15s, color .15s; }
.opciones span .ico { width: 14px; height: 14px; }

.esq { display: inline-block; width: 96px; max-width: 100%; height: .85em; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line-strong) 50%, var(--surface-2) 70%) 0 0 / 200% 100%; animation: corre 1.3s linear infinite; }

.ajustes-cuerpo > section { animation: sube .45s var(--ease-out) both; }
.ajustes-cuerpo > section:nth-of-type(2) { animation-delay: .04s; }
.ajustes-cuerpo > section:nth-of-type(3) { animation-delay: .08s; }
.ajustes-cuerpo > section:nth-of-type(n+4) { animation-delay: .12s; }
.dato, .plan { transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s; }
.dato:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plan:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 18px 40px -24px var(--accent); }
.btn[data-plan] { transition: background .15s, border-color .15s, transform .2s var(--ease-out), box-shadow .2s; }
.btn[data-plan]:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 20px -10px var(--accent); }
.btn[data-plan]:active { transform: translateY(0); }
select:hover { border-color: var(--mu-2); }
select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Desplegables: en navegadores que lo permiten (Chrome y Edge recientes) la lista se abre con una transición
   y toma los colores de la web. En el resto se queda el desplegable normal del sistema. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { background-image: none; padding-right: 12px; align-items: center; }
  select::picker-icon { color: var(--mu); margin-left: auto; font-size: 11px; transition: rotate .2s var(--ease-out); }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) { margin-top: 6px; padding: 5px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--tx);
    box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top;
    transition: opacity .16s, transform .2s var(--ease-out), overlay .2s allow-discrete, display .2s allow-discrete; }
  ::picker(select):popover-open { opacity: 1; transform: none; }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-6px) scale(.98); } }
  select option { padding: 7px 10px; border-radius: 6px; font-size: 14px; gap: 8px; transition: background .12s; }
  select option:hover, select option:focus-visible { background: var(--surface-2); outline: none; }
  select option:checked { color: var(--accent); font-weight: 600; }
  .idioma select { padding-right: 12px; gap: 8px; }
  .idioma select:open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .idioma select::picker(select) { min-width: 170px; }
  .idioma select option { padding: 9px 12px; }
  .idioma select option::checkmark { order: 1; margin-left: auto; color: var(--accent); }
}
/* Preguntas frecuentes y paneles plegables: se abren deslizando */
:root { interpolate-size: allow-keywords; }
details::details-content { height: 0; opacity: 0; overflow: clip; transition: height .28s var(--ease-out), opacity .2s, content-visibility .28s allow-discrete; }
details[open]::details-content { height: auto; opacity: 1; }

/* Cabecera: perfil (foto o inicial, nombre y plan) */
.nav a.usuario:not(.btn):not(.logo) { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, background .15s; }
.nav a.usuario:not(.btn):not(.logo):hover { border-color: var(--accent); background: var(--surface-2); }
.usuario img, .avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff; font-weight: 700; font-size: 13px; }
.usuario-txt { display: grid; line-height: 1.2; text-align: left; }
.usuario-txt b { font-size: 13px; font-weight: 600; color: var(--tx); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-txt small { font-size: 11px; font-weight: 600; color: var(--accent); }
@media (max-width: 640px) { .usuario-txt { display: none; } .nav a.usuario:not(.btn):not(.logo) { padding: 0 5px; } }

/* Ventana de confirmación y ventana de planes */
.dlg-confirmar { width: min(400px, calc(100% - 32px)); text-align: center; border-radius: 18px; }
.dlg-icono { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dlg-icono svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dlg-confirmar.peligro .dlg-icono { background: var(--err-soft); color: var(--err); }
.dlg-confirmar p { font-size: 14px; line-height: 1.5; }
.dlg-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.dlg-planes { width: min(480px, calc(100% - 32px)); }
.dlg-planes h2 { margin-bottom: 14px; }
.plan-fila { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 16px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, background .15s; }
.plan-fila:hover { border-color: var(--line-strong); background: var(--surface-2); }
.plan-fila.actual { border-color: var(--accent); background: var(--accent-soft); }
.plan-fila div b { display: block; }
.plan-actual .small { display: block; }
.plan-actual .dato-acc { margin-top: 16px; align-items: center; }
@media (min-width: 720px) { .plan-actual { grid-column: span 2; } }

/* Acceso con Google y Facebook */
.sociales { display: grid; gap: 8px; margin-bottom: 18px; }
.sociales .btn { height: 42px; gap: 10px; }
.sociales .btn:hover { border-color: var(--mu-2); }
.separador { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--mu-2); font-size: 12px; }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Editor limpio: ayuda en un icono, botones con icono y más aire entre bloques */
.btn .ico { width: 15px; height: 15px; }
.ayuda { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 7px; vertical-align: -3px; flex: none;
  border-radius: 50%; border: 1px solid var(--line-strong); color: var(--mu); font: italic 700 10px/1 Georgia, serif; cursor: help; transition: color .15s, border-color .15s; }
.ayuda::before { content: "i"; }
.ayuda:hover, .ayuda:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.ayuda::after { content: attr(aria-label); position: absolute; z-index: 40; bottom: calc(100% + 9px); left: -10px; width: max-content; max-width: min(300px, 70vw); padding: 10px 12px;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--tx); box-shadow: var(--shadow-lg);
  font: 400 12.5px/1.5 var(--sans); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s var(--ease-out); }
.ayuda.izq::after { left: auto; right: -10px; }
.ayuda:hover::after, .ayuda:focus-visible::after { opacity: 1; transform: none; }
.ayuda[hidden] { display: none; }
.panel { gap: 28px; }
.panel fieldset { padding: 22px 22px 24px; }
.panel fieldset .opciones, .panel fieldset > .fila { margin-bottom: 20px; }
.clips { margin-top: 52px; }
.editor { margin-top: 20px; padding: 28px; }
.editor > .campo { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.editor > .fila, .editor > details { margin-bottom: 24px; }
.bajar-fila { flex-wrap: nowrap; }
.bajar-fila .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .ayuda::after { transition: none; }
  .esq, .ajustes-cuerpo > section { animation: none; }
  .dato, .plan, .btn[data-plan], .ajustes-nav a .ico, ::picker(select), details::details-content { transition: none; }
  .dato:hover, .plan:hover, .btn[data-plan]:hover { transform: none; }
  .movil-subs span, dialog[open], dialog[open]::backdrop, dialog.tiembla, .progreso i { animation: none; }
  html { scroll-behavior: auto; }
}
