:root {
  color-scheme: light dark;
  --bg: #f7f4ef;
  --fg: #1f1c18;
  --muted: #6b6258;
  --card: #fffdf9;
  --accent: #7a1f2b;
  --border: #ded5c8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --fg: #f1eae0;
    --muted: #b3a89a;
    --card: #211d19;
    --accent: #e7a3ad;
    --border: #3a332c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.brand { font-weight: 700; text-decoration: none; font-size: 1.15rem; }
nav { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.subject { color: var(--muted); font-size: .85rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
main { width: min(52rem, 100%); margin: 0 auto; padding: 1.25rem 1.1rem 3rem; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .75rem; }
.card, .empty { background: var(--card); border: 1px solid var(--border); border-radius: .8rem; padding: 1.25rem; }
.empty p { margin: .5rem 0; }
.muted { color: var(--muted); }
.flash, .error { border-radius: .5rem; padding: .65rem .8rem; }
.flash { background: #e7f0e0; color: #1f3a16; }
.error { background: #f7e0e0; color: #5a1414; }
.button {
  display: inline-block;
  padding: .6rem .9rem;
  border-radius: .5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.link-button {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
code { font-size: .92em; }
@media (max-width: 34rem) {
  .subject { max-width: 9rem; }
}
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
.actions { margin: 1rem 0 .25rem; }
button.button {
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: .6rem .9rem;
  border-radius: .5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.filters { margin-bottom: 1rem; }
.filter-form { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: end; }
.filter-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
input[type="search"], select {
  font: inherit;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .45rem;
  padding: .45rem .55rem;
  min-width: 9rem;
}
.listing-meta { margin: 0 0 1rem; }
.band { margin-bottom: 2rem; }
.band h2 { margin-top: 0; }
.cards { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.offer { display: flex; gap: .9rem; align-items: flex-start; }
.bottle { flex: 0 0 auto; object-fit: contain; background: #fff; border-radius: .35rem; }
.offer-body { min-width: 0; }
.offer h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.offer p { margin: .25rem 0; }
.price { font-weight: 700; font-size: 1.05rem; }
.price s { color: var(--muted); font-weight: 400; margin-left: .35rem; }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: .3rem; padding: .05rem .35rem; font-size: .78rem; vertical-align: middle; }
.evidence { font-size: .9rem; }
.summary { font-size: .92rem; border-left: 3px solid var(--border); padding-left: .6rem; }
.warning { color: #8a4b00; }
.small { font-size: .82rem; }
.pagination { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
.button.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--border); }
.detail-head { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 1.2rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.evidence-list, .citations { padding-left: 1.1rem; }
.evidence-list li, .citations li { margin: .35rem 0; }
.summary-block { border: 1px solid var(--border); border-radius: .6rem; padding: .9rem; background: var(--bg); }
@media (max-width: 34rem) {
  .cards { grid-template-columns: 1fr; }
  .filter-form label { flex: 1 1 8rem; }
  input[type="search"], select { width: 100%; }
}
