﻿:root {
  --paper: #F1ECE3;
  --sheet: #FAF7F1;
  --ink: #1D1B17;
  --ink-2: #57524A;
  --ink-3: #8A8478;
  --rule: #D8D0C2;
  --rule-soft: #E6DFD3;
  --red: #C0391F;
  --up: #2D6A3E;
  --down: #B4371D;
  --note: #F3E4C3;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rail: 208px;
  color-scheme: light dark;
}

/* Oscuro: automático según el teléfono, salvo que en Configuraciones se haya elegido otro. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141311;
    --sheet: #1D1B18;
    --ink: #EDE8DE;
    --ink-2: #B1AA9C;
    --ink-3: #7E786C;
    --rule: #35322C;
    --rule-soft: #26241F;
    --red: #E2583C;
    --up: #72B886;
    --down: #E77A5F;
    --note: #3A301B;
  }
}
:root[data-theme="dark"] {
  --paper: #141311;
  --sheet: #1D1B18;
  --ink: #EDE8DE;
  --ink-2: #B1AA9C;
  --ink-3: #7E786C;
  --rule: #35322C;
  --rule-soft: #26241F;
  --red: #E2583C;
  --up: #72B886;
  --down: #E77A5F;
  --note: #3A301B;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Claro en computadora: las pantallas de escritorio suelen verse más frías que el iPad,
   así que el papel es un poco más beige para que no se vea blanco fuerte. */
