/* Rastro · sistema visual */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;
  --text: #101418;
  --text-2: #475467;
  --muted: #8a93a3;
  --accent: #0d9488;
  --accent-hover: #0b7d73;
  --accent-soft: #e3f5f2;
  --accent-ink: #ffffff;
  --series: #2a78d6;
  --series-soft: #cde2fb;
  --mark: #eb6834;
  --good: #15803d;
  --good-soft: #dcfce7;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #c2410c;
  --bad-soft: #ffedd5;
  --critical: #d03b3b;
  --grid: #eceef2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sidebar: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #171a1f;
    --surface-2: #1f232a;
    --border: #2a2f37;
    --border-strong: #3a414c;
    --text: #eef0f3;
    --text-2: #b4bcc8;
    --muted: #7d8696;
    --accent: #14b8a6;
    --accent-hover: #2dd4bf;
    --accent-soft: #0f2e2b;
    --accent-ink: #04201d;
    --series: #3987e5;
    --series-soft: #184f95;
    --mark: #f08a5d;
    --good: #4ade80;
    --good-soft: #0f2a19;
    --teal: #5eead4;
    --teal-soft: #0d2a27;
    --warn: #fbbf24;
    --warn-soft: #2b2108;
    --bad: #fb923c;
    --bad-soft: #2d1a0c;
    --critical: #f87171;
    --grid: #232830;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 750; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.logo-mark svg { width: 20px; height: 20px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 0 7px; line-height: 20px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.place-btn { text-decoration: none; display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 0; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.place-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-btn:hover { color: var(--text); }
.main { min-width: 0; padding: 28px 36px 80px; max-width: 1280px; width: 100%; }
.topbar, .tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; }

