/* ====== CHIPDEX — estilo inspirado en lunwi.net (oscuro, pixel, acentos naranja/teal/violeta) ====== */
:root {
  --bg: #121318;
  --bg-2: #171920;
  --panel: #1e212a;
  --panel-2: #262a35;
  --border: #343a48;
  --text: #ece8e1;
  --muted: #9ea2b1;
  --primary: #ff4655;   /* color principal (rojo) */
  --primary-d: #b51f2d;
  --teal: #5fd3b3;
  --teal-d: #2f9e82;
  --purple: #c9a6ff;
  --purple-d: #8b63d6;
  --green: #79c853;
  --red: #ff6b6b;
  --radius: 14px;
  --pixel: "Silkscreen", "Press Start 2P", monospace;
  --sans: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 19, 24, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1500px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 28px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.logo-mark {
  width: 38px; height: 38px; border: 3px solid var(--primary); border-radius: 6px;
  display: grid; place-items: center; font-family: var(--pixel); color: var(--primary); font-size: 18px;
  box-shadow: 3px 3px 0 var(--primary-d);
}
.logo-text { font-weight: 800; font-size: 24px; letter-spacing: .5px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 10px; font-weight: 600;
  text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: #1f0508; background: var(--primary); box-shadow: 0 3px 0 var(--primary-d); }

main { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 24px; }

/* ---------- banners pixel ---------- */
.banner {
  display: flex; align-items: center; margin: 8px 0 18px;
}
.banner .icon {
  width: 64px; height: 64px; border-radius: 12px; background: var(--teal);
  display: grid; place-items: center; font-size: 30px; transform: rotate(-4deg);
  box-shadow: 0 4px 0 var(--teal-d); z-index: 1; border: 3px solid #8ff0d6;
}
.banner .title {
  margin-left: -10px; padding: 12px 40px 12px 34px;
  background: linear-gradient(90deg, #6fe0c0, #34b58f);
  border-radius: 0 14px 14px 0; box-shadow: 0 4px 0 var(--teal-d);
  font-family: var(--pixel); font-size: 26px; color: #10241e; letter-spacing: 1px;
}
.banner.orange .icon { background: var(--primary); border-color: #ff9aa3; box-shadow: 0 4px 0 var(--primary-d); }
.banner.orange .title { background: linear-gradient(90deg, #ff6b77, #e0313f); box-shadow: 0 4px 0 var(--primary-d); color: #2a0508; }
.banner.purple .icon { background: var(--purple); border-color: #e2d0ff; box-shadow: 0 4px 0 var(--purple-d); }
.banner.purple .title { background: linear-gradient(90deg, #d4b8ff, #9e78e6); box-shadow: 0 4px 0 var(--purple-d); color: #1d1030; }
.banner .aside { margin-left: auto; color: var(--muted); font-size: 14px; }

/* ---------- panels ---------- */
.card {
  background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 20px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.card-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head .controls { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card.accent-purple { border-color: #4b3d6b; background: linear-gradient(135deg, #2a2240, #1e212a 60%); }
.card.accent-orange { border-color: #5a2229; background: linear-gradient(135deg, #2d171a, #1e212a 60%); }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.layout > section { min-width: 0; }
.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }

/* ---------- filtros ---------- */
.filter { margin-bottom: 16px; }
.filter-label {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; color: var(--purple);
  text-transform: uppercase; margin-bottom: 8px;
}
.filter-label button { font-family: var(--sans); font-size: 12px; text-transform: none; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 2px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
  display: inline-flex; gap: 6px; align-items: center; transition: transform .05s;
}
.chip:hover { border-color: #4d5466; }
.chip:active { transform: translateY(1px); }
.chip .n { color: var(--muted); font-size: 11px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #1f0508; font-weight: 700; }
.chip.on .n { color: #5c1018; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.input, select.input {
  width: 100%; background: var(--bg-2); border: 2px solid var(--border); border-radius: 10px;
  padding: 9px 12px; outline: none;
}
.input:focus { border-color: var(--primary); }
select.input { padding: 7px 10px; width: auto; }

.range-row { display: flex; gap: 8px; align-items: center; }
.range-row .input { padding: 6px 8px; text-align: center; }
.range-row span { color: var(--muted); }
.dual-range { position: relative; height: 26px; margin-top: 4px; }
.dual-range input[type=range] {
  position: absolute; width: 100%; top: 6px; margin: 0; pointer-events: none;
  -webkit-appearance: none; appearance: none; background: transparent; height: 14px;
}
.dual-range .track { position: absolute; top: 12px; height: 4px; left: 0; right: 0; background: var(--border); border-radius: 4px; }
.dual-range .fill { position: absolute; top: 12px; height: 4px; background: var(--primary); border-radius: 4px; }
.dual-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: all; width: 16px; height: 16px; border-radius: 4px;
  background: var(--text); border: 3px solid var(--primary); cursor: pointer; position: relative; z-index: 2;
}
.dual-range input[type=range]::-moz-range-thumb {
  pointer-events: all; width: 12px; height: 12px; border-radius: 4px; background: var(--text);
  border: 3px solid var(--primary); cursor: pointer;
}
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; }
.toggle input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- botones ---------- */
.btn {
  border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer;
  background: var(--primary); color: #1f0508; box-shadow: 0 3px 0 var(--primary-d);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none !important;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-d); }
.btn.purple { background: var(--purple); box-shadow: 0 3px 0 var(--purple-d); color: #1d1030; }
.btn.teal { background: var(--teal); box-shadow: 0 3px 0 var(--teal-d); color: #0e2a22; }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: 0 3px 0 #15171d; border: 2px solid var(--border); }
.btn.danger { background: var(--red); box-shadow: 0 3px 0 #a83a3a; color: #2a0b0b; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi .d { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.o { border-color: #5a2229; } .kpi.o .v { color: var(--primary); }
.kpi.t { border-color: #24574a; } .kpi.t .v { color: var(--teal); }
.kpi.p { border-color: #4b3d6b; } .kpi.p .v { color: var(--purple); }

.chart-box { position: relative; height: 520px; }
.chart-box.md { height: 380px; }
.chart-box.tall { height: 640px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* ---------- comparación ---------- */
.compare-empty { color: var(--muted); padding: 10px 0; }
.compare-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 2px solid var(--border);
  border-radius: 10px; padding: 6px 10px; font-weight: 600;
}
.tag button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.tag button:hover { color: var(--red); }
.cmp-add { min-width: 280px; position: relative; }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--panel-2);
  border: 2px solid var(--border); border-radius: 10px; max-height: 280px; overflow: auto; display: none;
}
.suggest div { padding: 7px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.suggest div:hover, .suggest div.sel { background: #323746; }
.suggest small { color: var(--muted); }

.cmp-bars { padding: 26px 0 30px; position: relative; }
.cmp-bar { position: relative; height: 58px; margin: 8px 0; background: #e6e6e6; border-radius: 6px; overflow: visible; }
.cmp-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #12b81c, #0fc41a); }
.cmp-bar .lbl { position: absolute; left: 10px; top: 6px; color: #0b1a0b; z-index: 2; line-height: 1.15; }
.cmp-bar .lbl small { display: block; font-size: 11px; opacity: .75; }
.cmp-bar .lbl b { font-size: 15px; }
.cmp-bar .score { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #8e2fc2; font-weight: 800; font-size: 16px; z-index: 2; }
.cmp-bar .score small { color: #222; font-weight: 700; font-size: 12px; margin-left: 4px; }
.cmp-bar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.18); z-index: 1; }
.ref-labels { position: relative; height: 20px; font-size: 12px; }
.ref-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; color: #8fb6ff; }
.verdict { font-size: 16px; margin: 4px 0 16px; }
.verdict b { color: var(--primary); }

table.specs { width: 100%; border-collapse: collapse; }
table.specs th, table.specs td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
table.specs th { color: var(--muted); font-weight: 500; width: 200px; }
table.specs td.best { color: var(--green); font-weight: 700; }
table.specs td.best::after { content: " ▲"; font-size: 10px; }
table.specs thead td { font-weight: 800; color: var(--primary); }

/* ---------- tabla de datos ---------- */
.table-wrap { overflow: auto; max-height: 620px; border-radius: 10px; border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  position: sticky; top: 0; background: var(--panel-2); text-align: left; padding: 9px 10px; cursor: pointer;
  white-space: nowrap; user-select: none; font-weight: 600; color: var(--muted); z-index: 1;
}
table.data th.sorted { color: var(--primary); }
table.data td { padding: 7px 10px; border-top: 1px solid #2a2e3a; white-space: nowrap; }
table.data tr:hover td { background: #232734; }
table.data tr.picked td { background: #2e1a1d; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-mini { display: inline-block; height: 8px; border-radius: 4px; background: var(--primary); vertical-align: middle; margin-right: 6px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }

/* ---------- home ---------- */
.hero {
  border-radius: 20px; padding: 40px; margin-bottom: 24px; border: 2px solid #4b3d6b;
  background: radial-gradient(1200px 300px at 0% 0%, #3a2b5c 0%, transparent 60%), linear-gradient(135deg, #2a2240, #1b1d25);
}
.hero h1 { font-family: var(--pixel); font-size: 34px; margin: 0 0 10px; letter-spacing: 1px; }
.hero p { color: #cfc8de; max-width: 760px; font-size: 17px; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile { background: var(--panel); border: 2px solid var(--border); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.tile .art { height: 170px; display: grid; place-items: center; background: #17191f; border-bottom: 2px solid var(--border); font-size: 70px; }
.tile .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile .eyebrow { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; color: var(--primary); }
.tile h3 { margin: 0; font-size: 24px; }
.tile p { margin: 0 0 8px; color: var(--muted); flex: 1; }
.tile .btn { justify-content: space-between; }

/* ---------- ABM ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { max-width: 340px; }
.toolbar .spacer { flex: 1; }
.modal-back {
  position: fixed; inset: 0; background: rgba(5, 6, 10, .7); display: none; z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--panel); border: 2px solid var(--border); border-radius: 18px; width: min(860px, 100%);
  max-height: 92vh; overflow: auto; padding: 22px 24px;
}
.modal h2 { margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label .req { color: var(--primary); }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.errors { color: var(--red); margin-top: 10px; font-size: 14px; }
.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--panel-2); border: 2px solid var(--teal);
  padding: 12px 16px; border-radius: 12px; z-index: 200; display: none; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 30px; }
.site-footer .inner { max-width: 1500px; margin: 0 auto; padding: 24px; display: flex; gap: 40px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.site-footer h4 { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; color: var(--text); margin: 0 0 8px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .grid-2, .tiles { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- tooltip enriquecido ---------- */
.hw-tip {
  position: fixed; z-index: 300; width: 400px; max-width: calc(100vw - 28px); pointer-events: none;
  background: #1b1e26f7; border: 2px solid var(--border); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .12s;
  font-size: 13px; left: 0; top: 0;
}
.hw-tip .tip-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.hw-tip .tip-head img { width: 150px; height: 92px; object-fit: contain; background: #13151b; border-radius: 10px; padding: 4px; flex: none; }
.hw-tip .tip-brand { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; }
.hw-tip .tip-name { font-size: 17px; font-weight: 800; line-height: 1.15; margin: 2px 0 4px; }
.hw-tip .tip-price { font-size: 18px; font-weight: 800; color: var(--primary); }
.hw-tip .tip-price small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.hw-tip .tip-score { display: grid; grid-template-columns: 82px 1fr 44px; gap: 8px; align-items: center; margin: 4px 0; }
.hw-tip .tip-score span { color: var(--muted); }
.hw-tip .tip-score b { text-align: right; color: var(--purple); }
.hw-tip .tip-bar { height: 8px; background: #2c313d; border-radius: 6px; overflow: hidden; }
.hw-tip .tip-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); border-radius: 6px; }
.hw-tip .tip-ppd { color: var(--muted); margin: 6px 0 8px; }
.hw-tip .tip-ppd b { color: var(--teal); }
.hw-tip .tip-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.hw-tip .tip-specs div { background: var(--panel-2); border-radius: 8px; padding: 5px 7px; }
.hw-tip .tip-specs span { display: block; color: var(--muted); font-size: 10.5px; }
.hw-tip .tip-specs b { font-size: 12.5px; }
.hw-tip .tip-desc { margin: 6px 0 8px; color: #d5d1ca; line-height: 1.45; font-size: 12.5px; }
.hw-tip .tip-foot { font-size: 11.5px; color: var(--primary); }

table.data img.thumb { width: 44px; height: 28px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
table.specs img.cmp-img { width: 170px; height: 104px; object-fit: contain; display: block; margin-bottom: 6px; background: #13151b; border-radius: 10px; padding: 4px; }
table.specs .cmp-desc { white-space: normal; font-size: 13px; color: #d5d1ca; vertical-align: top; line-height: 1.45; }
table.specs td { vertical-align: top; }

/* ABM: imagen y descripción */
.img-field { display: flex; gap: 12px; align-items: center; }
.img-field img { width: 120px; height: 74px; object-fit: contain; background: #13151b; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.img-field .col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
textarea.input { min-height: 110px; resize: vertical; font-family: inherit; line-height: 1.4; }

/* ---------- autocompletado con tags ---------- */
.tp-box { position: relative; }
.tp .suggest { max-height: 340px; }
.tp .suggest .empty { cursor: default; }
.tp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-tags:empty { display: none; }
.tp-tag {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #1f0508; font-weight: 700;
  border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px;
}
.tp-tag small { font-weight: 600; opacity: .7; font-size: 10.5px; text-transform: uppercase; }
.tp-tag button { background: rgba(0,0,0,.15); border: 0; border-radius: 50%; width: 18px; height: 18px; line-height: 16px; cursor: pointer; color: inherit; font-weight: 800; padding: 0; }
.tp.gold .tp-tag { background: var(--gold); box-shadow: 0 0 12px rgba(255, 201, 40, .35); }
.tp.gold .input:focus { border-color: var(--gold); }

/* ---------- barra DESTACAR ---------- */
:root { --gold: #ffc928; --gold-d: #b88a00; }
.card.accent-gold { border-color: #6b5410; background: linear-gradient(135deg, #2e2711, #1e212a 55%); padding: 14px 18px; }
.hl-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.hl-bar .hl-title { font-family: var(--pixel); color: var(--gold); font-size: 14px; letter-spacing: 1px; padding-top: 10px; white-space: nowrap; }
.hl-bar .hl-info { color: var(--muted); font-size: 13px; padding-top: 11px; white-space: nowrap; }
.hl-bar .hl-info b { color: var(--gold); }
table.data tr.hl td { background: rgba(255, 201, 40, .10); }
table.data tr.hl td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
table.data tr.dim td { opacity: .55; }
table.data tr.dim:hover td { opacity: 1; }

/* ---------- selección compartida ---------- */
.sel-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  color: #111318; font-weight: 800; font-size: 12px; line-height: 1; vertical-align: middle;
}
.sel-tray { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px;
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: 12px; min-height: 48px; }
.sel-tray .tray-title { font-family: var(--pixel); font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-right: 4px; }
.sel-tray .tray-title b { color: var(--primary); }
.sel-tag { cursor: default; padding: 4px 8px; gap: 6px; transition: border-color .1s, transform .1s; }
.sel-tag.focus, .sel-tag:hover { border-color: var(--text); transform: translateY(-1px); }
.cmp-bar { transition: transform .12s, box-shadow .12s; box-shadow: inset 6px 0 0 var(--sel, transparent); }
.cmp-bar.focus { transform: scale(1.012); box-shadow: inset 6px 0 0 var(--sel, transparent), 0 0 0 3px var(--sel, #fff); }
.cmp-bar .lbl { left: 16px; }
.cmp-bar .lbl .sel-badge { height: 17px; min-width: 17px; font-size: 11px; margin-right: 2px; }
table.data tr.picked td:first-child { box-shadow: inset 4px 0 0 var(--sel, var(--primary)); }
table.data tr.focus td { background: #2c3242; }
.sel-box { position: absolute; display: none; border: 2px dashed var(--primary); background: rgba(255, 70, 85, .10); border-radius: 4px; pointer-events: none; z-index: 5; }

/* ---------- barra de vista (métrica / moneda) ---------- */
.card.view-bar { padding: 12px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.view-bar .vsep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.view-bar #curNote b { color: var(--teal); }
.hw-tip .tip-alt { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* panel de cotización en /admin */
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(160px, 220px)) 1fr; gap: 12px 16px; align-items: end; }
.pricing-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pricing-grid .ex { color: var(--muted); font-size: 13px; }
.pricing-grid .ex b { color: var(--teal); }

[hidden] { display: none !important; }

/* chipsets en el tooltip */
.hw-tip .tip-extra { margin: 2px 0 8px; }
.hw-tip .tip-extra > span { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 4px; }
.hw-tip .tip-extra div { display: flex; flex-wrap: wrap; gap: 4px; }
.hw-tip .tip-extra i { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #24443a; color: #a8f0d8; }
.hw-tip .tip-extra i.bios { background: #3a3424; color: #f3d98b; }
.hw-tip .tip-extra i.match { outline: 2px solid var(--primary); }
.hw-tip .tip-extra sup { font-size: 8px; margin-left: 2px; opacity: .8; }

/* ---------- glosario ---------- */
.gl-top { }
.gl-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gl-toc a { background: var(--panel-2); border: 2px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--text); font-size: 13px; text-decoration: none; }
.gl-toc a:hover { border-color: var(--primary); }
.gl-sec { scroll-margin-top: 80px; }
.gl-sec h2 { font-size: 22px; margin-bottom: 6px; }
.gl-sec h3 { margin: 18px 0 8px; color: var(--teal); font-size: 16px; }
.terms { margin: 0; display: grid; gap: 8px; }
.terms.cols { grid-template-columns: 1fr 1fr; }
.term { background: var(--bg-2); border: 1px solid #2a2e3a; border-radius: 10px; padding: 10px 12px; }
.term.hit { border-color: var(--primary); }
.term dt { font-weight: 800; color: var(--text); }
.term dt small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.term dd { margin: 4px 0 0; color: #cdd0d9; line-height: 1.5; }
.term dd i { color: var(--purple); font-style: normal; }
.gl-example { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #1a1428; border: 2px solid #4b3d6b; border-radius: 14px; padding: 14px 16px; margin: 10px 0 16px; }
.gl-example > div { text-align: center; background: var(--panel-2); border-radius: 10px; padding: 8px 14px; }
.gl-example .big { display: block; font-family: var(--pixel); font-size: 30px; color: var(--primary); }
.gl-example small { color: var(--muted); font-size: 11.5px; line-height: 1.2; display: block; }
.gl-example p { flex: 1; min-width: 240px; margin: 0; }
.gl-table td { white-space: normal; }
.ff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; margin: 12px 0 16px; }
.ff { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ff-box { border: 3px solid var(--teal); border-radius: 8px; background: repeating-linear-gradient(45deg, #1d3a33, #1d3a33 8px, #20423a 8px, #20423a 16px); display: grid; place-items: center; }
.ff-box span { font-family: var(--pixel); color: var(--teal); font-size: 13px; }
.ff small { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .terms.cols, .ff-grid { grid-template-columns: 1fr 1fr; } .gl-top { position: static; } }
.gl-link { font-size: 11.5px; font-weight: 500; margin-left: 4px; }
.hl-bar .hl-auto { padding-top: 10px; white-space: nowrap; font-size: 13px; color: var(--gold); }
.hl-bar .hl-auto input { accent-color: var(--gold); }

/* =====================================================================
   Cartel flotante "Regalame un cafecito" + personaje pixel art
   ===================================================================== */
#donate { position: fixed; right: 16px; bottom: 16px; z-index: 150; pointer-events: none; transform-origin: 100% 100%; }
#donate .dn-stage { position: relative; width: 340px; height: 262px; }
#donate.dn-gone .dn-stage { visibility: hidden; }
#donate .dn-ship { position: absolute; inset: 0; transform-origin: 46% 100%; will-change: transform; }

/* --- cartel --- */
#donate .dn-card {
  position: absolute; left: 0; bottom: 0; width: 248px; height: 248px; pointer-events: auto; opacity: 0;
  transform-origin: 50% 0; will-change: transform;
  background: radial-gradient(260px 160px at 0% 0%, #3a1c21 0%, transparent 70%), linear-gradient(160deg, #2b191c, #1e212a 65%);
  border: 3px solid var(--primary); border-radius: 18px; padding: 14px 16px 12px;
  box-shadow: 0 6px 0 var(--primary-d), 0 18px 40px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; gap: 5px; color: var(--text);
}
#donate.dn-on .dn-card { opacity: 1; }
#donate .dn-card::before { /* clavito donde engancha el hilo */
  content: ""; position: absolute; top: -7px; left: calc(50% - 5px); width: 10px; height: 10px;
  background: #cfd0d8; border: 2px solid #1a1620; border-radius: 2px;
}
#donate .dn-close { z-index: 2;
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--border); color: var(--muted); font-weight: 800; font-size: 13px; line-height: 1;
  box-shadow: 0 2px 0 #121318; transition: color .15s, border-color .15s, transform .1s;
}
#donate .dn-close:hover { color: #fff; border-color: var(--red); background: #3a1d22; }
#donate .dn-close:active { transform: translateY(2px); box-shadow: none; }
#donate .dn-cup { position: relative; height: 24px; margin-top: 2px; }
#donate .dn-cup i { position: absolute; bottom: 20px; width: 3px; height: 6px; background: rgba(255, 255, 255, .55); border-radius: 1px; animation: dn-steam 2.2s ease-in infinite; }
#donate .dn-cup i:nth-of-type(1) { left: 12px; }
#donate .dn-cup i:nth-of-type(2) { left: 19px; animation-delay: .7s; }
#donate .dn-cup i:nth-of-type(3) { left: 26px; animation-delay: 1.4s; }
@keyframes dn-steam { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: .8; } 100% { transform: translate(3px, -16px); opacity: 0; } }
#donate .dn-eyebrow { font-family: var(--pixel); font-size: 9.5px; letter-spacing: 1px; color: var(--purple); margin-top: 2px; }
#donate .dn-title { font-size: 19px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
#donate .dn-text { margin: 0; font-size: 12.3px; line-height: 1.4; color: #cfc8de; }
#donate .dn-text b { color: var(--primary); }
#donate .dn-alias-box {
  margin-top: auto; cursor: pointer; background: #14161c; border: 2px dashed #4b3d6b; border-radius: 10px; padding: 4px 10px;
  display: flex; flex-direction: column; gap: 1px; transition: border-color .15s;
}
#donate .dn-alias-box:hover { border-color: var(--purple); }
#donate .dn-alias-box span { font-family: var(--pixel); font-size: 8.5px; letter-spacing: 1px; color: var(--muted); }
#donate .dn-alias-box b { font-size: 17px; color: var(--primary); letter-spacing: .3px; }
#donate .dn-copy {
  border: 0; border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 13.5px; cursor: pointer;
  background: var(--primary); color: #1f0508; box-shadow: 0 3px 0 var(--primary-d); transition: filter .15s, transform .1s;
}
#donate .dn-copy:hover { filter: brightness(1.06); }
#donate .dn-copy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-d); }
#donate .dn-card.dn-thanks { animation: dn-thanks .6s ease; }
@keyframes dn-thanks { 0% { transform: scale(1); } 30% { transform: scale(1.04) rotate(-1deg); } 60% { transform: scale(.99) rotate(.6deg); } 100% { transform: none; } }

/* --- caña de pescar --- */
#donate .dn-rod { position: absolute; inset: 0; overflow: visible; opacity: 0; shape-rendering: crispEdges; pointer-events: none; z-index: 2; }

/* --- personaje --- */
#donate .dn-char { position: absolute; left: 230px; bottom: -4px; width: 97px; height: 229px; transform-origin: 50% 100%; will-change: transform; }
#donate .dn-char-svg { display: block; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }
#donate .dn-body, #donate .dn-head, #donate .dn-pupils { transform-box: view-box; }
#donate.dn-idle .dn-body { transform-origin: 22px 64px; animation: dn-breathe 3.8s ease-in-out infinite; }
#donate.dn-idle .dn-head { animation: dn-head 3.8s ease-in-out infinite; }
@keyframes dn-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.04); } }
@keyframes dn-head { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
#donate.dn-idle .dn-char { animation: dn-sway 7s ease-in-out infinite; }
@keyframes dn-sway { 0%, 100% { transform: translateX(6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(-5.2deg); } }
#donate.dn-liking .dn-char { animation: dn-like .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes dn-like { 0% { transform: translateX(6px) rotate(-6deg); } 40% { transform: translate(8px, -10px) rotate(-2deg); } 100% { transform: translateX(6px) rotate(-6deg); } }
#donate .dn-splash rect { animation: dn-splash .6s ease-out forwards; }
@keyframes dn-splash { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.dn-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }
#donate .dn-lids, #donate .dn-wow { display: none; }
#donate.dn-blink .dn-lids { display: inline; }
#donate.dn-look-right .dn-pupils { transform: translateX(2px); }
#donate.dn-sinking .dn-pupils { transform: translate(2px, -1px); }
#donate.dn-wow-on .dn-wow { display: inline; animation: dn-wow .25s steps(2) infinite; }
@keyframes dn-wow { 50% { transform: translateY(-1px); } }

/* --- agua (hundimiento) --- */
#donate .dn-water {
  position: absolute; left: -70px; right: -30px; bottom: -40px; height: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(transparent 0 30px, #2f9be0ee 30px, #155a8ff2 50%, #0b2d4cfa);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70px); mask-image: linear-gradient(90deg, transparent, #000 70px);
}
#donate .dn-wave { position: absolute; left: 0; right: 0; top: 8px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='12' shape-rendering='crispEdges'%3E%3Crect x='0' y='7' width='32' height='5' fill='%232f9be0'/%3E%3Crect x='0' y='6' width='6' height='1' fill='%232f9be0'/%3E%3Crect x='4' y='5' width='6' height='2' fill='%232f9be0'/%3E%3Crect x='8' y='4' width='8' height='3' fill='%232f9be0'/%3E%3Crect x='14' y='5' width='6' height='2' fill='%232f9be0'/%3E%3Crect x='20' y='6' width='12' height='1' fill='%232f9be0'/%3E%3Crect x='8' y='3' width='8' height='1' fill='%23bfe9ff'/%3E%3Crect x='4' y='4' width='4' height='1' fill='%23bfe9ff'/%3E%3Crect x='16' y='4' width='4' height='1' fill='%23bfe9ff'/%3E%3Crect x='0' y='5' width='4' height='1' fill='%23bfe9ff'/%3E%3Crect x='20' y='5' width='6' height='1' fill='%23bfe9ff'/%3E%3Crect x='26' y='6' width='6' height='1' fill='%23bfe9ff'/%3E%3C/svg%3E") repeat-x; background-size: 64px 24px;
  image-rendering: pixelated; animation: dn-wave 1.1s linear infinite; }
#donate .dn-wave-back { top: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='12' shape-rendering='crispEdges'%3E%3Crect x='0' y='7' width='32' height='5' fill='%231f6fae'/%3E%3Crect x='0' y='6' width='6' height='1' fill='%231f6fae'/%3E%3Crect x='4' y='5' width='6' height='2' fill='%231f6fae'/%3E%3Crect x='8' y='4' width='8' height='3' fill='%231f6fae'/%3E%3Crect x='14' y='5' width='6' height='2' fill='%231f6fae'/%3E%3Crect x='20' y='6' width='12' height='1' fill='%231f6fae'/%3E%3Crect x='8' y='3' width='8' height='1' fill='%236cc3f2'/%3E%3Crect x='4' y='4' width='4' height='1' fill='%236cc3f2'/%3E%3Crect x='16' y='4' width='4' height='1' fill='%236cc3f2'/%3E%3Crect x='0' y='5' width='4' height='1' fill='%236cc3f2'/%3E%3Crect x='20' y='5' width='6' height='1' fill='%236cc3f2'/%3E%3Crect x='26' y='6' width='6' height='1' fill='%236cc3f2'/%3E%3C/svg%3E") repeat-x; background-size: 64px 24px; opacity: .9; animation-duration: 1.7s; animation-direction: reverse; }
@keyframes dn-wave { to { background-position-x: 64px; } }
#donate .dn-water[style*="height: 0px"] .dn-wave { display: none; }
#donate .dn-bubbles { position: absolute; inset: 0; overflow: visible; }
#donate .dn-bubbles i { position: absolute; bottom: 30px; border: 2px solid #d6f2ff; background: rgba(255, 255, 255, .18); border-radius: 2px; animation: dn-bubble 1.2s ease-out forwards; }
@keyframes dn-bubble { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 60% { transform: translate(4px, -90px); } 100% { transform: translate(-3px, -150px); opacity: 0; } }

/* --- botón para volver a abrir --- */
#donate .dn-reopen {
  position: absolute; right: 0; bottom: 0; width: 58px; height: 58px; border-radius: 14px; cursor: pointer; pointer-events: auto;
  background: linear-gradient(160deg, #2b191c, #1e212a); border: 3px solid var(--primary); box-shadow: 0 4px 0 var(--primary-d);
  display: grid; place-items: center; transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
#donate .dn-reopen.dn-show { transform: scale(1); animation: dn-float 2.8s ease-in-out .4s infinite; }
#donate .dn-reopen:hover { border-color: var(--gold); }
@keyframes dn-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#donate.dn-on .dn-reopen { display: none; }

@media (max-width: 760px) { #donate { transform: scale(.72); right: 8px; bottom: 8px; } }
@media (max-width: 420px) { #donate { transform: scale(.6); } }

/* el aviso (toast) va abajo al centro para no tapar el cartel */
.toast { right: auto; left: 50%; transform: translateX(-50%); }

/* ---------- zoom del gráfico de dispersión ---------- */
.zoom-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 2px 0 10px; }
.zoom-bar .seg { display: inline-flex; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; }
.zoom-bar .seg button { background: var(--panel-2); border: 0; padding: 6px 11px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.zoom-bar .seg button + button { border-left: 1px solid var(--border); }
.zoom-bar .seg button:hover:not(:disabled) { color: var(--text); background: #2e3341; }
.zoom-bar .seg button.on { background: var(--primary); color: #1f0508; }
.zoom-bar .seg button:disabled { opacity: .45; cursor: default; }
.zoom-bar #zoomInfo b { color: var(--primary); }
.zoom-bar .zoom-tip { margin-left: auto !important; }
canvas[data-mode="zoom"] { cursor: zoom-in !important; }
canvas[data-mode="pan"] { cursor: grab !important; }
canvas.grabbing { cursor: grabbing !important; }
canvas.grab { cursor: grab !important; }
.sel-box.zoom { border-color: var(--teal); background: rgba(95, 211, 179, .10); }
@media (max-width: 900px) { .zoom-bar .zoom-tip { display: none; } }

/* ===== Selector de idioma (ES / EN) ===== */
.lang-btn {
  margin-left: 6px; padding: 7px 11px; border-radius: 10px; cursor: pointer;
  font: 700 12px/1 var(--sans); letter-spacing: .6px;
  color: var(--muted); background: transparent; border: 1px solid var(--line, rgba(255,255,255,.12));
}
.lang-btn:hover { color: var(--text); border-color: var(--primary); background: var(--panel); }