@media (min-width: 861px) and (hover: hover) and (pointer: fine) {
  :root[data-theme="light"] {
    --paper: #ECE4D6;
    --sheet: #F5EFE4;
    --rule: #D5CBBA;
    --rule-soft: #E2D9C9;
    --note: #EFDDBA;
  }
}
@media (min-width: 861px) and (hover: hover) and (pointer: fine) and (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper: #ECE4D6;
    --sheet: #F5EFE4;
    --rule: #D5CBBA;
    --rule-soft: #E2D9C9;
    --note: #EFDDBA;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estructura */
.app { min-height: 100dvh; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 26px;
  padding: 26px 14px 20px;
  border-right: 1px solid var(--rule);
}
.brand {
  padding: 0 10px;
  font-size: 32px; font-weight: 800; font-stretch: 78%; letter-spacing: -0.02em;
  text-decoration: none; line-height: 1;
}
.brand span { color: var(--red); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 7px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--rule-soft); font-weight: 650; }
.rail-foot { margin-top: auto; padding: 0 10px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.rail-foot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.rail-foot.ok::before { background: var(--up); }
.rail-foot.off::before { background: var(--red); }
/* Sin esto el display: flex de arriba le gana a "hidden" y el indicador sale igual */
.rail-foot[hidden] { display: none; }

.view { width: 100%; max-width: 1240px; padding: 34px clamp(20px, 4vw, 56px) 80px; outline: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: auto 0 0 0; height: auto; z-index: 30;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--rule);
    background: var(--paper);
  }
  .brand, .rail-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav a {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px;
    font-size: 11px; font-stretch: 88%; white-space: nowrap; background: none !important;
  }
  .nav a[aria-current="page"] { color: var(--red); }
  .view { padding: calc(18px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
}

/* Texto */
.page-head { margin-bottom: 26px; }
.page-head h1, .card-title {
  font-size: clamp(30px, 5vw, 44px); font-weight: 760; font-stretch: 80%;
  letter-spacing: -0.015em; line-height: 1.02;
}
.lede { margin-top: 10px; max-width: 54ch; color: var(--ink-2); font-size: 16px; }
.kicker { color: var(--ink-3); font-size: 13.5px; margin-bottom: 6px; }
.label { color: var(--ink-3); font-size: 13px; margin-bottom: 4px; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 13.5px; margin-top: 10px; }
.error { color: var(--down); margin: 14px 0; font-weight: 500; }
.warn { background: var(--note); padding: 10px 12px; border-radius: 7px; margin-top: 12px; }
.notice { background: var(--note); padding: 12px 14px; border-radius: 8px; margin-bottom: 22px; max-width: 640px; }
.notice code { font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* Botones */
.btn {
  appearance: none; border: 1px solid var(--ink); background: transparent;
  padding: 11px 18px; border-radius: 8px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn:not(:disabled):active { transform: translateY(1px); }
.link {
  appearance: none; background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.link:hover { color: var(--ink); }
.link:disabled { opacity: 0.4; cursor: default; }
.link.danger { color: var(--down); }

.seg { display: inline-flex; background: var(--rule-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 7px; color: var(--ink-2); font-weight: 550;
}
.seg button span { color: var(--ink-3); font-weight: 450; margin-left: 4px; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"], .seg button[aria-pressed="true"] {
  background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.seg.small button { padding: 6px 12px; font-size: 14px; }

/* Colección */
.col-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.total {
  font-size: clamp(48px, 10vw, 84px); font-weight: 780; font-stretch: 72%;
  letter-spacing: -0.02em; line-height: 0.92; font-variant-numeric: tabular-nums;
}
.total .cents { color: var(--ink-3); font-size: 0.5em; vertical-align: 0.72em; margin-left: 2px; }
.sub { color: var(--ink-2); margin-top: 8px; }

.toolbar { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 26px;
  padding: 0 16px; min-height: 48px;
}
.search:focus-within { border-color: var(--ink-3); box-shadow: 0 1px 6px rgb(0 0 0 / 0.07); }
.search svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 12px 0; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.sort select {
  height: 100%; min-height: 48px; appearance: none; cursor: pointer;
  background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A8478' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--rule); border-radius: 26px; padding: 0 38px 0 16px; font-size: 15px;
}
.chips { display: flex; gap: 6px; margin: 14px 0 26px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  appearance: none; flex: none; cursor: pointer;
  border: 1px solid var(--rule); background: none; border-radius: 20px;
  padding: 6px 13px; color: var(--ink-2); font-size: 14px;
}
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 30px 20px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; } }
.tile { text-decoration: none; display: block; min-width: 0; }
.tile-img {
  aspect-ratio: 5 / 7; background: var(--rule-soft); border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.05), 0 6px 14px -10px rgb(0 0 0 / 0.35);
  transition: transform 0.18s ease;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile-img { transform: translateY(-3px); }
.tile-slab { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--red); font-variant-numeric: tabular-nums; }
.tile-name { margin-top: 9px; font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-slab + .tile-name { margin-top: 2px; }
.tile-set { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-flags { color: var(--red); font-size: 12px; font-weight: 600; }
.tile-price { margin-top: 5px; font-variant-numeric: tabular-nums; }
.tile-price b { font-size: 17px; font-weight: 720; }
.tile-price span { color: var(--ink-3); font-size: 13px; margin-left: 4px; }

.empty { padding: 50px 0; max-width: 420px; }
.empty-title { font-size: 20px; font-weight: 650; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

/* Fotos */
.flow { max-width: 620px; }
.capture { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shot {
  position: relative; aspect-ratio: 5 / 7; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1.5px dashed var(--rule); background: var(--sheet);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.shot.has { border-style: solid; border-color: transparent; background: var(--rule-soft); }
.shot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; pointer-events: none; }
.shot-empty svg { width: 30px; height: 30px; fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; margin-bottom: 6px; }
.shot-empty b { font-size: 17px; font-weight: 650; }
.shot-empty small { color: var(--ink-3); font-size: 13px; max-width: 16ch; }
.shot-tag {
  position: absolute; left: 8px; bottom: 8px; pointer-events: none;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
}
.shot:not(.has) .shot-tag { display: none; }
.actions { margin-top: 22px; }
.actions .btn { width: 100%; max-width: 320px; }

.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 11px; }
.steps li { display: flex; align-items: center; gap: 11px; color: var(--ink-3); }
.steps li::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--rule); flex: none; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ink-2); border-color: var(--ink-2); box-shadow: inset 0 0 0 3px var(--paper); }
.steps li.now { color: var(--ink); font-weight: 550; }
.steps li.now::before { border-color: var(--red); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.timer { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Resultado */
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topline-actions { display: flex; gap: 18px; }
.result { display: grid; grid-template-columns: minmax(230px, 340px) minmax(0, 1fr); gap: clamp(26px, 4vw, 60px); align-items: start; }
.media { position: sticky; top: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.media-frame { width: 100%; }
.media-frame img {
  width: 100%; border-radius: 8px; cursor: zoom-in;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.05), 0 18px 30px -22px rgb(0 0 0 / 0.5);
}
.media[data-side="front"] .media-back, .media[data-side="back"] .media-front { display: none; }
@media (max-width: 860px) {
  .result { grid-template-columns: 1fr; }
  .media { position: static; }
  .media-frame { max-width: 250px; }
}
.result-body { min-width: 0; }

.rc { display: inline-block; vertical-align: 0.35em; font-size: 13px; font-weight: 700; font-stretch: 100%; letter-spacing: 0.02em; color: var(--red); border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 5px; }
.card-line { margin-top: 8px; color: var(--ink-2); font-size: 16px; }
.card-links { margin-top: 10px; font-size: 14.5px; }
.card-links a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; text-decoration-color: var(--red); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 20px; margin: 22px 0 0; border-top: 1px solid var(--rule); }
.facts div { padding: 11px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.facts .wide { grid-column: span 2; }
.facts dt { color: var(--ink-3); font-size: 12.5px; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.yes { color: var(--red); }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr 1fr; column-gap: 14px; }
}
.desc { margin-top: 18px; font-size: 16px; line-height: 1.55; max-width: 62ch; }

.sec { margin-top: 38px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-head h2 { font-size: 22px; font-weight: 720; font-stretch: 85%; }
.sec-head .muted { font-size: 13px; }

.vtable { border-top: 1px solid var(--ink); }
.vrow {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 13px 8px; border-bottom: 1px solid var(--rule);
}
.vrow.sel { background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); border-radius: 6px; border-bottom-color: transparent; }
.vgrade { font-weight: 700; font-stretch: 85%; font-size: 17px; }
.vlast { font-size: 14px; color: var(--ink-2); }
.vlast b { color: var(--ink); font-weight: 650; }
.vlast a { color: var(--ink-2); text-underline-offset: 2px; }
.vmeta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.vest { text-align: right; font-size: 21px; font-weight: 720; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.vest small { display: block; font-size: 12.5px; font-weight: 600; font-stretch: 100%; }
.new { font-size: 11.5px; font-weight: 700; color: var(--paper); background: var(--red); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.verdict { background: var(--sheet); border-radius: 10px; padding: 16px 18px; }
.verdict-big { font-size: 24px; font-weight: 740; font-stretch: 82%; margin-bottom: 6px; line-height: 1.1; }
.verdict p:last-child { color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 520px) { .verdicts { grid-template-columns: 1fr; } }
.trend { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.trend-icon { width: 44px; height: 28px; flex: none; }
.trend.down .trend-icon { transform: scaleY(-1); }
.trend-pct { font-size: 34px; font-weight: 780; font-stretch: 74%; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.trend.up, .trend-sub.up { color: var(--up); }
.trend.down, .trend-sub.down { color: var(--down); }
.trend.flat { color: var(--ink-2); }
.trend.flat .trend-pct { font-size: 24px; }
.verdict .trend-sub { font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.verdict .trend-basis { font-size: 12.5px; color: var(--ink-3); margin: -4px 0 8px; }

.save-bar {
  margin-top: 26px; padding: 18px 0 0; border-top: 1px solid var(--rule);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.save-bar .btn { min-width: 220px; }
@media (max-width: 520px) { .save-bar .btn { width: 100%; } }

.more { margin-top: 14px; border-top: 1px solid var(--rule); }
.more:first-of-type { margin-top: 38px; }
.more summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
.more[open] summary::after { content: "–"; }
.more summary span { color: var(--ink-3); font-weight: 450; margin-left: 6px; margin-right: auto; }
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px dashed var(--rule); }
.list li p:first-child { font-size: 14.5px; }
.list li p.muted { font-size: 12.5px; }
.list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list a { text-underline-offset: 2px; text-decoration-color: var(--rule); }

/* Gradeo */
.slabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
@media (max-width: 520px) { .slabs { grid-template-columns: 1fr 1fr; } }
.slab { background: var(--sheet); border-radius: 8px; padding: 10px 12px 12px; border-top: 3px solid var(--ink); }
.slab:first-child { border-top-color: var(--red); }
.slab-top { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.slab-co { font-weight: 800; letter-spacing: 0.03em; }
.slab-label { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slab-grade { font-size: 46px; font-weight: 800; font-stretch: 72%; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.slab-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

.big-money { font-size: clamp(40px, 7vw, 58px); font-weight: 780; font-stretch: 74%; line-height: 1; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.grade-value .vlast { margin-top: 6px; font-size: 15px; }

.why { border-top: 1px solid var(--rule); }
.why:last-child { border-bottom: 1px solid var(--rule); }
.why summary { display: flex; align-items: baseline; gap: 10px; padding: 13px 0; cursor: pointer; list-style: none; }
.why summary::-webkit-details-marker { display: none; }
.why summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-size: 20px; line-height: 1; }
.why[open] summary::after { content: "–"; }
.why-co { font-weight: 800; width: 42px; }
.why-grade { font-weight: 700; font-variant-numeric: tabular-nums; }
.why-label { color: var(--ink-3); font-size: 14px; }
.why p { padding: 0 0 14px 52px; color: var(--ink-2); max-width: 70ch; }
.subgrades { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 0 14px 52px; font-size: 14px; }
.subgrades b { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .why p, .subgrades { padding-left: 0; } }

.meters { display: grid; gap: 14px; }
.meter { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 62px; align-items: center; gap: 14px; }
.meter-name { font-size: 14px; color: var(--ink-2); }
.meter-bar { position: relative; height: 10px; background: var(--rule-soft); border-radius: 5px; }
.meter-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 45%; width: 10%; background: color-mix(in srgb, var(--up) 22%, transparent); }
.meter-bar::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--ink-3); }
.meter-bar i { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--red); }
.meter b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .meter { grid-template-columns: minmax(0, 1fr) 56px; }
  .meter-name { grid-column: 1 / -1; margin-bottom: -6px; }
}

.scores { display: grid; gap: 12px; }
.score { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; align-items: start; }
.score-n { font-size: 30px; font-weight: 780; font-stretch: 75%; line-height: 1; font-variant-numeric: tabular-nums; }
.score-name { font-weight: 650; }
.score .muted { font-size: 14px; }
.why-not { font-size: 14px; color: var(--ink-2); margin-top: 6px; max-width: 64ch; }

/* Desglose de cómo llega cada compañía a su nota */
.calc-note { margin: -4px 0 12px; }
.calc { margin: 0 0 16px 52px; max-width: 520px; background: var(--sheet); border-radius: 10px; padding: 12px 14px; }
@media (max-width: 520px) { .calc { margin-left: 0; } }
.calc-rule { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.calc-row span { color: var(--ink-2); min-width: 0; }
.calc-row small { color: var(--ink-3); font-size: 12.5px; margin-left: 4px; }
.calc-row b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 650; }
.calc-row em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--red); margin-left: 6px; }
.calc-row.limits span { color: var(--ink); }
.calc-row.calc-total { border-top: 1px solid var(--ink); margin-top: 2px; }
.calc-row.calc-total span { color: var(--ink); font-weight: 650; }
.why .calc p { padding: 0; }
.calc-row b.down { color: var(--down); }
.score .why-not { margin-top: 2px; }
.why-not b { color: var(--ink); font-weight: 650; }

.defects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .defects { grid-template-columns: 1fr 1fr; gap: 12px; } }
.defect { appearance: none; border: 0; background: none; padding: 0; text-align: left; cursor: zoom-in; display: flex; flex-direction: column; gap: 3px; }
.crop { display: block; position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; background-color: var(--rule-soft); background-repeat: no-repeat; overflow: hidden; margin-bottom: 5px; }
.crop-mark { position: absolute; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid var(--red); border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.55); }
.defect-name { font-weight: 650; font-size: 14px; line-height: 1.25; }
.defect-meta { color: var(--ink-3); font-size: 12.5px; }

/* Términos y condiciones del primer uso */
.terms { max-width: 620px; margin: 6vh auto 0; display: flex; flex-direction: column; }
.terms .brand-big { margin-bottom: 18px; }
.terms-title { font-size: clamp(28px, 6vw, 40px); font-weight: 780; font-stretch: 80%; line-height: 1.1; }
.terms .lede { margin: 6px 0 16px; }
.terms-box {
  max-height: 46dvh; overflow-y: auto; padding: 18px 18px 4px; margin-bottom: 8px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px;
  overscroll-behavior: contain;
}
.terms-box h2 { font-size: 17px; font-weight: 700; margin: 16px 0 6px; }
.terms-box h2:first-child { margin-top: 0; }
.terms-box p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin-bottom: 10px; }
.terms-box b { color: var(--ink); font-weight: 650; }
.terms-hint { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-bottom: 14px; }

/* Aviso fijo de que estás en una cuenta de prueba */
.demo-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 55; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px; background: var(--ink); color: var(--paper);
  font-size: 13.5px; line-height: 1.3; box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
}
.demo-bar a { color: var(--paper); font-weight: 700; text-decoration: underline; white-space: nowrap; }
@media (min-width: 861px) { .demo-bar { bottom: 20px; } }
/* Deja sitio al final para que la barra no tape lo último de la página */
body:has(.demo-bar) .view { padding-bottom: calc(80px + 76px + env(safe-area-inset-bottom)); }
@media (max-width: 860px) { body:has(.demo-bar) .view { padding-bottom: calc(96px + 76px + env(safe-area-inset-bottom)); } }

/* Agregar al inicio: la barra de abajo y la guía de los tres toques del iPhone */
.instalar-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 54; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 11px 12px 11px 11px; border-radius: 14px; background: var(--ink); color: var(--paper);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
}
.instalar-bar img { border-radius: 9px; flex: none; }
.instalar-texto { min-width: 0; flex: 1; }
.instalar-titulo { font-size: 14px; font-weight: 750; font-stretch: 88%; line-height: 1.2; }
.instalar-sub { font-size: 12.5px; line-height: 1.3; opacity: 0.72; margin-top: 2px; }
.instalar-bar .btn { flex: none; }
.instalar-no {
  appearance: none; border: 0; background: none; flex: none; cursor: pointer;
  color: var(--paper); opacity: 0.5; font-size: 20px; line-height: 1; padding: 4px 2px;
}
.instalar-no:hover { opacity: 1; }
@media (min-width: 861px) { .instalar-bar { bottom: 20px; } }
/* Si están las dos barras, la de la prueba manda y esta se sube */
body:has(.demo-bar) .instalar-bar { bottom: calc(136px + env(safe-area-inset-bottom)); }
body:has(.instalar-bar) .view { padding-bottom: calc(86px + 76px + env(safe-area-inset-bottom)); }
@media (max-width: 860px) { body:has(.instalar-bar) .view { padding-bottom: calc(102px + 76px + env(safe-area-inset-bottom)); } }