/* ---------- componentes base ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.market > .card, [class^="grid-"] > .card, .stack > .card { margin-top: 0; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--critical); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0 12px; height: 40px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; font-size: 14px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
input[type=range] { padding: 0; height: 24px; accent-color: var(--accent); border: 0; box-shadow: none; background: transparent; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; padding: 6px 0; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 42px; }
.input-suffix { position: relative; }
.input-suffix > input { padding-right: 34px; }
.input-suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.chollo { background: var(--good-soft); color: var(--good); }
.badge.buen { background: var(--teal-soft); color: var(--teal); }
.badge.mercado { background: var(--surface-2); color: var(--text-2); }
.badge.algo { background: var(--warn-soft); color: var(--warn); }
.badge.caro { background: var(--bad-soft); color: var(--bad); }
.badge.raro { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.gone { background: var(--surface-2); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.5; margin-bottom: 12px; color: var(--border-strong); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.error-box { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--bad-soft); color: var(--bad); font-size: 14px; }

/* ---------- buscador ---------- */
.searchbar { display: flex; gap: 10px; }
.searchbar .input-icon { flex: 1; }
.searchbar input { height: 52px; font-size: 17px; border-radius: 14px; padding-left: 46px; box-shadow: var(--shadow-sm); }
.searchbar .input-icon > svg { left: 16px; width: 20px; height: 20px; }
.searchbar .btn { height: 52px; border-radius: 14px; padding: 0 24px; font-size: 15px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--text-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .x { margin-left: 2px; opacity: .7; }
.chip svg.chev { width: 14px; height: 14px; opacity: .6; }
.popover {
  position: absolute; z-index: 40; min-width: 260px; max-width: min(360px, calc(100vw - 24px)); padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg);
}
.popover h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.popover .opts { display: flex; flex-direction: column; max-height: 320px; overflow: auto; margin: 0 -4px; }
.popover .opts label { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.popover .opts label:hover { background: var(--surface-2); }
.popover-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- mercado ---------- */
.market { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.hero-price .label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.hero-price .value { font-size: 52px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 4px; }
.hero-price .sub { color: var(--muted); font-size: 13px; }
.rangebar { position: relative; height: 56px; margin: 22px 4px 4px; }
.rangebar .track { position: absolute; left: 0; right: 0; top: 22px; height: 8px; border-radius: 8px; background: var(--grid); }
.rangebar .band { position: absolute; top: 22px; height: 8px; border-radius: 8px; background: var(--series); opacity: .35; }
.rangebar .tick { position: absolute; top: 14px; width: 3px; height: 24px; border-radius: 3px; background: var(--text); transform: translateX(-50%); }
.rangebar .tick.mark { background: var(--mark); width: 4px; }
.rangebar .tick-label { position: absolute; top: -4px; transform: translateX(-50%); font-size: 12px; font-weight: 650; white-space: nowrap; }
.rangebar .tick-label.mark { color: var(--mark); }
.rangebar .end { position: absolute; top: 38px; font-size: 12px; color: var(--muted); }
.rangebar .end.r { right: 0; }
.advice { display: grid; gap: 10px; }
.advice-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
.advice-item .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.advice-item .ic.a { background: var(--teal-soft); color: var(--teal); }
.advice-item .ic.b { background: var(--accent-soft); color: var(--accent); }
.advice-item .ic.c { background: var(--good-soft); color: var(--good); }
.advice-item .t { font-size: 13px; color: var(--text-2); }
.advice-item .v { font-size: 20px; font-weight: 700; }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.mini { padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.mini .t { font-size: 12px; color: var(--muted); font-weight: 550; }
.mini .v { font-size: 19px; font-weight: 700; margin-top: 2px; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .gridline { stroke: var(--grid); }
.chart .bar { fill: var(--series); }
.chart .bar.dim { fill: var(--series-soft); }
.chart .hit:hover + .bar { opacity: .8; }
.chart .median-line { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .median-label { fill: var(--text); font-size: 12px; font-weight: 650; }
.chart .mark-line { stroke: var(--mark); stroke-width: 2.5; }
.chart .mark-label { fill: var(--mark); font-size: 12px; font-weight: 700; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; }
.chart .band { fill: var(--series-soft); opacity: .55; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.spark { width: 120px; height: 34px; }
.spark path { fill: none; stroke: var(--series); stroke-width: 2; }
.tooltip { position: fixed; pointer-events: none; z-index: 100; background: var(--text); color: var(--surface); padding: 7px 10px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; box-shadow: var(--shadow); }

.keywords { display: flex; gap: 6px; flex-wrap: wrap; }
.kw { font-size: 13px; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); }
.kw b { color: var(--text); font-weight: 600; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); }
table.t th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
table.t a { text-decoration: none; }
table.t a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }

/* ---------- anuncios ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; height: 36px; font-size: 13.5px; border-radius: 20px; padding: 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--text-2); height: 34px; padding: 0 10px; cursor: pointer; display: grid; place-items: center; }
.seg button.on { background: var(--surface-2); color: var(--text); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.item {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
  text-align: left; font: inherit; color: inherit; padding: 0;
}
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.item .ph { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.item .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.item .ph .badge { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow-sm); }
.item .ph .ship { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--text-2); box-shadow: var(--shadow-sm); }
.item .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.item .price { font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.item .title { font-size: 13.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; line-height: 1.4; }
.item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.dim { opacity: .5; }
.item.dim:hover { opacity: .85; }
.items.list { grid-template-columns: 1fr; gap: 8px; }
.items.list .item { flex-direction: row; align-items: center; border-radius: var(--r); }
.items.list .item .ph { width: 84px; height: 84px; aspect-ratio: auto; flex: none; }
.items.list .item .ph .badge, .items.list .item .ph .ship { display: none; }
.items.list .item .body { flex: 1; flex-direction: row; align-items: center; gap: 16px; padding: 10px 16px; }
.items.list .item .title { flex: 1; min-height: 0; -webkit-line-clamp: 1; }
.items.list .item .price { order: 3; min-width: 110px; text-align: right; }
.items.list .item .meta { width: 220px; }
.items.list .item .list-badge { display: inline-flex !important; order: 2; }
.list-badge { display: none !important; }

.discarded summary { cursor: pointer; color: var(--text-2); font-size: 14px; padding: 8px 0; }
.discarded ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.discarded li { font-size: 13px; color: var(--text-2); display: flex; gap: 10px; }
.discarded li .num { width: 70px; text-align: right; flex: none; }
.discarded li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discarded li i { color: var(--muted); flex: none; }

/* ---------- panel lateral (ficha) y modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 60; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 61; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }
.drawer-body > .pad { padding: 18px 22px 0; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: var(--surface-2); aspect-ratio: 4/3; }
.gallery img { flex: none; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery-count { position: relative; }
.gallery-count span { position: absolute; right: 14px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 12px; }
.d-price { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; }
.d-title { font-size: 17px; font-weight: 600; margin-top: 4px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: var(--r); background: var(--surface-2); text-align: center; }
.stat .v { font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.stat .t { font-size: 12px; color: var(--muted); }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; align-items: flex-start; }
.callout.hot { background: var(--bad-soft); color: var(--bad); }
.callout.info { background: var(--accent-soft); color: var(--accent); }
.callout.good { background: var(--good-soft); color: var(--good); }
.seller { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); text-decoration: none; }
.seller img, .seller .av { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.stars { color: #f5a524; letter-spacing: 1px; }
.offer { padding: 16px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent-soft); }
.offer .v { font-size: 26px; font-weight: 750; color: var(--accent); }
.offer textarea { margin-top: 10px; background: var(--surface); }
.desc { white-space: pre-wrap; font-size: 14px; color: var(--text-2); max-height: 180px; overflow: hidden; position: relative; }
.desc.open { max-height: none; }
.attrs { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); position: sticky; bottom: 0; }

.map { height: 420px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); z-index: 0; }
.geo-results { position: absolute; left: 0; right: 0; top: 44px; z-index: 1000; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; }
.geo-results button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.geo-results button:hover { background: var(--surface-2); }
.geo-results small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.leaflet-container { font: inherit; background: var(--surface-2); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--surface); font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-width: calc(100vw - 32px); }
.toast.error { background: var(--critical); color: #fff; }

/* ---------- alertas, seguimiento ---------- */
.watch-card { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.watch-card .name { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.watch-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.watch-card .nums { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.kv .t { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 16px; font-weight: 650; }
.watch-card .err { grid-column: 1 / -1; color: var(--critical); font-size: 13px; }
.paused { opacity: .6; }
.track-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; }
.track-card img { width: 96px; height: 96px; border-radius: var(--r); object-fit: cover; background: var(--surface-2); }
.delta.down { color: var(--good); font-weight: 650; }
.delta.up { color: var(--bad); font-weight: 650; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: 14px; color: var(--text-2); cursor: pointer; font-weight: 550; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.sim { padding: 20px; border-radius: var(--r-lg); background: var(--surface-2); }
.sim .price-input { font-size: 30px; font-weight: 750; height: 56px; width: 180px; text-align: right; }
.verdict { font-size: 15px; font-weight: 650; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.feature p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tips li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.tips li svg { color: var(--accent); margin-top: 2px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--grid) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); }
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 20px; color: var(--text-2); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 32px; }
.login-card .logo { justify-content: center; padding: 0 0 6px; font-size: 26px; }
.login-card .logo-mark { width: 44px; height: 44px; border-radius: 13px; }
.login-card .logo-mark svg { width: 26px; height: 26px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- móvil ---------- */
@media (max-width: 1100px) {
  .market { grid-template-columns: 1fr; }
  .grid-4, .minis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar .logo { padding: 0; font-size: 18px; }
  .topbar .logo-mark { width: 30px; height: 30px; }
  .topbar .place-btn { width: auto; max-width: 46vw; margin-left: auto; padding: 8px 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 0; font-weight: 550; }
  .tabbar a.active { color: var(--accent); }
  .main { padding: 18px 14px 96px; }
  h1 { font-size: 22px; }
  .searchbar input, .searchbar .btn { height: 48px; }
  .searchbar .btn span { display: none; }
  .searchbar .btn { padding: 0 16px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 0 14px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .hero-price .value { font-size: 42px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item .body { padding: 10px; }
  .item .price { font-size: 17px; }
  .items.list .item .meta { display: none; }
  .watch-card { grid-template-columns: 1fr; }
  .track-card { grid-template-columns: 72px 1fr; }
  .track-card img { width: 72px; height: 72px; }
  .track-card .actions { grid-column: 1 / -1; }
  .drawer { width: 100vw; }
  .map { height: 52vh; }
  .popover { position: fixed !important; left: 12px !important; right: 12px; top: auto !important; bottom: 76px; max-width: none; }
}
