/* Cuentas claras, por Shark Vision.
   Tinta sobre blanco, rojo señal y un gradiente vivo arriba. Todo alineado a la izquierda, con aire. */
:root {
  color-scheme: light;
  --ink: #0a0b0d;
  --tone: #7a808a;      /* segundo tono de los titulares */
  --muted: #6b7280;     /* texto secundario */
  --faint: #b9bdc4;
  --line: #e7e8eb;
  --soft: #f4f5f7;
  --paper: #ffffff;
  --signal: #e5322d;
  --signal-ink: #c42a25;
  --font: "Host Grotesk", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --col: 600px;
  --gut: 24px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; font-weight: 400; }
button, input { font: inherit; color: inherit; }
button, label, summary, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Gradiente vivo: luces suaves que orbitan despacio, con grano muy leve */
.aura {
  position: absolute; inset: 0 0 auto; z-index: 0;
  height: 620px;
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  transition: opacity 400ms var(--ease);
}
body:not([data-view="quien"]) .aura { height: 360px; opacity: 0.7; }
.aura i { position: absolute; width: 100vmax; height: 100vmax; border-radius: 50%; will-change: transform; }
.aura i:nth-child(1) { left: -38vmax; top: -62vmax; background: radial-gradient(closest-side, rgba(240, 80, 63, 0.5), rgba(240, 80, 63, 0) 72%); animation: orbit-a 26s var(--ease) infinite alternate; }
.aura i:nth-child(2) { right: -46vmax; top: -66vmax; background: radial-gradient(closest-side, rgba(255, 179, 138, 0.75), rgba(255, 179, 138, 0) 72%); animation: orbit-b 33s var(--ease) infinite alternate; }
.aura i:nth-child(3) { left: -6vmax; top: -72vmax; background: radial-gradient(closest-side, rgba(247, 168, 196, 0.6), rgba(247, 168, 196, 0) 72%); animation: orbit-c 29s var(--ease) infinite alternate; }
.aura i:nth-child(4) { right: -24vmax; top: -54vmax; background: radial-gradient(closest-side, rgba(255, 197, 107, 0.5), rgba(255, 197, 107, 0) 72%); animation: orbit-d 37s var(--ease) infinite alternate; }
.aura::after {
  content: ""; position: absolute; inset: 0; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes orbit-a { to { transform: translate(14vmax, 8vmax) rotate(30deg); } }
@keyframes orbit-b { to { transform: translate(-16vmax, 10vmax) rotate(-25deg); } }
@keyframes orbit-c { to { transform: translate(18vmax, 12vmax) scale(1.12); } }
@keyframes orbit-d { to { transform: translate(-10vmax, 6vmax) scale(0.9); } }

/* Marco general */
.wrap {
  position: relative; z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gut) calc(env(safe-area-inset-bottom, 0px) + 40px);
  outline: none;
}
body[data-view="yo"] .wrap { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 140px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; font-size: 1rem; letter-spacing: -0.012em; color: var(--ink); }
.eye { flex: none; width: 11px; height: 11px; background: var(--signal); }
.who, .back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 2px;
  border: 0; background: none; cursor: pointer;
  font-weight: 500; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.ic { flex: none; width: 20px; height: 20px; color: var(--muted); }
.who .ic { width: 18px; height: 18px; }