.guia {
  border: 1px solid var(--rule); border-radius: 16px; background: var(--paper); color: var(--ink);
  padding: 22px; width: min(420px, calc(100% - 32px)); box-shadow: 0 18px 50px rgb(0 0 0 / 0.35);
}
.guia::backdrop { background: rgb(0 0 0 / 0.55); }
.guia h2 { font-size: 22px; font-weight: 780; font-stretch: 84%; }
.guia .lede { margin: 6px 0 16px; }
.pasos { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding-left: 20px; }
.pasos li { font-size: 14.5px; line-height: 1.45; }
.guia .btn { width: 100%; margin-top: 4px; }

/* Reseñas */
.estrellas { display: inline-flex; letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.estrellas-vacias { color: var(--rule); }
/* Cada estrella se rellena hasta --llena (0%, 50% o 100%): así se ven las medias estrellas. */
.est, .estrella {
  background: linear-gradient(90deg, #E8B23A var(--llena, 0%), var(--rule) var(--llena, 0%));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.estrellas-valor { align-self: center; margin-left: 8px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.5ch; }
.resumen-resenas { display: flex; align-items: center; gap: 16px; margin: 4px 0 22px; }
.resumen-nota { font-size: 46px; font-weight: 800; font-stretch: 80%; line-height: 1; }
.resumen-resenas .estrellas { font-size: 20px; }
.resena-form { display: flex; flex-direction: column; gap: 10px; }
.resena-form textarea { resize: vertical; min-height: 96px; padding: 12px 14px; font: inherit; color: var(--ink); }
.elegir-estrellas { display: flex; gap: 4px; }
.estrella {
  appearance: none; border: 0; cursor: pointer; padding: 2px;
  font-size: 32px; line-height: 1;
}
.estrella { cursor: pointer; }
.fila-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.lista-resenas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.resena { border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); padding: 14px; }
.resena-cabeza { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.resena-quien { font-size: 13px; color: var(--ink-3); }
.resena p { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
/* La nota de las reseñas dentro de la pantalla de planes */
.planes-resenas {
  display: flex; flex-direction: column; gap: 8px; margin: 18px 0; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet);
  color: var(--ink); text-decoration: none;
}
.resumen-chico { font-size: 14px; }
.cita { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

/* Las cajas donde PayPal pinta sus botones dentro de la tarjeta del plan */
.pagar { margin-top: 14px; min-height: 44px; }
.pagar:empty { display: none; }
/* El segundo método de pago (tarjeta con Lemon Squeezy), debajo de los botones de PayPal. */
.pagar-lemon { width: 100%; margin-top: 8px; min-height: 44px; border-radius: 999px; font-weight: 700; }
#paquete-lemon { margin-top: 8px; }
/* La ventana "Elige cómo pagar": un solo botón Pagar en el plan, y aquí PayPal o tarjeta. */
.pagar-boton { width: 100%; min-height: 48px; border-radius: 999px; font-weight: 750; }
.pago-elige { margin: 18px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.pago-metodo { margin: 0; }
.pago-metodo .pagar-lemon { margin-top: 0; }
.pago-o { display: flex; align-items: center; gap: 12px; margin: 14px 0; opacity: .6; font-size: 13px; }
.pago-o::before, .pago-o::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .35; }
.pago-o span { text-transform: uppercase; letter-spacing: .1em; }

/* Planes: elegir mensual o anual, código de regalo y pantalla de límite */
.cycle { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--rule); }
.cycle button {
  appearance: none; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-2);
  padding: 9px 18px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.cycle button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.cycle button span { font-size: 13px; font-weight: 700; color: var(--up); }
.cycle button[aria-checked="true"] span { color: #8ce0a5; }
/* El precio de antes, tachado justo antes del nuevo */
.plan-was {
  margin-right: 10px; font-size: 22px; font-weight: 600; font-stretch: 100%; letter-spacing: 0;
  color: var(--ink-3); text-decoration-thickness: 2px;
}

.code-box { margin-top: 26px; padding: 20px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--rule-soft); }
.code-row { display: flex; gap: 10px; margin: 10px 0 8px; }
.code-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.code-row .btn { flex: 0 0 auto; }

.paywall { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / 0.55); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .paywall { align-items: center; } }
.paywall-sheet {
  position: relative; width: min(680px, 100%); max-height: 92dvh; overflow-y: auto;
  background: var(--paper); border-radius: 20px 20px 0 0; padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .paywall-sheet { border-radius: 20px; padding: 30px; } }
.paywall-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font-size: 17px; line-height: 1;
}
.paywall-title { font-size: clamp(26px, 5vw, 34px); font-weight: 780; font-stretch: 82%; line-height: 1.12; margin-top: 4px; }
.paywall-sub { color: var(--ink-2); margin: 8px 0 20px; }
.paywall .plans { gap: 14px; }

/* Medición del centrado dibujada sobre la foto */
/* Una debajo de otra: en dos columnas cada foto queda tan chica que no se puede comprobar la medición. */
.cenview { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 16px; max-width: 460px; }
.cv { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: zoom-in; display: block; }
.cv-frame { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--rule-soft); }
/* La foto va aparte y en blanco y negro: así el gris no se come las marcas rojas de la medición. */
.cv-photo { position: absolute; inset: 0; background-repeat: no-repeat; filter: grayscale(1) contrast(1.06); }
.cv-card { position: absolute; border: 1px solid rgb(255 255 255 / 0.6); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35); border-radius: 2px; }
/* Líneas finas: el borde de la carta y donde empieza el diseño. El margen medido es lo que queda entre las dos. */
.cv-edge { position: absolute; background: rgb(255 255 255 / 0.95); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45); }
.cv-edge.v { width: 1.5px; }
.cv-edge.h { height: 1.5px; }
/* Solo un tramo corto pintado, para que la carta se siga viendo. */
.cv-band { position: absolute; background: rgb(192 57 31 / 0.6); }
.cv-tag {
  position: absolute; font-size: 12px; font-weight: 800; line-height: 1; color: #fff; background: var(--red);
  padding: 3px 6px; border-radius: 6px; box-shadow: 0 1px 4px rgb(0 0 0 / 0.45); font-variant-numeric: tabular-nums;
}
.cv-tag.t-left { left: 5px; transform: translateY(-50%); }
.cv-tag.t-right { right: 5px; transform: translateY(-50%); }
.cv-tag.t-top { top: 5px; transform: translateX(-50%); }
.cv-tag.t-bottom { bottom: 5px; transform: translateX(-50%); }
.cv-cap { display: block; margin-top: 7px; font-size: 13.5px; color: var(--ink-2); }
.cv-cap b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.summary { background: var(--sheet); border-radius: 12px; padding: 22px; }
.summary-line { font-size: clamp(22px, 3.4vw, 30px); font-weight: 740; font-stretch: 82%; line-height: 1.15; }
.summary-center { margin: 10px 0 12px; font-size: 16px; color: var(--ink-2); }
.summary-center b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Zoom */
.zoom { border: 0; padding: 0; background: var(--paper); color: var(--ink); border-radius: 12px; width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.zoom::backdrop { background: rgb(10 9 8 / 0.72); }
.zoom-inner { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.zoom-close { align-self: flex-end; }
.zoom-solo { max-height: calc(100dvh - 120px); width: auto; margin: 0 auto; border-radius: 6px; }
.zoom-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.zoom-full { position: relative; }
.zoom-full img { width: 100%; border-radius: 6px; }
.ring { position: absolute; width: 16%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid var(--red); border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.6); }
.zoom-title { font-weight: 700; font-size: 18px; }
@media (max-width: 520px) { .zoom-grid { grid-template-columns: 1fr 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95;
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 8px; font-weight: 550;
  max-width: calc(100vw - 32px);
}
@media (max-width: 860px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* Invitación a dejar reseña: una tarjeta abajo que no tapa el resultado ni bloquea nada */
.pide-resena {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45;
  /* El toast (z-index 50) puede salir encima un momento; dura 3 s y se va solo. */
  width: min(420px, calc(100vw - 32px)); background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .18);
}
.pide-resena p { font-size: 14.5px; line-height: 1.4; }
.pide-resena-botones { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 860px) { .pide-resena { bottom: calc(84px + env(safe-area-inset-bottom)); } }

.loading-line { color: var(--ink-3); padding: 40px 0; }

/* Contraseña */
body.locked .app { grid-template-columns: minmax(0, 1fr); }
body.locked .rail { display: none; }
.login { max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 8px; }
.brand-big { font-size: 64px; font-weight: 800; font-stretch: 74%; letter-spacing: -0.02em; line-height: 1; margin-bottom: 28px; }
.brand-big span { color: var(--red); }
.login-field { position: relative; display: block; margin-bottom: 8px; }
.login-input {
  width: 100%; border: 1px solid var(--rule); background: var(--sheet); border-radius: 8px;
  padding: 12px 48px 12px 14px; font-size: 16px; outline: none;
}
.login-input:focus { border-color: var(--ink-3); }
.login { max-width: 380px; }
.login-title { font-size: clamp(28px, 6vw, 36px); font-weight: 780; font-stretch: 80%; line-height: 1.1; }
.login .lede { margin: 6px 0 20px; }
/* En el dominio de verdad, Google no pinta su botón en la página: lo mete en un marco suyo
   unos 20px más ancho que el botón, y ese marco tiene fondo blanco. Sobre fondo oscuro se ve
   un recuadro blanco alrededor. No se puede tocar por dentro (es de otro dominio), así que se
   recorta el sobrante: la caja mide lo que el botón y lo que se salga queda fuera. */
.google-btn[hidden] { display: none; }
.google-btn {
  display: flex; justify-content: center; min-height: 44px;
  width: 354px; max-width: 100%; height: 42px; margin-inline: auto;
  overflow: hidden; border-radius: 999px;
}
.login-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--ink-3); font-size: 13px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.login-admin { display: flex; flex-direction: column; gap: 8px; }
/* Entrar con un código al correo: el mismo formulario en todas las pantallas de entrar. */
.correo-acceso { display: flex; flex-direction: column; gap: 8px; width: 354px; max-width: 100%; margin: 12px auto 0; }
.correo-acceso .login-input { padding-right: 14px; }
.correo-acceso .hint:empty { display: none; }
.correo-acceso .btn.small { align-self: center; }
.correo-a { text-align: center; font-weight: 650; overflow-wrap: anywhere; }
.codigo-input { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
.codigo-input::placeholder { color: var(--ink-3); opacity: .35; }
#acceso-rapido[hidden] { display: none; }
/* Crear cuenta obligatorio, después de los términos. Es su propia pantalla: no se parece a
   la de iniciar sesión a propósito, para que nadie crea que ya tiene cuenta. */
.registro { max-width: 400px; margin: 5vh auto 40px; }
.registro-top { text-align: center; margin-bottom: 22px; }
.registro-icono { border-radius: 13px; display: block; margin: 0 auto 14px; }
.registro-paso {
  display: inline-block; font-size: 11.5px; font-weight: 750; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--rule);
  border-radius: 999px; padding: 4px 11px; margin-bottom: 10px;
}
.registro-titulo { font-size: clamp(27px, 6vw, 34px); font-weight: 780; font-stretch: 80%; line-height: 1.1; }
.registro-top .lede { margin-top: 7px; }
/* La casilla de los términos, arriba de todo: sin marcarla no se puede entrar por ningún lado */
.acepto { margin: 6px 0 4px; }
.acepto-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 14.5px; line-height: 1.4; }
.acepto-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--red); cursor: pointer; }
.acepto-check a, .acepto-planes { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.acepto-planes { display: inline-block; margin: 8px 0 0 31px; font-size: 13.5px; }
.registro-google { display: flex; flex-direction: column; gap: 9px; }
.hint.centrado { text-align: center; }
.registro-o {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 16px;
  color: var(--ink-3); font-size: 12.5px;
}
.registro-o::before, .registro-o::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.registro-campos { display: flex; flex-direction: column; gap: 8px; }
.registro-campos .btn.grande { margin-top: 4px; padding: 14px; font-size: 16px; }
.registro-campos .hint:empty { display: none; }
.dos-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aviso-guardar {
  margin: 4px 0 2px; font-size: 12px; line-height: 1.45; color: var(--ink-3);
}
.aviso-guardar p { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.aviso-guardar p + p { margin-top: 6px; color: var(--ink-3); }
.login-back { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); text-align: center; }

/* Registro al pasarse a un plan de pago */
.registro-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.registro-form .label { margin-top: 10px; }
.registro-form input {
  width: 100%; border: 1px solid var(--rule); background: var(--sheet); border-radius: 8px;
  padding: 12px 14px; font-size: 16px; outline: none; color: var(--ink);
}
.registro-form input:focus { border-color: var(--ink-3); }
.registro-form .btn { margin-top: 16px; }
.hint.error { color: var(--red); }
/* Ojo para ver la contraseña mientras se mantiene apretado */
.login-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border: 0; background: none; color: var(--ink-3); border-radius: 8px; touch-action: none;
}
.login-eye:hover, .login-eye:active { color: var(--ink); background: var(--rule-soft); }
.login-eye svg { width: 22px; height: 22px; }
.login .error { margin: 0 0 8px; }

