:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --line: #2a2f3a;
  --text: #e7e9ee;
  --muted: #99a1b3;
  --accent: #4ade80;
  --accent-dim: #14532d;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9; --surface: #fff; --surface-2: #f0f2f5; --line: #e2e5ea;
    --text: #131720; --muted: #6b7280; --accent: #16a34a; --accent-dim: #dcfce7;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding: 32px; }
.err { color: var(--danger); min-height: 20px; margin: 4px 0 0; font-size: 13px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.auth-card h1 { margin: 0; font-size: 28px; }
.auth-card p { margin: 0; }

/* ---------- chrome ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; }
nav { display: flex; gap: 4px; flex: 1; }
.right { display: flex; gap: 6px; }
main { max-width: 1000px; margin: 0 auto; padding: 20px 18px 60px; }
footer { max-width: 1000px; margin: 0 auto; padding: 0 18px 30px; }

/* ---------- controls ---------- */
button {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid transparent;
  padding: 8px 14px; background: var(--accent); color: #06240f; font-weight: 600;
}
button:hover { filter: brightness(1.08); }
.ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
.ghost:hover { color: var(--text); background: var(--surface-2); }
.tab { background: transparent; color: var(--muted); border: none; font-weight: 500; }
.tab.active { background: var(--surface-2); color: var(--text); }
input, select {
  font: inherit; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.searchbar { margin-bottom: 18px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.grid { display: grid; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.hit { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.hit:hover { border-color: var(--accent); }
.hit .name { flex: 1; min-width: 0; }
.hit .name b { display: block; font-weight: 600; }
.hit .price { text-align: right; white-space: nowrap; }
.hit .price .from { font-size: 19px; font-weight: 700; color: var(--accent); }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; border: 1px solid var(--line);
}
.pill.warn { background: transparent; color: var(--warn); border-color: var(--warn); }
.pill.local { color: var(--muted); }

/* ---------- product ---------- */
.back { margin-bottom: 14px; }
.p-head { margin-bottom: 16px; }
.p-head h2 { margin: 0 0 6px; }
.offers { width: 100%; border-collapse: collapse; }
.offers th, .offers td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.offers th { color: var(--muted); font-weight: 500; font-size: 13px; }
.offers tr:first-child td { color: var(--accent); font-weight: 600; }
.offers .num { text-align: right; white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.spark { width: 100%; height: 90px; margin-top: 8px; }

/* ---------- lists ---------- */
.item { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.item .name { flex: 1; min-width: 0; }
.item .name b { display: block; }
.item input[type=number] { width: 68px; }
.item .watch { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.total b { color: var(--accent); font-size: 18px; }
.drop { color: var(--accent); font-weight: 600; }
