:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --fg: #1d1c1a;
  --muted: #6f6b65;
  --line: #e4e0d9;
  --accent: #14532d;
  --accent-fg: #ffffff;
  --warn: #9a3412;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --panel: #1e1d17;
    --fg: #eeece6;
    --muted: #9b968c;
    --line: #302e26;
    --accent: #8fd0a8;
    --accent-fg: #14211a;
    --warn: #e9a178;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 28px 18px 64px;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 78rem; margin: 0 auto; }
a { color: inherit; }

header.top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
header.top h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; }
header.top h1 a { text-decoration: none; }
header.top .count { color: var(--muted); font-size: .9rem; }
header.top nav { margin-left: auto; font-size: .85rem; }
header.top nav a { color: var(--muted); margin-left: 14px; }

form.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
label { display: flex; flex-direction: column; gap: 5px; font-size: .76rem; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
select, input, button {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  min-width: 9rem;
}
button { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); cursor: pointer; min-width: 7rem; }
form.filters label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
  color: var(--fg);
  padding-bottom: 10px;
}
form.filters label.check input { width: 16px; height: 16px; accent-color: var(--accent); }

form.filters .reset { align-self: end; font-size: .85rem; color: var(--muted); padding-bottom: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card .price { font-size: 1.08rem; font-weight: 600; }
.card .price small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.card h2 { font-size: .92rem; margin: 0; font-weight: 500; line-height: 1.35; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card .meta { color: var(--muted); font-size: .82rem; }
.card .foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.tag {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.g { border-color: var(--accent); color: var(--accent); }
.tag.none { color: var(--warn); border-color: var(--warn); }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 28px; color: var(--muted); font-size: .9rem; }
.pager a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; background: var(--panel); }

.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }
.detail .shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detail .shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--line); }
.detail .desc { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: .92rem; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: .92rem; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail .quote { border-left: 3px solid var(--accent); padding: 6px 0 6px 12px; color: var(--fg); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.stale { color: var(--warn); }

footer { margin-top: 44px; color: var(--muted); font-size: .8rem; line-height: 1.6; }

.tag.raw { border-style: dashed; }

table.facts { margin-bottom: 14px; }
table.facts td { vertical-align: top; padding: 8px 10px; }
table.facts td.k { color: var(--muted); white-space: nowrap; width: 9rem; }
table.facts .val { font-weight: 600; }
table.facts .none { color: var(--muted); }
table.facts .guess { color: var(--warn); font-size: .85rem; }
table.facts .cite {
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
  border-left: 2px solid var(--line);
  padding-left: 8px;
}

.tag.src { border-style: dotted; opacity: .75; }
