/* CotiBruno — identidad de Printing Bruno: negro, dorado (#c8963e) y blanco, sobre papel cálido en el tema claro.
   Reglas que se respetan (y por qué):
   - Contraste de texto >= 4,5:1 en ambos temas; el dorado de marca (#c8963e) NO alcanza contraste como texto sobre blanco, así que en tema claro el color de acción es un dorado oscuro (#8f5f0a, 5,5:1 con blanco) y en tema oscuro el dorado va con texto negro.
   - Objetivos táctiles >= 44 px; inputs a 16 px (iOS hace zoom si son menores).
   - Sin estilos inline ni fuentes/imagenes externas: el CSP es `default-src 'self'`. Fuentes del sistema, íconos SVG en sprite.
   - Se anima solo transform/opacity y se respeta prefers-reduced-motion. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --text: #1b1a17;
  --muted: #5e5a52;
  --border: #e6dfd0;
  --border-fuerte: #d2c8b3;
  --primary: #8f5f0a;
  --primary-hover: #6f4906;
  --on-primary: #ffffff;
  --primary-tint: #f6ead2;
  --hero-bg: linear-gradient(160deg, #1a1812 0%, #0b0a08 100%);
  --hero-text: #f4f1ea;
  --hero-accent: #d9a847;
  --ok: #15803d;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --err: #b42318;
  --err-bg: #fee4e2;
  --focus: #1d4ed8;
  --sombra: 0 1px 2px rgb(60 40 20 / .06), 0 8px 24px -12px rgb(60 40 20 / .18);
  --radio: 16px;
  --radio-s: 10px;
  --c-material: #c8963e;
  --c-maquina: #6b665c;
  --c-extras: #0f766e;
  --c-canal: #9aa3ad;
  --c-ganancia: #16a34a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="light"]) {
    --bg: #0b0b0a; --surface: #151513; --surface-2: #1e1d1a; --text: #f4f1ea; --muted: #b0aa9c;
    --border: #2c2a25; --border-fuerte: #403c33; --primary: #d4a24a; --primary-hover: #e6b865; --on-primary: #17110a;
    --primary-tint: #2a2112; --ok: #4ade80; --warn: #fcd34d; --warn-bg: #3a2c0b; --err: #fda29b; --err-bg: #3b1714;
    --focus: #93c5fd; --sombra: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
    --c-material: #d4a24a; --c-maquina: #8f8a7e; --c-extras: #2dd4bf; --c-canal: #94a3b8; --c-ganancia: #4ade80;
    color-scheme: dark;
  }
}
:root[data-tema="dark"] {
  --bg: #0b0b0a; --surface: #151513; --surface-2: #1e1d1a; --text: #f4f1ea; --muted: #b0aa9c;
  --border: #2c2a25; --border-fuerte: #403c33; --primary: #d4a24a; --primary-hover: #e6b865; --on-primary: #17110a;
  --primary-tint: #2a2112; --ok: #4ade80; --warn: #fcd34d; --warn-bg: #3a2c0b; --err: #fda29b; --err-bg: #3b1714;
  --focus: #93c5fd; --sombra: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
  --c-material: #d4a24a; --c-maquina: #8f8a7e; --c-extras: #2dd4bf; --c-canal: #94a3b8; --c-ganancia: #4ade80;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
em { font-style: normal; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }

/* El título del resultado recibe foco por código (lectores de pantalla); no necesita anillo, no es interactivo */
[tabindex="-1"]:focus { outline: none; }

/* Foco visible para quien navega con teclado */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: 8px; z-index: 50; transition: top .15s; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Encabezado ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { display: grid; place-items: center; width: 44px; height: 44px; }
.logo img { width: 100%; height: 100%; display: block; }
h1 { font-size: 1.2rem; line-height: 1.2; letter-spacing: -.01em; }
.tag { color: var(--muted); font-size: .88rem; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background-color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-fuerte); }
.ico-sun { display: none; }
:root[data-tema="dark"] .ico-sun { display: block; }
:root[data-tema="dark"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="light"]) .ico-sun { display: block; }
  :root:not([data-tema="light"]) .ico-moon { display: none; }
}

