/* Mobile first: los estilos base son para celular; los @media agrandan. Sin librerías; una sola fuente, autoalojada. */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght.woff2") format("woff2");
}
/* Sistema de diseño: todo sale de estas variables. Colores con contraste de texto ≥ 4,5:1 sobre el fondo (WCAG AA). */
:root {
  --bg: #f3f5f9; --surface: #fff; --surface-2: #f7f9fc; --text: #0d1522; --muted: #556070; --line: #e2e8f0;
  --accent: #3b52e0; --buy: #3b52e0; --sell: #047857; --up: #047857; --down: #c9353a; --amber: #9a4a06;
  --up-bg: #e3f6ee; --down-bg: #fdeaea; --amber-bg: #fdf1dc;
  /* espacios (múltiplos de 4), radios y letra */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 8px; --r-md: 12px; --r: 16px; --pill: 999px;
  --t-2xs: .6875rem; --t-xs: .75rem; --t-sm: .8125rem; --t-md: .875rem; --t-base: .9375rem; --t-lg: 1.125rem; --t-xl: 1.5rem; --t-num: 1.75rem; --t-2xl: 2.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --shadow: 0 1px 2px rgba(13, 21, 34, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090e17; --surface: #111826; --surface-2: #151e2f; --text: #e8edf6; --muted: #97a3b6; --line: #1f2a3d;
    --accent: #7c93ff; --buy: #7c93ff; --sell: #34d399; --up: #34d399; --down: #ff6b70; --amber: #f5b041;
    --up-bg: #0f2c22; --down-bg: #361a1d; --amber-bg: #33270f;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
/* como una app: sin zoom (pellizco ni doble toque) y sin seleccionar texto, salvo en los campos donde se escribe */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: -.02em; text-wrap: balance; }
p, li, .note, .lead { text-wrap: pretty; }
em, i { font-style: normal; }
button, input { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }                 /* con menos, el iPhone hace zoom solo al tocar el campo */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3, p { margin: 0; }
.num, .cell, .r-pct, .leg .p, .r-gain b, .vrow > b, .amount .tot b, .price .v, td, input { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand svg { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--up); }
.dot.stale, .dot.stale::after { background: var(--down); }
/* anillo alrededor del punto: se llena hasta la próxima consulta de precios */
.dot::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--up) calc(var(--p, 0) * 360deg), color-mix(in srgb, var(--up) 16%, transparent) 0);
  -webkit-mask: radial-gradient(circle, transparent 5.2px, #000 5.8px); mask: radial-gradient(circle, transparent 5.2px, #000 5.8px); }
.dot.stale::before { display: none; }
.status #updated { font-variant-numeric: tabular-nums; }
.status { cursor: pointer; border-radius: var(--pill); padding: 4px 8px; margin-right: -8px; transition: background .2s; }
@media (hover: hover) { .status:hover { background: color-mix(in srgb, var(--line) 60%, transparent); } }
.status.busy .dot::before { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.notice { margin: 4px 0 8px; padding: 9px 12px; border-radius: var(--r-md); background: var(--amber-bg); color: var(--amber); font-size: var(--t-md); }

/* contenido pre-renderizado (se ve igual si JS no carga) */
[data-ssr] h1 { font-size: var(--t-xl); letter-spacing: -.01em; margin: 8px 0; }
[data-ssr] h2 { font-size: 1rem; margin: 20px 0 6px; }
[data-ssr] .lead { color: var(--muted); }
[data-ssr] table { width: 100%; border-collapse: collapse; margin-top: 6px; }
[data-ssr] caption { text-align: left; color: var(--muted); font-size: var(--t-sm); padding-bottom: 6px; }
[data-ssr] th, [data-ssr] td { text-align: right; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
[data-ssr] th:first-child { text-align: left; }

/* controles */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--line); border-radius: var(--pill); }
.seg button { min-height: 34px; padding: 0 14px; border-radius: var(--pill); font-size: var(--t-md); font-weight: 600; color: var(--muted); transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg.lg button { min-height: 42px; font-size: var(--t-base); }
.pairs { position: sticky; top: 0; z-index: 5; display: flex; margin: 0 -16px; padding: 8px 16px; background: var(--bg); }
.pairs .seg { width: 100%; }
.sec { margin-top: var(--s6); }
.sec-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.sec-h h2 { font-size: var(--t-base); font-weight: 650; color: var(--text); letter-spacing: -.01em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.chip { flex: none; padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); font-size: var(--t-sm); color: var(--muted); white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.chip b { color: var(--text); font-weight: 650; margin-left: 4px; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scroll-padding-inline: 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.scroll::-webkit-scrollbar { display: none; }
.scroll > * { scroll-snap-align: start; }

/* variación: ▲ verde / ▼ rojo (siempre con flecha: no depende solo del color) */
.chg { display: inline-flex; align-items: center; gap: 2px; font-size: var(--t-xs); font-weight: 650; padding: 1px 7px; border-radius: var(--pill); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--up); background: var(--up-bg); } .chg.dn { color: var(--down); background: var(--down-bg); } .chg.fl { color: var(--muted); background: var(--line); }
.chg small { font-weight: 500; margin-left: 3px; }
.mi { font-size: var(--t-2xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.mi.up { color: var(--up); } .mi.dn { color: var(--down); }

/* precios principales */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.price { position: relative; overflow: hidden; padding: 14px 14px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.price.buy { --c: var(--buy); } .price.sell { --c: var(--sell); }
.price .l { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; font-size: var(--t-sm); font-weight: 600; color: var(--muted); min-height: 22px; }
.price .v { display: flex; align-items: baseline; width: fit-content; margin: 4px 0 2px; border-radius: var(--r-sm); color: var(--c); }
.price .cur { align-self: flex-start; margin: .32em 2px 0 0; font-size: var(--t-base); font-weight: 600; }
.price .int { font-size: clamp(1.5rem, 7.6vw, 2.2rem); font-weight: 680; letter-spacing: -.035em; line-height: 1.08; }
.price .dec { font-size: var(--t-base); font-weight: 600; color: var(--muted); }
.price .s { font-size: var(--t-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp { height: 28px; margin: 6px -2px 0; }
.sp svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark { fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.amount { --pad: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: var(--s3); padding: var(--pad) var(--pad) var(--pad) 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-md); }
.amount label { color: var(--muted); font-weight: 600; }
.amount input { width: 96px; padding: 6px 10px; border-radius: calc(var(--r-md) - var(--pad)); border: 1px solid var(--line); background: var(--surface); text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.amount .unit { color: var(--muted); }
.amount .tot { flex: 1 1 100%; padding: 0 0 4px; color: var(--muted); }
.amount .tot b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

.banner { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 12px 14px; text-align: left; border-radius: var(--r-md); background: var(--up-bg); color: var(--up); border: 1px solid color-mix(in srgb, var(--up) 35%, transparent); }
.banner .b-main { flex: 1; min-width: 0; }
.banner strong { font-size: var(--t-lg); }
.banner small { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner .cta { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 10px 0 14px; border-radius: var(--pill); background: var(--up); color: #fff; font-size: var(--t-md); font-weight: 650; }
.take { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: var(--t-base); color: var(--muted); }
.take b { color: var(--accent); font-weight: 700; }

/* gráfico */
.ctrls { display: flex; gap: 8px; flex-wrap: wrap; }
.ctrls .seg button { min-height: 28px; padding: 0 11px; font-size: var(--t-sm); }
.chartbox { position: relative; padding: 8px 4px 4px; min-height: 180px; }
.chartbox svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chartbox .empty { padding: 56px 16px; text-align: center; color: var(--muted); font-size: var(--t-md); }
.axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.grid { stroke: var(--line); stroke-width: 1; }
.line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.line.buy { stroke: var(--buy); } .line.sell { stroke: var(--sell); }
.thr { stroke: var(--down); stroke-width: 1.2; stroke-dasharray: 5 4; }
.cursor { stroke: var(--muted); stroke-width: 1; }
.tip { position: absolute; top: 6px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; font-size: var(--t-xs); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); white-space: nowrap; display: none; z-index: 2; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: var(--t-xs); color: var(--muted); margin: 8px 8px 4px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.buy { background: var(--buy); } .legend i.sell { background: var(--sell); } .legend i.thr { background: var(--down); }
.legend { flex-wrap: wrap; }

/* lista de plataformas */
.list { overflow: hidden; }
.cols, .rowbtn { display: grid; grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 6px; align-items: center; width: 100%; padding: 0 14px; text-align: right; }
.cols { padding-block: 9px; border-bottom: 1px solid var(--line); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.cols button { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; text-align: right; min-height: 24px; }
.cols button:first-child { text-align: left; } .cols button[aria-sort] { color: var(--text); }
.cols > span:first-child { text-align: left; }
.cols.c4, .rowbtn.c4 { grid-template-columns: minmax(0, 1fr) 72px 50px 72px; gap: 4px; }
.rowbtn.c4 .cell { font-size: var(--t-sm); }
.cols.c4 { letter-spacing: .02em; } .cols.c4 span { white-space: nowrap; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { border-bottom: 1px solid var(--line); } .row:last-child { border-bottom: 0; }
.rowbtn { min-height: 56px; padding-block: 6px; font-size: var(--t-base); transition: background .2s; }
.rowbtn:active { background: color-mix(in srgb, var(--line) 60%, transparent); }
.rowbtn.static, .rowbtn.static:hover, .rowbtn.static:active { background: none; cursor: default; }
[data-flip] { position: relative; } .row { background: var(--surface); }      /* lo que se desliza pasa por encima, sin transparencias */
.name { display: flex; align-items: center; gap: 9px; min-width: 0; text-align: left; }
.name .t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.name .t span:first-child { overflow-wrap: anywhere; font-weight: 550; }
.av { flex: none; width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: var(--t-xs); font-weight: 800; color: #fff; background: hsl(var(--h, 220) 55% 46%); }
.tag { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.tag.risk { color: var(--down); }
.book { margin-top: 8px; }
.book .bh { font-size: var(--t-xs); font-weight: 600; color: var(--text); margin-bottom: 4px; }
.brow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.brow .bm { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow.off { opacity: .6; }
.how { margin-top: 10px; font-size: var(--t-sm); color: var(--muted); }
.how summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.how ol { margin: 8px 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: var(--t-sm); }
.filters { margin-top: 10px; }
.fbody { display: grid; gap: 12px; padding: 14px; }
.fbody .switch { justify-content: space-between; color: var(--text); }
.fbody .frow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--t-sm); }
.fbody .frow .seg button { min-height: 28px; padding: 0 11px; font-size: var(--t-sm); }
.picker { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tag.still { color: var(--amber); }
.tag.live { color: var(--up); white-space: nowrap; }
.tag.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.tag.star { color: #e8a317; font-size: var(--t-xs); margin-left: 4px; }
.starbtn { justify-self: start; margin-top: 4px; }
button.chip.starbtn[aria-pressed="true"] { background: color-mix(in srgb, #e8a317 18%, var(--surface)); border-color: color-mix(in srgb, #e8a317 45%, var(--line)); color: var(--text); }
.warn { color: var(--amber); }
.btn.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, var(--line)); }
.rep { margin-top: 8px; font-size: var(--t-xs); color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.rep.done { text-decoration: none; color: var(--up); }
.row2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--t-md); }
.note.adj { color: var(--accent); }
.ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.picker .note { margin-top: 0; }
.plats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip.plat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 4px; color: var(--text); }
.chip.plat .av { width: 22px; height: 22px; border-radius: 7px; font-size: .5625rem; }
.alarm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: var(--t-sm); color: var(--muted); }
.alarm small { flex: 1 1 100%; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.av.logo { background: #fff; padding: 3px; box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .25); }
.av.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: calc(var(--r-sm) - 3px); display: block; }
.cell { display: flex; flex-direction: column; align-items: flex-end; padding: 2px 0; border-radius: var(--r-sm); line-height: 1.25; }
.cell.best.ask { color: var(--buy); font-weight: 750; } .cell.best.bid { color: var(--sell); font-weight: 750; }
.cell.none { color: var(--muted); }
.detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.row.open .detail { grid-template-rows: 1fr; }
.detail > div { overflow: hidden; }
.detail .in { padding: 0 14px 12px 53px; font-size: var(--t-sm); color: var(--muted); display: grid; gap: 6px; }
.methods { display: flex; flex-wrap: wrap; gap: 6px; }
.methods span { padding: 1px 8px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-xs); }
.old { color: var(--down); }

/* rutas */
.routes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.route { min-width: 0; padding: 14px 16px; }
.route.pos { border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.r-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.r-pct { font-size: var(--t-num); font-weight: 700; letter-spacing: -.03em; }
.routes > .route:first-child { padding: var(--s4) var(--s4) var(--s3); }
.routes > .route:first-child .r-pct { font-size: var(--t-2xl); line-height: 1.05; }
.r-pct.up { color: var(--up); } .r-pct.dn { color: var(--down); } .r-pct.fl { color: var(--muted); }
.r-sub { font-size: var(--t-sm); color: var(--muted); }
.r-legs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0; }
.leg { display: flex; align-items: center; gap: 10px; min-width: 0; }
.leg .t { flex: 1; min-width: 0; line-height: 1.25; }
.leg .t small { display: block; color: var(--muted); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg .p { flex: none; font-weight: 700; white-space: nowrap; }
.r-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.r-foot b { color: var(--text); font-weight: 650; }
.rkind { margin-bottom: 10px; } .rkind .seg { width: 100%; }
/* Rutas: cuánto ganás o perdés con tu monto */
.r-gain { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: var(--t-md); color: var(--muted); }
.r-gain b { font-weight: 700; } .r-gain b.up { color: var(--up); }
/* Rutas: arriba la respuesta en una línea; debajo, el monto y «Ajustes» (lo demás queda adentro) */
.answer { margin: 4px 2px 12px; font-size: var(--t-base); font-weight: 600; color: var(--muted); }
.answer.good { color: var(--up); } .answer.warn { color: var(--amber); }
.rbar { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.amini { --pad: 5px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: var(--pad) 12px var(--pad) 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.amini input { flex: 1; min-width: 0; width: 70px; max-width: 180px; padding: 6px 10px; border-radius: calc(var(--r-md) - var(--pad)); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.amini input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.amini span { font-weight: 500; white-space: nowrap; }
.chip.setbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--r-md); font-weight: 600; color: var(--text); }
.chip.setbtn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.setbtn b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0; padding: 0 5px; border-radius: var(--pill); background: var(--accent); color: #fff; font-size: var(--t-2xs); }
.chip.setbtn[aria-expanded="true"] b { background: #fff; color: var(--accent); }
#ajustes { margin: 0 0 12px; }
.btn.more { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 42px; margin-top: 12px; }
/* herramientas plegadas: una línea cada una; se arman y se abren a un toque */
.folds { display: grid; gap: var(--s2); margin-top: var(--s5); }
.folds:empty { display: none; }
.sec .fold { margin-top: 10px; }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 16px; cursor: pointer; list-style: none; font-size: var(--t-base); font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .3s var(--ease), margin .3s var(--ease); }
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.fin { --pad: 12px; display: grid; gap: 10px; padding: 0 var(--pad) var(--pad); }
.fin > * { margin-top: 0; margin-bottom: 0; }
.fin .card { background: var(--surface-2); box-shadow: none; border-radius: calc(var(--r) - var(--pad)); }
/* conversor (pestaña Dólar) */
.route.tri .r-legs { gap: 10px; }
.via { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 14px; }
.vrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: var(--t-md); }
.vrow .vl { color: var(--muted); }
.vrow > b { font-size: var(--t-lg); font-weight: 680; }
.vrow small { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-xs); }
.vrow small b { color: var(--text); font-weight: 650; } .vrow small b.up { color: var(--up); }
.card.pad { padding: 14px 16px; display: grid; gap: 12px; }
.vrow > span > small { display: block; margin-top: 2px; }
.vrow > a { font-size: var(--t-xs); white-space: nowrap; }
.via > .note { margin: 0; font-size: var(--t-xs); }
.badge { display: inline-flex; padding: 2px 10px; border-radius: var(--pill); font-size: var(--t-xs); font-weight: 700; }
.badge.operar { background: var(--up-bg); color: var(--up); } .badge.con_cautela { background: var(--amber-bg); color: var(--amber); } .badge.descartar { background: var(--down-bg); color: var(--down); }
.ai { margin-top: var(--s3); font-size: var(--t-md); }
.ai p { margin-top: 6px; } .ai .risk { color: var(--muted); font-size: var(--t-sm); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--muted); }
.switch button { position: relative; width: 38px; height: 22px; border-radius: var(--pill); background: var(--line); transition: background .25s; }
.switch button::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch button[aria-pressed="true"] { background: var(--accent); } .switch button[aria-pressed="true"]::after { transform: translateX(16px); }
.note { font-size: var(--t-sm); color: var(--muted); margin-top: 10px; }

/* dólar */

/* barra inferior: siempre abajo, fija y flotando sobre la página; plana, con el mismo borde y superficie que las tarjetas */
.nav {
  position: fixed; z-index: 30; left: 0; right: 0; margin-inline: auto; bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), calc(var(--n, 3) * 112px)); display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 4px; padding: 6px;
  border-radius: var(--pill); isolation: isolate; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 6px 20px rgba(13, 21, 34, .10);
}
.nav button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: var(--pill); font-size: var(--t-2xs); font-weight: 650; color: var(--muted); transition: background .25s var(--ease), color .25s var(--ease), transform .15s var(--ease); }
.nav button svg { width: 20px; height: 20px; }
.nav button[aria-current="page"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .nav { box-shadow: 0 6px 20px rgba(0, 0, 0, .45); } }

/* pie */
.foot { margin-top: 28px; }
.foot details, .dd { border-top: 1px solid var(--line); padding: 12px 0; }
.dd { margin-top: 18px; }
.foot summary, .dd summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--t-md); color: var(--muted); list-style: none; min-height: 32px; }
.foot summary::-webkit-details-marker, .dd summary::-webkit-details-marker { display: none; }
.foot summary::before, .dd summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s var(--ease); }
.foot details[open] > summary::before, .dd[open] > summary::before { transform: rotate(45deg); }
.foot details > :not(summary), .dd > :not(summary) { margin-top: 8px; font-size: var(--t-md); color: var(--muted); }
.foot h3 { font-size: var(--t-md); color: var(--text); margin-top: 12px; }
.foot ul, .dd ul { padding-left: 18px; margin: 8px 0 0; }
.meta { font-size: var(--t-xs); color: var(--muted); margin-top: 12px; }
.legal { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: var(--t-sm); }
.legal a { color: var(--muted); text-underline-offset: 3px; }
@media (hover: hover) { .legal a:hover { color: var(--accent); } }

/* páginas de texto (términos, privacidad y 404): sin JS, solo este CSS */
.page .wrap { max-width: 760px; padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
.top .back { font-size: var(--t-md); font-weight: 600; color: var(--accent); text-decoration: none; }
.doc { margin-top: 6px; padding: 22px 18px 26px; }
.doc h1 { font-size: var(--t-num); line-height: 1.15; letter-spacing: -.03em; }
.doc .upd { margin-top: 6px; font-size: var(--t-sm); color: var(--muted); }
.doc .tldr { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.doc .tldr b { font-size: var(--t-sm); font-weight: 650; color: var(--accent); }
.doc .tldr ul { margin-top: 6px; }
.doc h2 { margin-top: 28px; font-size: var(--t-lg); letter-spacing: -.01em; }
.doc p, .doc li { font-size: var(--t-base); line-height: 1.6; color: color-mix(in srgb, var(--text) 80%, var(--muted)); }
.doc p { margin-top: 8px; }
.doc ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.doc li b { color: var(--text); font-weight: 650; }
.doc a { color: var(--accent); text-underline-offset: 2px; }
.doc .law { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-sm); color: var(--muted); }
.nf { display: grid; gap: 14px; justify-items: center; padding: 28px 0 8px; text-align: center; }
.nf-code { display: flex; align-items: center; gap: 6px; font-size: 5.5rem; font-weight: 800; line-height: 1; letter-spacing: -.06em; color: var(--accent); }
.nf-loop { width: .82em; height: .82em; }
.nf h1 { font-size: var(--t-xl); letter-spacing: -.03em; }
.nf .lead { max-width: 34ch; color: var(--muted); }
.nf-go { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 6px; }
.nf-go a { display: grid; gap: 2px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; text-decoration: none; color: var(--text); transition: transform .3s var(--ease), border-color .3s; }
.nf-go a:nth-child(2) { } .nf-go a:nth-child(3) { } .nf-go a:nth-child(4) { }
.nf-go b { font-weight: 650; }
.nf-go span { font-size: var(--t-sm); color: var(--muted); line-height: 1.35; }
@media (hover: hover) { .nf-go a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); } }
.nf .btn.wide { max-width: 320px; margin-top: 4px; }


/* píldora que se desliza hasta la opción elegida (selectores y barra de abajo) */
.seg { position: relative; isolation: isolate; }          /* la barra de abajo ya es fixed: no tocarle el position */
.seg::before, .nav::before { content: ""; position: absolute; z-index: -1; left: 0; width: var(--w, 0); transform: translateX(var(--x, 0)); border-radius: var(--pill); opacity: 0; transition: transform .45s var(--spring), width .45s var(--spring); }
.seg::before { top: 3px; bottom: 3px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.nav::before { top: 6px; bottom: 6px; background: var(--accent); }
.seg.glide::before, .nav.glide::before { opacity: 1; }
.seg.still::before, .nav.still::before { transition: none; }
.seg.glide button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.nav.glide button[aria-current="page"] { background: transparent; }

/* toques: lo que se aprieta se hunde apenas */
button, .chip { transition: transform .15s var(--ease), background .2s, color .2s, border-color .2s, box-shadow .2s; }
button:active:not(:disabled):not(.rowbtn):not(.cols button), .chip:active { transform: scale(.96); }
.cols button .ar { display: inline-block; margin-left: 3px; transition: transform .35s var(--spring); }
.cols button[aria-sort="descending"] .ar { transform: rotate(180deg); }

.switch button::after { transition: transform .35s var(--spring); }

/* «Paso a paso», filtros y fichas se despliegan suave (donde el navegador lo permite) */
:root { interpolate-size: allow-keywords; }
details::details-content { block-size: 0; overflow-y: clip; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
details[open]::details-content { block-size: auto; }
.how summary { list-style: none; } .how summary::-webkit-details-marker { display: none; }
.how summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.how summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s var(--ease); }
.how[open] summary::before { transform: rotate(45deg); }

/* Íconos: un solo estilo (trazo de 2 px sobre 24×24, como los de la barra de abajo), del tamaño del texto que acompañan */
.ic { flex: none; width: 1.05em; height: 1.05em; vertical-align: -.16em; }
.ic.on { fill: currentColor; }
.tag.star { display: inline-flex; color: #c98a0c; }

/* Cargando: la forma de la pantalla en gris mientras llegan los precios (mejor que una pantalla vacía) */
.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--line) 0 40%, var(--surface-2) 50%, var(--line) 60% 100%); background-size: 300% 100%; animation: sk 1.4s linear infinite; }
.sk-hero { height: 128px; border-radius: var(--r); }
.sk-row { height: 56px; margin-top: var(--s2); border-radius: var(--r-md); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* un botón que está esperando la respuesta muestra que está trabajando */
.btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* Feedback útil y corto (nada decorativo): un precio que cambió se tiñe un instante del color de la suba o la baja; lo que
   confirma una acción (guardado, copiado, reportado) aparece suave. */
.up.fx { --flash: color-mix(in srgb, var(--up) 20%, transparent); } .dn.fx { --flash: color-mix(in srgb, var(--down) 18%, transparent); }
.fx { border-radius: var(--r-sm); animation: tint .9s var(--ease); }
@keyframes tint { from { background: var(--flash); } to { background: transparent; } }
.msg, .copy.done::after, .rep.done, .ok-in { animation: pop-in .22s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .status.busy .dot::before, .btn[aria-busy="true"]::after { animation: none !important; }
}

/* Vista previa del aviso (Alertas): cómo te llega, con los precios de ahora */
.preview { display: grid; gap: 2px; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--t-md); }
.preview .ph { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--muted); }
.preview b { font-weight: 650; }

@media (min-width: 720px) {
  .wrap { max-width: 760px; }
  .hero { gap: 16px; } .price { padding: 18px 20px 12px; }
  .cols, .rowbtn { grid-template-columns: minmax(0, 1fr) 130px 130px; padding-inline: 18px; }
  .cols.c4, .rowbtn.c4 { grid-template-columns: minmax(0, 1fr) 110px 80px 110px; }
  .detail .in { padding-left: 60px; }
  .pairs { margin-inline: 0; padding-inline: 0; background: none; }
  .pairs .seg { width: auto; }
  .scroll { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .rowbtn:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
}

/* ── v3: alertas (suscripción), layout de escritorio y detalles ─────────────── */
.alert-card { padding: 18px 16px; }
.alert-card h2 { font-size: var(--t-xl); letter-spacing: -.02em; margin-bottom: var(--s3); }
.alert-card .preview + .lead { margin-top: var(--s4); }
.alert-card .lead { color: var(--muted); font-size: var(--t-base); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { position: relative; padding-left: 38px; font-size: var(--t-base); color: var(--muted); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: var(--t-sm); font-weight: 700; background: var(--accent); color: #fff; }
.steps li b { color: var(--text); font-weight: 600; }
.copy { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: var(--pill); border: 1px dashed var(--line); background: var(--surface-2); font-size: var(--t-sm); color: var(--text); word-break: break-all; text-align: left; }
.copy::after { white-space: nowrap; content: "copiar"; font-size: var(--t-xs); font-weight: 650; color: var(--accent); }
.copy.done::after { content: "¡copiado!"; color: var(--up); }
.form { display: grid; gap: 12px; margin-top: 18px; }
.field { display: grid; gap: 5px; }
.field label { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.field input[type="tel"], .field input[type="text"] { width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 1rem; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field .hint { font-size: var(--t-xs); color: var(--muted); }
.otp { text-align: center; font-size: var(--t-num) !important; letter-spacing: .5em; font-weight: 650; padding-left: calc(14px + .5em) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 650; transition: transform .15s var(--ease), opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.msg { padding: 10px 12px; border-radius: var(--r-md); font-size: var(--t-md); }
.msg.err { background: var(--down-bg); color: var(--down); }
.msg.ok { background: var(--up-bg); color: var(--up); }
.done { text-align: center; padding: 24px 8px 8px; }
.done .big { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%; background: var(--up-bg); color: var(--up); font-size: var(--t-xl); }
.fine { margin-top: 16px; font-size: var(--t-xs); color: var(--muted); }
/* Alertas: el canal elegido arriba y solo lo suyo; lo secundario, plegado en una línea */
.seg.chans { display: grid; width: 100%; margin-top: 14px; }
.chan { display: grid; gap: 12px; margin-top: 16px; }
.chan > .lead, .chan > .form, .chan > .steps, .chan > .fine { margin-top: 0; }
.chan .hint { font-size: var(--t-xs); color: var(--muted); }
.chan .form > .switch { justify-content: space-between; color: var(--text); font-size: var(--t-md); }
.btn.wide { display: flex; align-items: center; justify-content: center; width: 100%; }
.opt { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.opt > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none; font-size: var(--t-md); font-weight: 600; }
.opt > summary::-webkit-details-marker { display: none; }
.opt > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin-top: -3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .3s var(--ease), margin .3s var(--ease); }
.opt[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.optin { display: grid; gap: 10px; padding: 0 14px 14px; }
.optin > .note, .optin > .plats { margin-top: 0; }
.optin .switch { justify-content: space-between; color: var(--text); }
.linkbtn { justify-self: center; padding: 8px 4px; font-size: var(--t-sm); font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.danger { color: var(--down); }
.cmds { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--t-sm); color: var(--muted); }
.cmds b { color: var(--text); font-weight: 600; }
.fine.legal a, .check a { color: inherit; text-underline-offset: 2px; }

/* avisos en este celular (push) y alertas de precio */
.tlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.tlist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--t-md); }
.tlist .x { width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--muted); }
.tlist .x:hover { color: var(--down); background: var(--down-bg); }
.tadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; min-width: 0; }
.tadd input { flex: 1 1 110px; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 1rem; }
.tadd .seg button { min-height: 32px; padding: 0 12px; font-size: var(--t-sm); }

/* ficha de la plataforma */
.ficha { display: grid; gap: 4px; margin-top: var(--s2); }
.ficha b { color: var(--text); font-weight: 600; }
.ficha .site { color: var(--accent); font-weight: 600; text-decoration: none; justify-self: start; }

/* hoy y cuándo conviene */
.today { margin-top: 2px; font-size: var(--t-md); color: var(--muted); }
.today b { color: var(--text); }

.cols2 { display: block; }
@media (min-width: 1000px) {
  .wrap { max-width: 1120px; }
  .cols2 { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .cols2 > .ca { position: sticky; top: 64px; }
  .cols2 > .cb .sec:first-child { margin-top: 4px; }
  .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alert-wrap { max-width: 560px; margin-inline: auto; }
}
@media (min-width: 720px) and (max-width: 999px) { .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
