:root {
  --bg: #f2f2f7; --card: #ffffff; --text: #1c1c1e; --muted: #6e6e73; --line: #e5e5ea;
  --govt: #11873f; --warn: #d97706; --bad: #dc2626; --chip: #eef7f1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f2f2f7; --muted: #98989f; --line: #2c2c2e; --govt: #34c46c; --chip: #14301f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0 0 8px; font-size: 26px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; padding: 8px; border: 0; border-radius: 10px; background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--govt); color: #fff; }
.count { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 4px 6px; }
.note { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.link { cursor: pointer; }
.emoji { font-size: 32px; width: 40px; text-align: center; }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 600; }
.sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; white-space: nowrap; }
.price { font-weight: 700; }
.mandi { font-size: 13px; color: var(--muted); }
.mandi.live { color: var(--govt); font-weight: 600; }
.badge { display: inline-grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 12px; width: 30px; height: 30px; flex: none; }
.badge.sm { width: 20px; height: 20px; font-size: 9px; border-radius: 5px; vertical-align: middle; margin-right: 4px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.pill.live { background: var(--chip); color: var(--govt); }
.pill.est { background: #fff1e0; color: var(--warn); }
.pill.you { background: #e0edff; color: #2563eb; }
.controls { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
input[type=search], input[type=text], input[type=password], input[type=number], select {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
input[type=search] { flex: 1; min-width: 160px; }
.seg { display: flex; background: var(--line); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--card); font-weight: 600; }
button.btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 9px 14px; background: var(--govt); color: #fff; cursor: pointer; }
button.ghost { background: transparent; color: var(--govt); border: 1px solid var(--line); }
button.icon { border: 0; background: none; color: var(--govt); font-size: 18px; cursor: pointer; padding: 4px 6px; }
.back { margin-bottom: 10px; }
.big { font-size: 34px; font-weight: 800; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; position: relative; padding-top: 22px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 12px; }
.bar .fill { width: 100%; border-radius: 6px 6px 0 0; }
.bar .val { font-weight: 700; margin-bottom: 3px; }
.bar .lbl { color: var(--muted); margin-top: 4px; }
.rule { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--govt); font-size: 11px; color: var(--govt); font-weight: 700; }
.oos { opacity: .5; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--line); color: var(--text); font-size: 18px; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .emoji { font-size: 48px; width: auto; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--govt); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
label.field { display: block; margin: 8px 0; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label.field input, label.field select { width: 100%; }
a { color: var(--govt); }
