/* Радар: лента карточек на телефоне, вкладки снизу; цвет — только для сигналов */
:root {
  --bg: #f3f4f1; --card: #ffffff; --ink: #1b1d1a; --muted: #646a62; --line: #e1e4dd;
  --accent: #b5501c; --accent-soft: #f6e7dc; --good: #2d7a4f; --good-soft: #e1f0e6; --warn: #9a6a00;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tabs-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121412; --card: #1b1e1b; --ink: #e9ece6; --muted: #9aa197; --line: #2c302b;
    --accent: #f08a4b; --accent-soft: #3a2619; --good: #73c493; --good-soft: #1d3426; --warn: #e1b44d;
    color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font);
  -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 12px); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 10px)
  max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line); }
.top h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.icon-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 38px; height: 38px;
  font-size: 18px; cursor: pointer; }
main { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabs a { display: grid; justify-items: center; gap: 1px; padding: 6px 0; font-size: 11.5px; color: var(--muted);
  text-decoration: none; min-height: 48px; }
.tabs a .i { font-size: 17px; line-height: 1.2; }
.tabs a.on { color: var(--accent); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid;
  gap: 8px; min-width: 0; }
.row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; min-width: 0; }
.row img, .thumb { width: 76px; height: 76px; border-radius: 9px; object-fit: cover; background: var(--line); }
.title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 13px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.price s { color: var(--muted); font-weight: 400; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; border-radius: 999px; padding: 2px 9px; background: var(--bg); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.hot { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; font-weight: 600; }
.line { font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.line a { color: var(--accent); }
.links { display: flex; gap: 14px; font-size: 13.5px; flex-wrap: wrap; }
.links a { color: var(--accent); text-decoration: none; font-weight: 600; }

.bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 7px 11px; font-size: 13.5px; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.field input { border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 8px 10px; width: 100%;
  font-size: 16px; color: var(--ink); }
.btn { border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 600;
  cursor: pointer; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.list { display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 12px; border-top: 1px solid var(--line);
  text-decoration: none; align-items: center; min-width: 0; }
.item:first-child { border-top: 0; }
.item .n { font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; color: var(--muted); }
.item .n b { color: var(--ink); font-size: 15px; }
.meter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.switch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px;
  border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch input { width: 44px; height: 26px; accent-color: var(--accent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.kv span:nth-child(odd) { color: var(--muted); }
h2 { font-size: 15px; margin: 8px 0 0; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.empty, .error { text-align: center; color: var(--muted); padding: 32px 12px; }
.error { color: var(--accent); }
.login { max-width: 360px; margin: 10vh auto 0; display: grid; gap: 12px; text-align: center; }
.login p { color: var(--muted); margin: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 9px 14px; font-size: 14px; z-index: 20; }
@media (prefers-reduced-motion: no-preference) { .card, .item { transition: background .15s; } }
