/* Una columna tipo mostrador: buscador fijo arriba, lista de precios debajo. Fuentes del sistema para que abra sin internet. */
:root {
  --bg: #f3f5f7; --surface: #ffffff; --ink: #14212b; --muted: #5b6b78; --line: #dbe2e8;
  --accent: #0f5e78; --accent-ink: #ffffff; --price: #0b3d4f;
  --ok: #1d7a46; --warn: #8a4d00; --bad: #b3261e;
  --chip-ok: #e3f3ea; --chip-warn: #fdf0dc; --chip-bad: #fbe6e4;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, "Roboto Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0e171d; --surface: #16222a; --ink: #e6edf2; --muted: #93a5b3; --line: #26363f;
  --accent: #4fb3d1; --accent-ink: #06141a; --price: #9fdcf0;
  --ok: #6fd39b; --warn: #f0b45c; --bad: #ff8a80;
  --chip-ok: #143424; --chip-warn: #3a2a10; --chip-bad: #3d1916;
  color-scheme: dark;
} }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.4 var(--f-body); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

h1 { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; margin: 0; }
h1 span { color: var(--accent); }

.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.tarjeta { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 12px; }
.tarjeta label { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.tarjeta input { font: 600 1.1rem var(--f-body); color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; }
.tarjeta input:focus { border-color: var(--accent); outline: none; }

header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: 14px 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.status { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--warn); }

.search { margin-top: 10px; position: relative; }
.search input { width: 100%; font: 600 1.1rem var(--f-body); color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 13px 44px 13px 14px; outline: none; -webkit-appearance: none; }
.search input:focus { border-color: var(--accent); }
.clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.count { font-size: 0.82rem; color: var(--muted); }
.edad { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.edad::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.edad.verde { background: var(--chip-ok); color: var(--ok); }
.edad.amarillo { background: var(--chip-warn); color: var(--warn); }
.edad.rojo { background: var(--chip-bad); color: var(--bad); }

main { padding-block: 8px 24px; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.meta { grid-column: 1; font-size: 0.8rem; color: var(--muted); }
.sku { font-family: var(--f-mono); }
.price { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-family: var(--f-mono); font-weight: 700; font-size: 1.15rem; color: var(--price); font-variant-numeric: tabular-nums; white-space: nowrap; }
mark { background: transparent; color: var(--accent); font-weight: 700; }
.empty { padding: 32px 4px; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; }

.tools { border-top: 1px solid var(--line); padding-block: 18px 28px; display: grid; gap: 12px; }
.tools p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; text-decoration: none; font: 600 0.95rem var(--f-body); border-radius: 10px; padding: 11px 16px; cursor: pointer; border: 2px solid var(--accent); background: transparent; color: var(--accent); text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.more { width: 100%; margin-top: 12px; }
.msg { font-size: 0.9rem; min-height: 1.2em; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