/* Titulares en dos tonos */
.hero { padding: 76px 0 8px; }
.hero-sm { padding: 44px 0 0; }
.over { color: var(--muted); font-size: 0.9375rem; }
.display {
  margin-top: 16px;
  font-size: clamp(2.75rem, 12.2vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.display-sm {
  font-size: clamp(2rem, 8.4vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.034em;
  text-wrap: balance;
}
.tone { color: var(--tone); }
.lede { margin-top: 22px; max-width: 32ch; font-size: 1.1875rem; line-height: 1.45; letter-spacing: -0.012em; }
.h2 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.028em; text-wrap: balance; }

/* Entrada del titular: del desenfoque al foco, una sola vez */
.reveal > span { display: inline-block; animation: focus-in 900ms var(--ease) both; }
.reveal > span + span { animation-delay: 140ms; }
.lede.reveal-late { animation: focus-in 900ms var(--ease) 260ms both; }
@keyframes focus-in { from { opacity: 0; filter: blur(12px); transform: translateY(8px); } to { opacity: 1; filter: blur(0); transform: none; } }

/* Listas */
.block { margin-top: 64px; }
.list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.list > li { border-bottom: 1px solid var(--line); }
.pick {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 66px; padding: 10px 0;
  border: 0; background: none; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pick .name { flex: 1 1 auto; min-width: 0; font-size: 1.3125rem; letter-spacing: -0.02em; }
.pick .meta { color: var(--muted); font-size: 0.9375rem; }
.after { margin-top: 20px; }
.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--ink); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}

/* Lo que consumí */
.sec { margin-top: 56px; scroll-margin-top: 24px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.sec-h h2 { font-weight: 500; font-size: 1.0625rem; letter-spacing: -0.01em; }
.sec-h .num { color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { position: relative; border-bottom: 1px solid var(--line); scroll-margin: 110px 0 170px; }
.hit {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 3px;
  align-items: baseline;
  padding: 18px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tick {
  grid-row: 1 / span 2; align-self: start;
  display: grid; place-items: center;
  width: 26px; height: 26px; margin-top: -1px;
  border: 1.5px solid #c9ccd2; border-radius: 50%;
}
.tick { transition: transform 120ms var(--ease); }
.hit:active .tick { transform: scale(0.9); }
.tick svg { width: 15px; height: 15px; color: #fff; opacity: 0; transform: scale(0.4); transition: opacity 160ms var(--ease), transform 260ms var(--ease); }
.hit input:checked + .tick { background: var(--signal); border-color: var(--signal); }
.hit input:checked + .tick svg { opacity: 1; transform: none; }
.hit input:focus-visible + .tick { outline: 2px solid var(--ink); outline-offset: 3px; }
.name { letter-spacing: -0.012em; }
.price { text-align: right; }
.meta { grid-column: 2 / -1; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.row.mine .meta { color: var(--ink); }
.row.mine .meta.unit { color: var(--muted); }
.meta.warn, .row.mine .meta.warn { color: var(--signal-ink); }
.multi { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 16px 0 16px 42px; }
.multi .meta { margin-top: 3px; }
.stepper { display: flex; align-items: center; border-radius: 12px; background: var(--soft); }
.sbtn {
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sbtn svg { width: 18px; height: 18px; }
.sbtn:disabled { color: var(--faint); cursor: default; }
.sval { min-width: 22px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.row.mine .sval { color: var(--signal-ink); }
.done-note { margin-top: 28px; max-width: 40ch; font-size: 1.0625rem; }
.free { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; max-width: 46ch; }
.lede, .meta, .hint, .free, .done-note, .foot p { text-wrap: pretty; }
.row.flash::after {
  content: ""; position: absolute; inset: 0 calc(var(--gut) * -1);
  background: rgba(229, 50, 45, 0.07); pointer-events: none;
  animation: fade-out 1200ms var(--ease) forwards;
}
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Barra con tu parte */
.dock {
  position: fixed; z-index: 20;
  left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-width: calc(var(--col) - 24px); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 12px 12px 22px;
  border-radius: 24px;
  background: var(--ink); color: #fff;
  box-shadow: 0 16px 40px rgba(10, 11, 13, 0.08);
}
.dock > div { flex: 1 1 auto; min-width: 0; }
.dock-label { color: #a9aeb7; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-label[data-state="saved"] { color: #fff; }
.dock-label[data-state="failed"] { color: #ffb4ad; }
.dock-amt { font-size: 1.625rem; line-height: 1.15; font-weight: 500; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px;
  background: var(--ink); color: #fff;
  font-weight: 500; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-light { margin-left: auto; background: #fff; color: var(--ink); }
.btn, .sbtn { transition: transform 120ms var(--ease); }
.btn:active, .sbtn:not(:disabled):active { transform: scale(0.97); }

/* Cómo va la cuenta */
.meter { margin-top: 28px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--signal); transform-origin: left center; transition: transform 500ms var(--ease); }
.block-h { padding-bottom: 12px; border-bottom: 1px solid var(--ink); font-weight: 500; font-size: 1.0625rem; letter-spacing: -0.01em; }
.panel { margin-top: 40px; padding: 18px 20px 6px; border-radius: 16px; background: var(--soft); }
.panel .block-h { border-bottom: 0; padding-bottom: 4px; }
.panel .hint { margin: 0 0 8px; color: var(--muted); font-size: 0.9375rem; }
.panel.warn .block-h { color: var(--signal-ink); }
.plain { list-style: none; margin: 0; padding: 0; }
.jump {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 0;
  border: 0; border-top: 1px solid #e2e4e8; background: none; text-align: left; cursor: pointer;
}
.jump .name { flex: 1 1 auto; }
.review li { padding: 12px 0; border-top: 1px solid #e2e4e8; }
.totals { list-style: none; margin: 0; padding: 0; }
.totals > li { border-bottom: 1px solid var(--line); }
.totals summary {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 0;
  list-style: none; cursor: pointer;
}
.totals summary::-webkit-details-marker { display: none; }
.totals summary::marker { content: ""; }
.totals .pname { flex: 1 1 auto; min-width: 0; font-size: 1.125rem; letter-spacing: -0.015em; }
.totals .you { margin-left: 8px; color: var(--muted); font-size: 0.9375rem; }
.totals .ptotal { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.015em; }
.totals .chev { transition: transform 240ms var(--ease); }
.totals details[open] .chev { transform: rotate(180deg); }
.detail { list-style: none; margin: 0 0 16px; padding: 0; }
.detail li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 6px 0; font-size: 0.9375rem; }
.detail .dd { grid-column: 1 / -1; color: var(--muted); font-size: 0.875rem; }
.detail .empty { color: var(--muted); }
.pairs, .sum { margin: 0; }
.pairs div, .sum div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pairs dd, .sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.pairs dd { font-weight: 500; }
.sum dt { color: var(--muted); }
.sum .grand { border-bottom: 0; padding-top: 18px; }
.sum .grand dt { color: var(--ink); }
.sum .grand dd { font-size: 2rem; line-height: 1.1; font-weight: 500; letter-spacing: -0.03em; }
.seg {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2px;
  margin-top: 16px; padding: 3px;
  border-radius: 12px; background: var(--soft);
}
.seg label { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 9px; font-size: 0.9375rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(10, 11, 13, 0.08), 0 0 0 0.5px rgba(10, 11, 13, 0.06); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 1px; }
.tipset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tipset legend { float: left; width: 100%; padding: 0 0 12px; border-bottom: 1px solid var(--ink); font-weight: 500; font-size: 1.0625rem; }
.tipset legend + * { clear: both; }
.hint { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }

/* Firma */
.foot { margin-top: 96px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 6px; color: var(--muted); font-size: 0.9375rem; }
.foot .brand { margin-bottom: 4px; }
.foot .link { justify-self: start; }

/* Avisos */
.note {
  position: fixed; z-index: 30; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px);
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 0.9375rem;
}

@media (hover: hover) {
  .pick:hover .name, .totals summary:hover .pname, .jump:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .hit:hover .tick { border-color: var(--muted); }
  .sbtn:not(:disabled):hover { background: #e9eaee; }
  .btn:hover { background: #24262b; }
  .btn-light:hover { background: #eceef1; }
  .who:hover, .back:hover { text-decoration: underline; text-underline-offset: 4px; }
}
@media (max-width: 719px) {
  .aura { height: 700px; }
  .aura i { margin-top: 14vmax; }
}
@media (min-width: 720px) {
  :root { --gut: 32px; }
  .wrap { padding-top: 32px; }
  .hero { padding-top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