/* Botón de foto (antes era label; ahora abre primero el consejo) */
.shot-wrap { min-width: 0; }
.shot { width: 100%; padding: 0; appearance: none; font: inherit; color: inherit; }
.shot:disabled { cursor: default; }
/* Cámara del app: consejo y marco encima de la imagen */
body.camera-open { overflow: hidden; }
.camera { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; overflow: hidden; }
.camera[hidden] { display: none; }
.camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Casi toda la pantalla: mientras más grande salga la carta en la foto,
   mejor se miden el centrado y las esquinas. */
.camera-guide {
  position: absolute; left: 50%; top: calc(50% - 6px); transform: translate(-50%, -50%);
  width: min(94vw, calc((100dvh - 210px) * 5 / 7), 560px); aspect-ratio: 5 / 7;
  border: 3px solid rgb(255 255 255 / 0.92); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.38); pointer-events: none;
}
.camera-top {
  position: absolute; top: 0; left: 0; right: 0; padding: calc(18px + env(safe-area-inset-top)) 20px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.camera-tip { max-width: 440px; font-size: 16px; font-weight: 600; line-height: 1.35; text-shadow: 0 1px 3px rgb(0 0 0 / 0.7); }
.camera-side { font-size: 13px; opacity: 0.8; }
.camera-status { position: absolute; top: 47%; left: 24px; right: 24px; transform: translateY(-50%); text-align: center; font-size: 15px; }
.camera-status[hidden] { display: none; }
.camera-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: rgb(0 0 0 / 0.45);
}
.camera-text { appearance: none; background: none; border: 0; color: #fff; font: inherit; font-size: 15px; font-weight: 600; padding: 12px 6px; cursor: pointer; }
.camera-text:first-child { justify-self: start; }
.camera-text:last-child { justify-self: end; }
.camera-shutter {
  width: 74px; height: 74px; border-radius: 50%; cursor: pointer;
  border: 4px solid #fff; background: #fff; box-shadow: inset 0 0 0 3px #000;
}
.camera-shutter:active:not(:disabled) { transform: scale(0.94); }
.camera-shutter:disabled { opacity: 0.4; cursor: default; }

/* Otras versiones de la carta */
.variants { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--note); }
.variants p { font-size: 14.5px; }
.variant-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.variant {
  appearance: none; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px; max-width: 100%;
}
.variant:hover { border-color: var(--ink-3); }
.variant b { font-size: 14px; }
.variant span { font-size: 12.5px; color: var(--ink-2); }