/* ---------- Estructura: 1 columna en celular, 2 en escritorio ---------- */
.layout { display: grid; gap: 20px; padding-top: 20px; padding-bottom: 28px; }
.col-form { display: grid; gap: 14px; align-content: start; min-width: 0; }
.col-res { min-width: 0; }
.sticky { display: grid; gap: 14px; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; padding-top: 28px; align-items: start; }
  .sticky { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding: 2px; scrollbar-width: thin; }
}

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); display: grid; gap: 14px; }
.card-t { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 650; }
.card-t .ico { color: var(--primary); }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 520px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 6px; align-content: start; }   /* start: dos campos lado a lado alinean sus inputs aunque uno tenga ayuda debajo */
.lbl { font-size: .9rem; font-weight: 600; }
.hint { font-size: .82rem; color: var(--muted); }
input[type="number"], input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-fuerte); border-radius: var(--radio-s);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 88px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent); }
input[aria-invalid="true"] { border-color: var(--err); }
select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
::placeholder { color: var(--muted); opacity: .8; }

.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 76px; font-variant-numeric: tabular-nums; }
.suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--muted); pointer-events: none; max-width: 70px; text-align: right; line-height: 1.1; }

/* Selector segmentado (radio accesible: se navega con flechas) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0; border: 0; background: var(--surface-2); border-radius: 12px; }
.seg3 { grid-template-columns: 1fr 1fr 1fr; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: grid; place-items: center; min-height: 44px; padding: 6px 8px; text-align: center; font-size: .88rem; font-weight: 600; color: var(--muted); border-radius: 9px; cursor: pointer; transition: background-color .15s, color .15s; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Zona de carga del archivo */
.drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 92px; border: 2px dashed var(--border-fuerte); border-radius: var(--radio); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.arrastrando { border-color: var(--primary); background: var(--primary-tint); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); color: var(--primary); flex: none; border: 1px solid var(--border); }
.drop-ico .ico { width: 24px; height: 24px; }
.drop-txt { display: grid; gap: 2px; min-width: 0; }
.drop-txt strong { overflow-wrap: anywhere; }
.drop-txt span { font-size: .85rem; color: var(--muted); }
.drop.listo { border-style: solid; border-color: var(--ok); background: var(--surface-2); }
.drop.listo .drop-ico { color: var(--ok); }
.err-campo { color: var(--err); font-size: .88rem; font-weight: 600; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 20px; font: inherit; font-weight: 700; font-size: 1.02rem; color: var(--on-primary); background: var(--primary); border: 0; border-radius: 14px; cursor: pointer; transition: background-color .15s, transform .1s, opacity .15s; }
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sec { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-fuerte); }
.btn-sec:hover:not(:disabled) { background: var(--surface-2); }
.botonera { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.botonera .btn-sec { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font: inherit; font-weight: 650; color: var(--text); background: var(--surface); border: 1.5px solid var(--border-fuerte); border-radius: 12px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.botonera .btn-sec:hover { background: var(--surface-2); }
.botonera .btn-sec[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Barra de acción: fija abajo en celular para que "Cotizar" siempre esté a mano */
.actionbar { position: sticky; bottom: 0; z-index: 10; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
@media (min-width: 960px) { .actionbar { position: static; margin: 0; padding: 0; background: none; border: 0; backdrop-filter: none; } }

/* Spinner */
.spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: giro .8s linear infinite; }
.spin-grande { display: inline-block; width: 22px; height: 22px; color: var(--primary); }
.btn.cargando .spin { display: inline-block; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- Panel de resultado ---------- */
.vacio { text-align: center; justify-items: center; padding: 28px 20px; background: linear-gradient(180deg, var(--primary-tint), var(--surface) 70%); }
.vacio-ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.vacio-ico img { width: 52px; height: 52px; display: block; }
.vacio h2 { font-size: 1.15rem; }
.vacio p { color: var(--muted); max-width: 32ch; }

.estado-fila { display: flex; align-items: center; gap: 10px; }
.estado-fila.err { color: var(--err); }
.barra { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.barra span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--primary); transition: width .2s; }
.barra.indeterminada span { width: 40%; animation: vaiven 1.4s ease-in-out infinite; }
@keyframes vaiven { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#s-error { border-color: var(--err); background: var(--err-bg); }

#s-resultado { display: grid; gap: 14px; }
.hero { background: var(--hero-bg); color: var(--hero-text); border: 1px solid #2c2a25; gap: 4px; }
.hero .eyebrow { color: var(--hero-accent); opacity: 1; }
.hero .precio { color: var(--hero-accent); }
.eyebrow { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.precio { font-size: clamp(2.4rem, 9vw, 3.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero-sub { opacity: .9; font-size: .95rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr 1fr; } .stat-costo { grid-column: 1 / -1; } }
.stat { display: grid; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); box-shadow: var(--sombra); }
.stat .ico { color: var(--primary); margin-bottom: 2px; }
.stat-l { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.desglose { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.desglose span { display: block; height: 100%; min-width: 2px; }
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leyenda li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.leyenda .pto { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.leyenda .nom { flex: 1; }
.leyenda .val { font-variant-numeric: tabular-nums; font-weight: 650; }
.leyenda .pct { color: var(--muted); font-size: .8rem; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.c-material { background: var(--c-material); } .c-maquina { background: var(--c-maquina); } .c-extras { background: var(--c-extras); }
.c-canal { background: var(--c-canal); } .c-ganancia { background: var(--c-ganancia); }

.medidas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.medidas li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.medidas li span:first-child { color: var(--muted); overflow-wrap: anywhere; }

.nota { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .92rem; }
.avisos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.avisos li { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); }
.avisos li.importante { color: var(--warn); background: var(--warn-bg); padding: 10px 12px; border-radius: 10px; }
.avisos .ico { width: 18px; height: 18px; margin-top: 2px; }

.fb .lbl { font-weight: 600; }

/* ---------- Plan Pro y supuestos ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; color: var(--on-primary); background: var(--primary); vertical-align: middle; }
.pro { border-style: dashed; }
#pro-bloqueado { background: var(--surface-2); box-shadow: none; }
.candado { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--muted); }
details.pro { gap: 14px; }
details.pro > summary { display: flex; align-items: center; gap: 8px; min-height: 28px; font-weight: 650; cursor: pointer; list-style: none; }
details.pro > summary::-webkit-details-marker { display: none; }
details.pro > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
details.pro[open] > summary::after { transform: rotate(-135deg); }
details.pro > summary .ico { color: var(--primary); }
details.pro > :not(summary) { margin-top: 14px; }   /* el contenido de <details> no hereda el gap de la tarjeta */
.supuestos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.supuestos li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.supuestos li:last-child { border-bottom: 0; }
.supuestos li span:last-child { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }

/* ---------- Cuenta, diálogos e historial ---------- */
.acciones { display: flex; align-items: center; gap: 8px; }
.btn-chico { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font: inherit; font-weight: 650; font-size: .92rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn-chico:hover { background: var(--surface-2); border-color: var(--border-fuerte); }
@media (max-width: 480px) { .btn-chico span { display: none; } .btn-chico { padding: 0; width: 44px; justify-content: center; } .tag { display: none; } }

dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px -20px rgb(0 0 0 / .5); overflow-y: auto; }
dialog::backdrop { background: rgb(8 8 6 / .6); backdrop-filter: blur(2px); }
dialog[open] { display: grid; gap: 14px; animation: aparece .18s ease-out; }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } }
.dlg-cab { display: flex; align-items: center; justify-content: space-between; margin: 0; }
.dlg-cab h2 { font-size: 1.15rem; }
.dlg-cuerpo { display: grid; gap: 14px; }
.cta { background: var(--primary-tint); border-color: transparent; box-shadow: none; }
.cta p { font-weight: 600; }

.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist li { display: flex; align-items: stretch; gap: 8px; }
.hist .abrir { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s; }
.hist .abrir:hover { border-color: var(--primary); }
.hist .h-nombre { font-weight: 650; overflow-wrap: anywhere; }
.hist .h-meta { font-size: .82rem; color: var(--muted); }
.hist .h-precio { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.hist .borrar { width: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; font: inherit; font-size: .75rem; font-weight: 700; }
.hist .borrar:hover { color: var(--err); border-color: var(--err); }
.hist .borrar.confirmar { width: auto; padding: 0 10px; color: var(--on-primary); background: var(--err); border-color: var(--err); }
.zona-peligro { border: 1px dashed var(--border-fuerte); border-radius: 12px; padding: 12px; }
.zona-peligro summary { cursor: pointer; font-weight: 650; color: var(--err); min-height: 28px; }
.zona-peligro > :not(summary) { margin-top: 12px; }
.btn-peligro { background: var(--err); color: var(--on-primary); }
.btn-peligro:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 85%, #000); }
.vacio-hist { color: var(--muted); text-align: center; padding: 16px 0; }

/* ---------- Pie ---------- */
.pie { display: grid; gap: 6px; padding-top: 8px; padding-bottom: 36px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 20px; }
.contacto { display: flex; align-items: center; gap: 8px; }

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

/* Costo de producirlo: cada componente con su cuenta a la vista y el total destacado */
.supuestos.costo li { align-items: baseline; }
.supuestos.costo li span:first-child small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.costo-total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 0; padding-top: 12px; border-top: 2px solid var(--border); }
.costo-total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* Íconos de línea fina (generados con Gemini): máscaras PNG pintadas con el color del texto,
   así siguen el tema claro/oscuro sin duplicar imágenes. Si se cambia un PNG, renombrarlo (Cloudflare lo cachea ~4 h). */
.gi { display: inline-block; flex: none; width: 24px; height: 24px; background-color: currentColor; color: var(--primary);
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.stat .gi { width: 28px; height: 28px; margin-bottom: 2px; }
.gi-impresora { --m: url("/static/ico-impresora.png"); }
.gi-carrete { --m: url("/static/ico-carrete.png"); }
.gi-capas { --m: url("/static/ico-capas.png"); }
.gi-archivo { --m: url("/static/ico-archivo.png"); }
.gi-tiempo { --m: url("/static/ico-tiempo.png"); }
.gi-balanza { --m: url("/static/ico-balanza.png"); }
.gi-etiqueta { --m: url("/static/ico-etiqueta.png"); }
.gi-calculadora { --m: url("/static/ico-calculadora.png"); }
.gi-billetera { --m: url("/static/ico-billetera.png"); }
.gi-caja { --m: url("/static/ico-caja.png"); }
.gi-grafico { --m: url("/static/ico-grafico.png"); }
.gi-tilde { --m: url("/static/ico-tilde.png"); }

/* Recuperar contraseña */
.enlace { justify-self: start; padding: 10px 0; min-height: 44px; background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.enlace:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ok-campo { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .92rem; }

/* Funciones Pro: perfiles y descripción para redes */
.perfiles { display: grid; gap: 10px; padding: 12px; margin-bottom: 14px; border: 1px dashed var(--border-fuerte); border-radius: var(--radio-s); }
.perfil-guardar { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.perfil-guardar .btn-sec { width: auto; padding: 0 14px; }
@media (max-width: 420px) { .perfil-guardar { grid-template-columns: 1fr 1fr; } .perfil-guardar input { grid-column: 1 / -1; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; align-self: end; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
#red-texto { margin-top: 12px; font: .92rem/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; min-height: 180px; }
#res-redes .btn { margin-top: 4px; }

/* Suscripción al plan Pro */
.compra { display: grid; gap: 10px; margin-top: 12px; }
.precio-pro { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.precio-pro strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.precio-pro span { color: var(--muted); font-size: .92rem; }
#res-redes .grid2 { grid-template-columns: 1fr; gap: 4px; }
#res-redes .check { align-self: start; }

/* perfil y facturación */
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.datos dt { color: var(--muted); }
.datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.sub-t { margin: 0 0 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Tarjeta de socio: el dorado de la marca sobre negro, con la inicial como sello. */
.carnet { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 16px; border-radius: var(--radio);
  background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; }
.carnet::after { content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  border: 1px solid rgb(217 168 71 / .35); box-shadow: 0 0 0 14px rgb(217 168 71 / .07), 0 0 0 28px rgb(217 168 71 / .04); pointer-events: none; }
.avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hero-accent); color: #14110a;
  font-size: 1.5rem; font-weight: 800; box-shadow: 0 0 0 3px #0b0a08, 0 0 0 4px var(--hero-accent); }
.carnet-datos { min-width: 0; }
.carnet-nombre { margin: 0; color: var(--hero-text); font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.carnet-mail { margin: 0; font-size: .88rem; color: rgb(244 241 234 / .72); overflow-wrap: anywhere; }
.chip-plan { grid-column: 1 / -1; justify-self: start; margin-top: 10px; padding: 3px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  border: 1px solid rgb(244 241 234 / .35); color: var(--hero-text); position: relative; z-index: 1; }
.chip-plan.es-pro { background: var(--hero-accent); border-color: var(--hero-accent); color: #14110a; }

.bloque { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radio); background: var(--surface-2); }
.bloque .hint { margin: 10px 0 0; }
.fecha-clave { color: var(--primary); font-size: 1.05rem; }
.form-usuario { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.form-usuario .btn { padding-inline: 18px; }

/* En el celular el diálogo es una hoja que sube desde abajo: el pulgar llega a todo y entra más contenido. */
.agarre { display: none; }
@media (max-width: 600px) {
  dialog.hoja { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
  dialog.hoja[open] { animation: sube .26s cubic-bezier(.2, .8, .2, 1); }
  .agarre { display: block; justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--border-fuerte); }
  dialog.hoja .dlg-cab { position: sticky; top: -8px; z-index: 2; background: var(--surface); padding: 4px 0; }
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dt { font-size: .8rem; padding-top: 10px; }
  .datos dd { text-align: left; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .datos dd:last-child { border-bottom: 0; padding-bottom: 0; }
  .form-usuario { grid-template-columns: 1fr; }
  .form-usuario .btn { width: 100%; }
}
@keyframes sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.hoja[open] { animation: none; } }
#campo-terminos a, .legal a { color: var(--primary); font-weight: 600; }
.legal { margin: 0; }
.doc { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.6; }
.doc h1 { font-size: 1.6rem; } .doc h2 { font-size: 1.2rem; margin-top: 28px; }
.doc a { color: var(--primary); font-weight: 600; }

/* Mi equipo (Pro) */
.equipo { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radio-s); background: var(--surface-2); }
.equipo .sub-t { margin: 0; }
.lista-equipo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lista-equipo li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio-s); }
.lista-equipo .eq-nombre { font-weight: 600; overflow-wrap: anywhere; }
.lista-equipo .eq-detalle { grid-column: 1; color: var(--muted); font-size: .85rem; }
.lista-equipo .enlace { grid-column: 2; grid-row: 1 / span 2; }
.lista-equipo .eq-vacio { display: block; color: var(--muted); }
.alta-equipo { border: 1px dashed var(--border-fuerte); border-radius: var(--radio-s); padding: 0 12px; }
.alta-equipo[open] { padding-bottom: 12px; display: grid; gap: 12px; }
.alta-equipo summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--primary); }
.cama { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 0; padding: 0; margin: 0; }
.cama legend { grid-column: 1 / -1; padding: 0; margin-bottom: 6px; }

/* Ejemplo de resultado en el panel vacío y botón de recomendar */
.ejemplo { width: 100%; margin-top: 8px; padding: 14px 16px; border: 1px dashed var(--border-fuerte); border-radius: 14px; background: var(--surface); text-align: left; }
.ejemplo-precio { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: 4px 0 0; color: var(--text); max-width: none; }
.ejemplo .hint { max-width: none; margin: 4px 0; }
.ejemplo-lista { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.ejemplo-lista li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.ejemplo-lista span { color: var(--muted); }
