:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #1d1b19;
  --muted: #6b655e;
  --line: #e4dfd7;
  --accent: #8a3b12;
  --accent-soft: #f5e6dc;
  --chip: #ece7df;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #211e1b;
    --text: #efe9e2;
    --muted: #a39a90;
    --line: #36312c;
    --accent: #f0a06b;
    --accent-soft: #3a2a1f;
    --chip: #2c2824;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.4; }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 0 12px; }
h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }
.meta { margin: 2px 0 10px; color: var(--muted); font-size: .85rem; }
.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--muted); }
#q { width: 100%; font: inherit; font-size: 1rem; padding: 11px 12px 11px 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
#q:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.filters { padding: 14px 0 4px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips button { flex: none; font: inherit; font-size: .85rem; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--chip); color: var(--text); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.chips small { opacity: .7; margin-left: 4px; }
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
label { display: flex; flex-direction: column; gap: 3px; font-size: .75rem; color: var(--muted); }
select { font: inherit; font-size: .9rem; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }

.count { color: var(--muted); font-size: .85rem; margin: 10px 0 8px; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.head { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; }
.title { min-width: 0; }
.name { display: block; font-weight: 600; text-transform: capitalize; overflow-wrap: anywhere; }
.sub { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: .75rem; color: var(--muted); }
.badge { background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.sizes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 55%; }
.size { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; padding: 4px 8px; border-radius: 8px; background: var(--chip); }
.size b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.size span { font-size: .7rem; color: var(--muted); }

.details { border-top: 1px solid var(--line); padding: 8px 14px 12px; font-size: .82rem; overflow-x: auto; }
.details table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.details th, .details td { text-align: right; padding: 5px 6px; white-space: nowrap; }
.details th:first-child, .details td:first-child { text-align: left; }
.details th { color: var(--muted); font-weight: 500; }
.details tr + tr td { border-top: 1px solid var(--line); }
.details p { margin: 8px 0 0; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.foot { color: var(--muted); font-size: .78rem; padding-top: 24px; padding-bottom: 32px; }

@media (max-width: 520px) {
  .head { flex-direction: column; align-items: stretch; }
  .sizes { max-width: none; justify-content: flex-start; }
  .size { align-items: flex-start; }
}