/* Filas de la tabla que cambian la gráfica */
.vrow.tappable { cursor: pointer; grid-template-columns: 92px minmax(0, 1fr) auto; }
.vrow.tappable:hover { background: var(--sheet); }
.vrow.tappable:focus-visible { outline: 2px solid var(--chart); outline-offset: -2px; border-radius: 6px; }
.vrow .vgrade { white-space: nowrap; }
.vgrade svg { width: 15px; height: 11px; margin-left: 7px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vrow.charted { box-shadow: inset 0 -2px 0 var(--chart); }
.vrow.sel.charted { box-shadow: inset 0 0 0 1px var(--rule), inset 0 -2px 0 var(--chart); }
.vrow.charted .vgrade svg { stroke: var(--chart); }

/* Gráfica de precio */
:root { --chart: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart: #4a8de0; } }
:root[data-theme="dark"] { --chart: #4a8de0; }

/* Configuraciones */
.settings { max-width: 640px; display: grid; gap: 10px; }
.setting {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--sheet); border-radius: 12px; padding: 16px 18px;
}
.setting-name { font-weight: 650; font-size: 16px; }
.setting .muted { font-size: 14px; }
.setting-side { display: flex; align-items: center; gap: 12px; }
.setting-value { font-weight: 700; font-size: 15px; white-space: nowrap; }
.setting-value small { font-weight: 500; color: var(--ink-3); }
.btn.small { padding: 8px 14px; font-size: 14px; }
a.btn.small { display: inline-flex; align-items: center; text-decoration: none; }
.small-link { font-size: 13.5px; white-space: nowrap; }
/* Bloques de configuración que van en columna en vez de nombre + control a los lados */
.setting.block { flex-direction: column; align-items: stretch; gap: 14px; }
.setting.block .hint { margin-top: 0; }
.seg.wide { display: grid; grid-template-columns: repeat(3, 1fr); }

/* Enlaces de prueba (solo el dueño) */
.demo-links { display: grid; gap: 8px; }
.demo-links a {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px;
}
.demo-links a:hover { border-color: var(--ink-3); }
.demo-link-name { font-weight: 650; font-size: 15px; }
.demo-links .muted { font-size: 13.5px; }

/* Simulador dentro de una cuenta de prueba */
.sim-field { display: grid; gap: 6px; }
.sim-row { display: flex; align-items: center; gap: 10px; }
.sim-row input {
  width: 90px; border: 1px solid var(--rule); background: var(--sheet); border-radius: 8px;
  padding: 10px 12px; font-size: 16px; color: var(--ink); outline: none;
}
.sim-row input:focus { border-color: var(--ink-3); }
.sim-row input:disabled { opacity: 0.5; }
.sim-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Iniciar sesión / Crear cuenta uno al lado del otro */
.setting-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Títulos que agrupan las configuraciones */
.settings-group {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin: 22px 0 -2px 2px;
}
.settings-group:first-child { margin-top: 0; }

/* Tarjeta del plan, arriba de todo */
.plan-card {
  max-width: 640px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px;
  padding: 20px; margin-bottom: 22px; display: grid; gap: 16px;
}
.plan-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-card-name { font-size: 30px; font-weight: 760; font-stretch: 82%; line-height: 1.05; margin-top: 2px; }
.plan-card-price { font-size: 15px; font-weight: 650; color: var(--ink-2); white-space: nowrap; padding-top: 18px; }
/* Las barritas de la cuota van dentro de la tarjeta del plan. Se escriben con .plan-card delante
   a propósito: ".meter" ya existe arriba, y es la fila del centrado (nombre, barra y número).
   Sin el prefijo, esta regla la aplastaba a 6 px de alto y el centrado se veía vacío. */
.plan-card .meters { display: grid; gap: 12px; }
.plan-card .meter-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px; font-size: 14.5px; }
.plan-card .meter-name { color: var(--ink-2); }
.plan-card .meter-count { font-weight: 650; }
/* display: block a propósito: arriba hay otro `.meter` (el del centrado) que es una rejilla de
   tres columnas, y sin esto el relleno caía dentro de la primera columna y la barra nunca se
   llenaba del todo. */
.plan-card .meter { display: block; grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.plan-card .meter span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.plan-card .meter-row.vacio .meter-count { color: var(--red); }
.plan-card .meter-row.vacio .meter span { background: var(--red); }
.plan-card .meter-row.ilimitado .meter-count { color: var(--ink-2); font-weight: 500; }
.plan-card-note { font-size: 13.5px; color: var(--ink-2); }
.plan-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-card .hint { margin-top: -6px; }

/* Correo y celular */
.contacto-form { display: flex; flex-direction: column; gap: 6px; }
.contacto-form .label { margin-top: 8px; }
.contacto-form input, .admin-form input {
  width: 100%; border: 1px solid var(--rule); background: var(--sheet); border-radius: 8px;
  padding: 11px 14px; font-size: 16px; color: var(--ink); outline: none;
}
.contacto-form input:focus { border-color: var(--ink-3); }
.contacto-form .btn, .admin-form .btn { align-self: flex-start; margin-top: 4px; }
.admin-form { display: flex; flex-direction: column; gap: 6px; max-width: 340px; }
.admin-form .login-field { margin-bottom: 0; }

/* Espacios de publicidad. Van separados del contenido para que nadie los confunda con el app. */
.ad-slot { display: block; max-width: 728px; margin: 28px auto 0; min-height: 0; }
.ad-slot ins { display: block; }
.ad-ph {
  display: grid; place-items: center; gap: 4px; min-height: 120px; padding: 20px;
  border: 1px dashed var(--rule); border-radius: 12px; color: var(--ink-3);
  font-size: 14px; text-align: center;
}
.ad-ph-sub { font-size: 12px; }

/* Aviso de que una parte del gradeo no se pudo medir */
.aviso-medida {
  border: 1px dashed var(--rule); border-radius: 12px; padding: 16px 18px; display: grid; gap: 8px;
}
.aviso-medida p { font-size: 14.5px; color: var(--ink-2); }
.aviso-medida b { color: var(--ink); }
.aviso-medida .hint { margin-top: 2px; }

.recap-acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.recap-acciones .recap-open { margin-top: 0; }

/* Pantalla de privacidad */
.dato { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.dato:last-of-type { border-bottom: 0; }
.dato-name { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.dato-value { font-size: 17px; font-weight: 650; margin: 3px 0 4px; word-break: break-word; }
.dato-value.vacio { color: var(--ink-3); font-weight: 500; }
.dato .muted { font-size: 13.5px; }

/* Interruptores de avisos */
.switches { display: grid; gap: 4px; }
.switches li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.switches span { font-size: 14.5px; color: var(--ink-2); }
.switch {
  flex: 0 0 auto; width: 46px; height: 27px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); padding: 0; position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.switch span {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--ink-3); transition: transform 0.15s, background 0.15s;
}
.switch[aria-checked="true"] { background: var(--ink); border-color: var(--ink); }
.switch[aria-checked="true"] span { transform: translateX(19px); background: var(--paper); }

/* Lista de enlaces de ayuda */
.links-list { display: grid; gap: 10px; }
.links-list a { font-size: 14.5px; }

/* Borrar la cuenta */
.setting.danger { border: 1px solid var(--red); }
.btn.danger { border-color: var(--red); color: var(--red); }

/* Términos cuando se releen desde Configuraciones */
.terms.leyendo { margin-top: 0; max-width: 700px; }
.terms.leyendo .terms-box { max-height: none; overflow: visible; }
.terms-sub { font-size: 15px; font-weight: 650; color: var(--ink-2); margin-top: 4px; }
.login-swap { margin-top: 20px; font-size: 14px; color: var(--ink-2); }
.seg button svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Planes */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1040px; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 460px; } }
.plan { background: var(--sheet); border: 1px solid transparent; border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--ink); }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan-name { font-size: 22px; font-weight: 740; font-stretch: 85%; }
.plan-tag { font-size: 12px; font-weight: 650; color: var(--red); white-space: nowrap; }
.plan-price { font-size: 44px; font-weight: 780; font-stretch: 74%; line-height: 1.1; letter-spacing: -0.015em; }
.plan-price small { margin-left: 4px; font-size: 15px; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--ink-3); }
.plan-tagline { color: var(--ink-2); font-size: 14.5px; }
.plan-features { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--rule); display: grid; gap: 9px; flex: 1; align-content: start; }
.plan-features li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: 14.5px; }
.plan-features svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--up); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.plan .btn { width: 100%; }
.chart { position: relative; margin-top: 4px; touch-action: pan-y; }
.chart-svg { display: block; overflow: visible; }
.chart-svg:focus { outline: none; }
.chart-svg:focus-visible { outline: 2px solid var(--chart); outline-offset: 4px; border-radius: 4px; }
.chart-grid { stroke: var(--rule-soft); stroke-width: 1; }
.chart-axis { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--chart); opacity: 0.1; }
.chart-dot { fill: var(--chart); stroke: var(--paper); stroke-width: 2; }
.chart-cross { stroke: var(--ink-3); stroke-width: 1; }
.chart-end { fill: var(--ink); font-size: 12.5px; font-weight: 650; }
.chart-tip {
  position: absolute; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--paper); border-radius: 6px; padding: 6px 9px;
  display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; font-size: 12px;
}
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: 14px; }
.chart-table table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 14px; }
.chart-table th { text-align: left; color: var(--ink-3); font-weight: 500; font-size: 12.5px; padding: 4px 0; }
.chart-table td { padding: 7px 0; border-top: 1px solid var(--rule-soft); }
.chart-table th:last-child, .chart-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Gráfica de la colección estilo Yahoo Finanzas */
.fin .sec-head { margin-bottom: 2px; }
.fin-value { font-size: clamp(30px, 5vw, 40px); font-weight: 760; font-stretch: 80%; line-height: 1.05; letter-spacing: -0.01em; }
.fin-change { margin-top: 2px; font-size: 15px; font-weight: 650; color: var(--ink-2); }
.fin-change.up { color: var(--up); }
.fin-change.down { color: var(--down); }
.fin-change span { margin-left: 6px; font-weight: 450; color: var(--ink-3); }
.ranges { display: flex; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.ranges::-webkit-scrollbar { display: none; }
.ranges button {
  flex: 1 0 auto; appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--ink-3); padding: 7px 10px; border-radius: 6px;
}
.ranges button:hover { color: var(--ink); }
.ranges button[aria-pressed="true"] { color: var(--ink); background: var(--rule-soft); }
/* Verde/rojo propios para líneas (validados contra el fondo claro, el beige de computadora y el oscuro). */
:root { --chart-up: #2E7D46; --chart-down: #B4371D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-up: #4FA06A; --chart-down: #D9644A; } }
:root[data-theme="dark"] { --chart-up: #4FA06A; --chart-down: #D9644A; }
.chart-svg.tone-up { --line: var(--chart-up); }
.chart-svg.tone-down { --line: var(--chart-down); }
.chart-svg .chart-line { stroke: var(--line, var(--chart)); }
.chart-svg .chart-area { fill: var(--line, var(--chart)); }
.chart-svg .chart-dot { fill: var(--line, var(--chart)); }

/* Mini gráfica por carta (plan Coleccionista) */
.spark { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.spark svg { flex: 1; min-width: 0; height: 22px; overflow: visible; }
.spark path { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark.up path { stroke: var(--chart-up); }
.spark.down path { stroke: var(--chart-down); }
.spark span { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.spark.up span { color: var(--up); }
.spark.down span { color: var(--down); }
.spark-empty { margin-top: 5px; font-size: 11.5px; color: var(--ink-3); }
/* La misma gráfica, pero grande: la de la carta recién escaneada. */
.spark.grande { gap: 14px; margin-top: 10px; }
.spark.grande svg { height: 86px; }
.spark.grande path { stroke-width: 2.5; }
.spark.grande span { font-size: 19px; }
.spark-sec .hint { margin-top: 8px; }

/* ¿La compro? */
.buscar-carta { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.buscar-carta .login-input { flex: 1; min-width: 220px; }

/* Los resultados del buscador de "¿La compro?": una fila tocable por carta */
.resultados { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.resultado {
  appearance: none; width: 100%; text-align: left; cursor: pointer; font: inherit;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet);
  padding: 12px 14px; color: var(--ink);
}
.resultado:hover { border-color: var(--ink-3); }
.resultado-foto { width: 54px; height: 75px; flex: none; border-radius: 4px; object-fit: contain; }
/* Cuando no hay foto (cartas de deportes) queda el mismo hueco, para que las filas no bailen */
.resultado-foto.sin-foto {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--rule); color: var(--ink-3); font-size: 18px;
}
.resultado-texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.resultado-nombre { font-size: 15.5px; font-weight: 700; font-stretch: 92%; }
.resultado-set { font-size: 13px; color: var(--ink-2); }
.resultado-nota { font-size: 12.5px; color: var(--ink-3); }
/* La foto grande de la carta ya elegida */
.compra-foto { display: block; width: min(220px, 55%); height: auto; border-radius: 8px; margin: 0 auto 16px; }
.veredicto { margin-top: 16px; border-radius: 14px; padding: 18px 20px; border: 1px solid var(--rule); background: var(--sheet); }
.veredicto-titulo { font-size: 26px; font-weight: 780; font-stretch: 84%; margin-bottom: 6px; }
.veredicto p { font-size: 15px; color: var(--ink-2); }
.veredicto-datos { margin-top: 10px; font-variant-numeric: tabular-nums; }
.veredicto-datos b { color: var(--ink); }
.veredicto.si { border-color: color-mix(in srgb, var(--up) 55%, transparent); background: color-mix(in srgb, var(--up) 10%, var(--sheet)); }
.veredicto.si .veredicto-titulo { color: var(--up); }
.veredicto.ojo { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.veredicto.no { border-color: color-mix(in srgb, var(--down) 55%, transparent); background: color-mix(in srgb, var(--down) 10%, var(--sheet)); }
.veredicto.no .veredicto-titulo { color: var(--down); }

/* Resumen de la semana */
.recap-link { font-weight: 600; font-size: 14.5px; text-decoration-color: var(--red); text-underline-offset: 3px; }
#col-history .sec { margin-top: 0; margin-bottom: 30px; }
.recap-list { display: grid; gap: 8px; }
.recap-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--sheet); text-decoration: none;
}
.recap-row:hover { box-shadow: inset 0 0 0 1px var(--rule); }
.recap-img { width: 52px; aspect-ratio: 5 / 7; border-radius: 4px; overflow: hidden; background: var(--rule-soft); }
.recap-img img { width: 100%; height: 100%; object-fit: cover; }
.recap-info { display: flex; flex-direction: column; min-width: 0; }
.recap-info b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-info small { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-info .recap-note { color: var(--ink-2); }
.recap-value { font-size: 20px; font-weight: 740; font-stretch: 85%; white-space: nowrap; }

/* Las que subieron y bajaron: carta grande con el porcentaje encima */
.recap-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
@media (max-width: 560px) { .recap-cards { grid-template-columns: 1fr 1fr; gap: 14px; } }
.recap-card { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }
.recap-card-img {
  position: relative; display: block; aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden;
  background: var(--rule-soft); box-shadow: 0 2px 10px rgb(0 0 0 / 0.12);
}
.recap-card-img img { width: 100%; height: 100%; object-fit: cover; }
.recap-card-pct {
  position: absolute; left: 9px; bottom: 9px; padding: 6px 12px; border-radius: 999px;
  font-size: 17px; font-weight: 800; font-stretch: 85%; color: #fff; background: var(--up);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.35); font-variant-numeric: tabular-nums;
}
.recap-card-pct.down { background: var(--down); }
.recap-card-name { font-weight: 650; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-card-set { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend.small { margin: 0; gap: 6px; }
.trend.small .trend-icon { width: 30px; height: 19px; }
.trend.small .trend-pct { font-size: 21px; }
.box-card { background: var(--sheet); border-radius: 12px; padding: 18px 20px; display: grid; gap: 8px; }
.box-name { font-size: 22px; font-weight: 740; font-stretch: 85%; line-height: 1.15; }
.box-name a { text-decoration-color: var(--red); text-underline-offset: 3px; }
.box-price { font-size: 17px; font-weight: 650; }
.box-hits { color: var(--ink-2); }
.box-alts { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 4px; font-size: 14.5px; }
.box-img { width: 100%; max-width: 320px; max-height: 220px; object-fit: contain; border-radius: 8px; background: var(--paper); padding: 8px; }
.box-hits b { color: var(--ink); }
.box-buy { justify-self: start; }
.recap-open { margin-top: 16px; }

/* Resumen tipo historia: siempre oscuro, como las historias de otras apps */
body.story-open { overflow: hidden; }
.story { position: fixed; inset: 0; z-index: 70; display: flex; }
.story[hidden] { display: none; }
.story-frame {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column;
  background: #1D1B17; color: #F1ECE3;
  padding: calc(12px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 861px) {
  .story { background: rgb(10 9 8 / 0.72); align-items: center; justify-content: center; padding: 20px; }
  .story-frame { width: min(460px, 100%); height: min(860px, calc(100dvh - 40px)); border-radius: 18px; padding: 16px 20px 20px; }
}
.story-bars { display: flex; gap: 4px; padding-right: 36px; }
.story-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgb(241 236 227 / 0.25); }
.story-bars span.on { background: #F1ECE3; }
.story-close {
  position: absolute; top: calc(2px + env(safe-area-inset-top)); right: 8px;
  appearance: none; background: none; border: 0; color: #F1ECE3; font-size: 18px; padding: 10px; cursor: pointer;
}
@media (min-width: 861px) { .story-close { top: 4px; } }
.story-slide { flex: 1; overflow-y: auto; padding: 28px 2px 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.story-slide a, .story-slide img { cursor: auto; }
.story-kicker { font-size: 13px; font-weight: 700; color: #E2583C; }
.story-title { font-size: 34px; font-weight: 780; font-stretch: 78%; line-height: 1.02; letter-spacing: -0.01em; }
.story-label { margin-top: 18px; font-size: 14px; color: rgb(241 236 227 / 0.7); }
.story-big { font-size: 56px; font-weight: 800; font-stretch: 72%; line-height: 1; letter-spacing: -0.015em; }
.story-sub { font-size: 19px; font-weight: 700; }
.story-sub.up, .story-pct.up { color: #72B886; }
.story-sub.down, .story-pct.down { color: #E77A5F; }
.story-note { font-size: 15px; color: rgb(241 236 227 / 0.72); }
.story-text { font-size: 15.5px; line-height: 1.45; }
.story-text b { color: #fff; }
.story-empty { margin-top: 14px; font-size: 16px; color: rgb(241 236 227 / 0.72); }
/* Dos por fila en vez de tres: la carta se ve al doble de grande. */
.story-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.story-card { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.story-card-img { aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; background: rgb(241 236 227 / 0.1); }
.story-card-img img { width: 100%; height: 100%; object-fit: cover; }
.story-pct { display: flex; align-items: center; gap: 4px; font-size: 21px; font-weight: 800; font-stretch: 78%; }
.story-pct .trend-icon { width: 24px; height: 16px; }
.story-pct.down .trend-icon { transform: scaleY(-1); }
.story-card figcaption { font-size: 13px; line-height: 1.2; color: rgb(241 236 227 / 0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-box { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.story-box-img { width: 100%; max-height: 230px; object-fit: contain; border-radius: 10px; background: #F1ECE3; padding: 10px; }
.story-box-name { font-size: 21px; font-weight: 750; font-stretch: 85%; line-height: 1.15; }
.story-buy {
  display: block; margin-top: 4px; padding: 14px; border-radius: 10px; text-align: center; text-decoration: none;
  background: #F1ECE3; color: #1D1B17; font-weight: 700;
}
.story-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.story-nav button {
  appearance: none; font: inherit; font-weight: 650; padding: 13px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgb(241 236 227 / 0.35); background: none; color: #F1ECE3;
}
.story-nav button:last-child { background: #F1ECE3; border-color: #F1ECE3; color: #1D1B17; }
.story-nav button:disabled { opacity: 0.35; cursor: default; }

.registro .login-swap { text-align: center; }

/* Aviso de suscripción cancelada: se queda en la tarjeta del plan, no desaparece como un cartelito. */
.plan-cancelada { border: 1px solid var(--rule); border-left: 3px solid var(--ink); background: var(--sheet); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }

/* Defecto largo (una raya que cruza la carta): óvalo que cubre toda la zona, no un círculo en un punto. */
.crop-mark.oval, .ring.oval { aspect-ratio: auto; min-width: 12px; min-height: 12px; border-width: 2.5px; }
.crop.entera { aspect-ratio: auto; height: auto; }
.zoom-full { overflow: hidden; border-radius: 6px; }

/* Paquetes de pago único (escaneos y gradeos que se compran una vez y no vencen) */
.paquetes { margin-top: 30px; }
.paquetes .lede { margin-bottom: 12px; }
.paquetes-tienes { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.paquetes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.paquete { background: var(--sheet); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.paquete-nombre { font-size: 18px; font-weight: 740; font-stretch: 85%; }
.paquete-trae { font-size: 14.5px; color: var(--ink-2); }
.paquete-precio { font-size: 30px; font-weight: 780; font-stretch: 80%; line-height: 1.05; margin-top: 4px; }
.paquete-unidad { font-size: 12.5px; color: var(--ink-3); flex: 1; }
.paquete .btn { margin-top: 8px; }
.paquetes .apagado { opacity: 0.55; pointer-events: none; }
.paquete-diy, .paquete-guardados { background: var(--sheet); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.paquete-diy h3, .paquete-guardados h3 { font-size: 18px; font-weight: 740; font-stretch: 85%; margin-bottom: 6px; }
.diy-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.diy-fila label { font-weight: 650; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.stepper input { width: 78px; text-align: center; font: inherit; font-size: 18px; font-weight: 700; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.diy-total { font-size: 26px; font-weight: 780; font-stretch: 85%; margin: 14px 0 2px; }
.diy-guardar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.diy-guardar input { flex: 1; min-width: 180px; font: inherit; font-size: 15px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
.paquete-guardados ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.paquete-guardado { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.paquete-guardado div { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.paquete-guardado span { font-size: 13px; color: var(--ink-3); }
.paquete-guardado div { flex: 1 1 100%; }

/* La pantalla de pago: resumen a un lado, método de pago al otro (una sola columna en el celular). */
body.caja-abierta { overflow: hidden; }
.caja { position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: var(--paper); color: var(--ink); -webkit-overflow-scrolling: touch; animation: caja-entra .22s ease-out; }
@keyframes caja-entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .caja { animation: none; } }
.caja-marco { max-width: 980px; margin: 0 auto; padding: env(safe-area-inset-top) 16px calc(40px + env(safe-area-inset-bottom)); }
.caja-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.caja-volver { appearance: none; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 8px 4px; }
.caja-volver:hover { color: var(--ink); }
.caja-seguro { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.caja-seguro::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--up); }
.caja-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 820px) { .caja-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; } .caja-marco { padding: 0 32px 56px; } }
.caja-resumen, .caja-pago { border: 1px solid var(--rule); border-radius: 20px; background: var(--sheet); padding: 26px 22px; }
.caja-titulo { font-size: clamp(28px, 5vw, 38px); font-weight: 780; font-stretch: 82%; line-height: 1.1; margin-top: 4px; }
.caja-precio { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.caja-precio strong { font-size: clamp(34px, 7vw, 46px); font-weight: 780; letter-spacing: -.02em; }
.caja-precio span { color: var(--ink-2); font-size: 15px; }
.caja-lista { list-style: none; margin: 0 0 16px; padding: 16px 0 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.caja-lista li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.caja-lista li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 11px; height: 6px; border-left: 2px solid var(--up); border-bottom: 2px solid var(--up); transform: rotate(-45deg); }
.caja-nota { font-size: 13px; color: var(--ink-3); line-height: 1.45; margin-top: 8px; }
.caja-nota.centrado { text-align: center; margin-top: 16px; }
.caja-h { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.caja-metodos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.caja-metodo { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.caja-metodo:hover { border-color: var(--ink-3); }
.caja-metodo[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.caja-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; }
.caja-metodo[aria-checked="true"] .caja-radio { border-color: var(--ink); }
.caja-metodo[aria-checked="true"] .caja-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.caja-ico { flex: none; width: 54px; display: grid; place-items: center; color: var(--ink-2); }
.caja-pp { font-weight: 800; font-style: italic; font-size: 16px; color: #003087; letter-spacing: -.02em; }
:root[data-theme="dark"] .caja-pp { color: #6fa3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .caja-pp { color: #6fa3ff; } }
.caja-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.caja-txt strong { font-size: 15px; font-weight: 700; }
.caja-txt small { font-size: 13px; color: var(--ink-3); }
.caja-accion[hidden] { display: none; }
.caja-accion .pagar-lemon { margin-top: 0; min-height: 50px; font-size: 16px; }

/* Lo que te queda de paquetes, en grande dentro de "Tu plan". */
.extras-grande { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.extras-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 6px; }
.extras-nums div { border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.extras-nums strong { font-size: 34px; font-weight: 780; line-height: 1.05; letter-spacing: -.02em; }
.extras-nums span { font-size: 14px; color: var(--ink-2); }
