:root {
  --bg: #0e1014;
  --bg-elev: #161920;
  --bg-hover: #1d212b;
  --line: #2a2f3a;
  --text: #ece7dc;
  --muted: #9a9487;
  --faint: #6d685e;
  --amber: #e2b15a;
  --amber-dim: #8a6a32;
  --in: #5dcaa5;
  --out: #d97771;
  --err: #8d93a1;
  --unk: #c4b48a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --sans: "Figtree", "Noto Sans SC", "PingFang SC", sans-serif;
  --serif: "Fraunces", "Songti SC", serif;
  --mono: "IBM Plex Mono", "Noto Sans SC", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 177, 90, 0.08), transparent 55%),
    radial-gradient(900px 600px at 110% 0%, rgba(93, 202, 165, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
}

a { color: inherit; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 22px 80px; }

header.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.brand { display: flex; gap: 14px; align-items: center; }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 32px;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand h1 span { color: var(--amber); }
.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.meta {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.meta strong { color: var(--text); font-weight: 600; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.search input::placeholder { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  border-color: var(--amber-dim);
  color: var(--text);
  background: #221c12;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 70vh;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.vendors { display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.vendors h2, .skus-head h2 {
  margin: 0;
  padding: 14px 16px 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 650;
}
.vendor-list { overflow: auto; padding: 0 8px 12px; }
.vendor {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.vendor:hover { background: var(--bg-hover); }
.vendor[aria-current="true"] {
  background: #241d12;
  outline: 1px solid var(--amber-dim);
}
.vendor .name { font-size: 14px; }
.vendor .counts {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.vendor .counts b { color: var(--in); font-weight: 500; }

.skus { min-width: 0; display: flex; flex-direction: column; }
.skus-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-right: 16px;
}
.skus-head .sub { color: var(--muted); font-size: 13px; }

.table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
th {
  position: sticky; top: 0; background: #1a1e26;
  text-align: left; color: var(--faint); font-weight: 600;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
td.name { font-weight: 600; }
td.pid, td.price { font-family: var(--mono); font-size: 12px; color: var(--muted); }
td.loc { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--unk); }
.pill.in .dot { background: var(--in); box-shadow: 0 0 10px var(--in); }
.pill.out .dot { background: var(--out); }
.pill.err .dot { background: var(--err); }
.pill.unk .dot { background: var(--unk); }

.buy {
  display: inline-block;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  text-decoration: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 650;
}
.buy:hover { background: #2a2114; }

.foot {
  margin-top: 22px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
}
.foot a { color: var(--muted); }

.empty { padding: 40px 16px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  header.top { flex-direction: column; }
  .meta { text-align: left; }
  .toolbar { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .vendors { max-height: 280px; }
}
