:root {
  color-scheme: dark;
  --bg: #0d1117; --surface: #161b22; --surface2: #21262d; --surface3: #0f141b;
  --border: #30363d; --text: #e6edf3; --muted: #8b949e; --blue: #58a6ff;
  --green: #3fb950; --green-bg: rgba(63,185,80,.16); --yellow: #d29922; --red: #f85149; --red-bg: rgba(248,81,73,.16);
  --promo-bg: #111827; --promo-border: rgba(88,166,255,.35);
}
body.light {
  color-scheme: light;
  --bg: #f6f8fa; --surface: #ffffff; --surface2: #f0f3f6; --surface3: #f8fafc;
  --border: #d0d7de; --text: #1f2328; --muted: #59636e; --blue: #0969da;
  --green: #1a7f37; --green-bg: #dafbe1; --yellow: #9a6700; --red: #cf222e; --red-bg: #ffebe9;
  --promo-bg: #eef6ff; --promo-border: #0969da33;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, p { margin: 0; } h1 { font-size: 20px; } h2 { font-size: 15px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar p, .muted { color: var(--muted); margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill { border: 1px solid var(--border); background: var(--surface2); color: var(--muted); padding: 7px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.status-pill.ok { color: var(--green); border-color: rgba(63,185,80,.45); }
.status-pill.warn { color: var(--yellow); border-color: rgba(210,153,34,.45); }
.status-pill.fail { color: var(--red); border-color: rgba(248,81,73,.45); }
main { padding: 22px 28px 40px; max-width: 1500px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.10); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#lastSearched { color: var(--muted); font-size: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 13px; }
label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .045em; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); padding: 9px 10px; outline: none; font-size: 13px; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,166,255,.13); }
.actions, .promo-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 15px; }
button { border: 0; border-radius: 8px; padding: 10px 15px; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.compact { padding: 7px 11px; font-size: 12px; }
.primary { background: var(--green); color: #07120a; }
.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.promo-action { background: var(--blue); color: white; }
.message { color: var(--muted); margin-top: 10px; font-size: 13px; }
.message.error { color: var(--red); } .message.good { color: var(--green); } .message.warn { color: var(--yellow); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; }
.metrics div { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.metrics strong { display: block; font-size: 23px; margin-bottom: 3px; }
.metrics span { color: var(--muted); font-size: 12px; }
.hidden { display: none; }
.link-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.link-grid a { background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 9px; align-items: center; width: min(860px, 100%); }
.filter-row input { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface2); color: var(--muted); font-size: 11px; text-transform: uppercase; cursor: pointer; user-select: none; position: sticky; top: 0; }
th:hover { color: var(--blue); } td { font-size: 13px; } tr:hover td { background: rgba(88,166,255,.05); }
.empty { text-align: center; color: var(--muted); padding: 35px; }
.score { font-weight: 800; } .score.high { color: var(--green); } .score.good { color: var(--blue); } .score.avg { color: var(--yellow); } .score.low { color: var(--red); }
.price { font-weight: 800; border-radius: 8px; display: inline-block; padding: 3px 7px; }
.price.same { color: var(--text); background: transparent; }
.price.below { color: var(--green); background: var(--green-bg); border: 1px solid rgba(63,185,80,.28); }
.price.above { color: var(--red); background: var(--red-bg); border: 1px solid rgba(248,81,73,.28); }
.source { border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; background: var(--surface2); font-size: 12px; }
.small { color: var(--muted); font-size: 12px; }
footer { color: var(--muted); border-top: 1px solid var(--border); padding: 18px 28px 34px; }
.data-notice { margin-top: 12px; border: 1px solid rgba(210,153,34,.65); background: rgba(210,153,34,.11); color: #f0c36a; padding: 11px 13px; border-radius: 10px; font-weight: 800; }
.data-notice.live { border-color: rgba(63,185,80,.55); background: rgba(63,185,80,.10); color: var(--green); }
.data-notice.demo { border-color: rgba(248,81,73,.65); background: rgba(248,81,73,.12); color: #ff8b85; }
.source.demo-source, .quality-badge.demo { border-color: rgba(248,81,73,.65); background: rgba(248,81,73,.14); color: #ff8b85; font-weight: 900; }
.quality-badge { border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; background: var(--surface2); font-size: 12px; font-weight: 800; }
.quality-badge.live { border-color: rgba(63,185,80,.45); color: var(--green); }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.usage-item { background: var(--surface3); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.usage-item strong { display: block; font-size: 19px; margin: 6px 0; }
.usage-bar { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.usage-fill { height: 100%; background: var(--green); width: 0%; }
.usage-fill.warn { background: var(--yellow); } .usage-fill.danger { background: var(--red); }
.info-box { margin-top: 12px; color: var(--muted); }
.info-box summary { cursor: pointer; color: var(--text); font-weight: 800; }
.info-box ul { margin: 8px 0 8px 18px; padding: 0; }
.promo-card { background: linear-gradient(180deg, var(--promo-bg), var(--surface)); border-color: var(--promo-border); }
.switch-label { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.switch-label input { width: auto; transform: scale(1.2); }
.promo-table-wrap table { min-width: 1000px; }
@media (max-width: 900px) {
  .topbar, .section-head.stacked-mobile { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  main { padding: 14px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .filter-row { grid-template-columns: 1fr 1fr; width: 100%; }
}
@media (max-width: 560px) {
  .topbar { padding: 14px; }
  .grid-form, .metrics, .filter-row, .usage-grid { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  table { min-width: 980px; }
}
