:root {
  color-scheme: dark;
  --bg: #0c1913; --paper: #14271d; --soft: #1b3427; --line: #385344;
  --ink: #edf3ed; --muted: #b8c8bc; --link: #c9ee8d; --action: #c0ed66;
  --on-action: #14210b; --good: #bce7bb; --good-bg: #254733;
  --low: #f5d997; --low-bg: #493a1d; --out: #edc2bc; --out-bg: #492f2b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg);
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f4f7ef; --paper: #fff; --soft: #e8f0df; --line: #bacbb2;
  --ink: #172e21; --muted: #506047; --link: #2d581b;
  --good: #23583d; --good-bg: #e4f4e3; --low: #70420d; --low-bg: #fff0c9;
  --out: #6d4540; --out-bg: #f7eae7;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 44px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 28px 0 20px; }
h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1.12; letter-spacing: -.045em; }
.updated { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
.updated.stale { color: var(--low); font-weight: 650; }
button { color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; font-size: .84rem; font-weight: 680; }
.theme { white-space: nowrap; min-height: 42px; }
#filters { padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.top, .facets, .extra { display: grid; gap: 10px; }
.top { grid-template-columns: 2.3fr 1fr; }
.facets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.extra { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }
label, legend { font-size: .78rem; font-weight: 700; }
input:not([type=radio]), select { display: block; width: 100%; min-width: 0; margin-top: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--bg); color: var(--ink); font-size: .87rem; min-height: 40px; }
input::placeholder { color: var(--muted); }
.stock { padding: 0; border: 0; margin: 11px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stock legend { margin: 0 0 5px; }
.stock label { position: relative; }
.stock input { position: absolute; opacity: 0; }
.stock span { display: block; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.stock input:checked + span { background: var(--action); border-color: var(--action); color: var(--on-action); }
.stock input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
details { margin-top: 11px; }
summary { font-size: .83rem; font-weight: 680; color: var(--link); }
.result-bar { min-height: 51px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .86rem; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; color: var(--muted); background: var(--soft); }
th:last-child, td:last-child { text-align: right; }
td { font-size: .84rem; }
td:first-child { width: 34%; }
tbody tr:last-child td { border-bottom: 0; }
.product { display: block; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--link); font-size: .91rem; font-weight: 730; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.product:hover { text-decoration: underline; text-underline-offset: 3px; }
.meta { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; line-height: 1.4; }
.price { font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 5px; font-size: .72rem; font-weight: 730; white-space: nowrap; color: var(--good); background: var(--good-bg); }
.badge.low { color: var(--low); background: var(--low-bg); }
.badge.out_of_stock { color: var(--out); background: var(--out-bg); }
.empty { padding: 12px 2px; color: var(--muted); }
.more { display: block; margin: 14px auto; padding: 9px 16px; }
[hidden] { display: none; }
.mobile-meta { display: none; }
dialog { width: min(520px, calc(100% - 28px)); max-height: 87dvh; overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
dialog::backdrop { background: rgb(4 13 8 / 72%); }
.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.detail-head h2 { margin: 4px 0; font-size: 1.35rem; line-height: 1.2; }
dialog dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin: 14px 0; }
dialog dl div { padding: 9px; min-width: 0; background: var(--bg); overflow-wrap: anywhere; }
dialog dt { font-size: .75rem; color: var(--muted); }
dialog dd { margin: 3px 0 0; font-size: .87rem; font-weight: 650; }
#copy-status { font-size: .8rem; color: var(--muted); padding-inline-start: 6px; }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 24px); }
  .page-head { padding: 18px 0 14px; }
  #filters { padding: 10px; }
  .top, .facets, .extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facets label:last-child { grid-column: 1 / -1; }
  th, td { padding: 9px 7px; }
  td:first-child { width: 54%; }
  th:nth-child(n+2):nth-child(-n+4), td.secondary { display: none; }
  .mobile-meta { display: block; }
  .badge { padding: 4px 5px; font-size: .67rem; }
}
