:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2622;
  --muted: #7a7068;
  --line: #ebe4da;
  --accent: #2f6f4f;
  --accent-text: #ffffff;
  --good: #2f8f5b;
  --ok: #c98a14;
  --bad: #b8433a;
  --chip: #f2ece3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1916;
    --surface: #262220;
    --text: #f1ebe4;
    --muted: #a99f95;
    --line: #3a3430;
    --accent: #5fae84;
    --chip: #322d29;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; }
nav { display: flex; gap: 4px; margin-left: auto; }
nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
nav a.active, nav a:hover { background: var(--chip); color: var(--text); }

.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  color: var(--muted); font-size: .9rem; margin-bottom: 16px;
}
.status form { margin-left: auto; }
.error { color: var(--bad); }

h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600;
}
.btn.secondary { background: var(--chip); color: var(--text); }
.btn.small { padding: 5px 10px; font-size: .9rem; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 5px 12px; border-radius: 999px; background: var(--chip);
  text-decoration: none; font-size: .9rem;
}
.chip.on { background: var(--text); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none;
  border: 1px solid var(--line);
}
.card .photo { position: relative; aspect-ratio: 3 / 2; background: var(--chip); }
.card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.card .addr { font-weight: 650; }
.card .facts, .muted { color: var(--muted); font-size: .9rem; }
.card .headline { font-style: italic; }
.card .profile { font-size: .8rem; color: var(--muted); }

.score {
  position: absolute; top: 10px; left: 10px;
  min-width: 46px; text-align: center; padding: 4px 10px; border-radius: 999px;
  color: #fff; font-weight: 700; font-size: .95rem;
}
.score.inline { position: static; display: inline-block; }
.s-good { background: var(--good); }
.s-ok { background: var(--ok); }
.s-bad { background: var(--bad); }

ul.pc { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
ul.pc li { padding-left: 1.4em; text-indent: -1.4em; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.gallery img { height: 260px; border-radius: 10px; scroll-snap-align: start; flex: none; max-width: 90vw; object-fit: cover; }
.facts-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.facts-table td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-table td:first-child { color: var(--muted); width: 45%; padding-right: 12px; }
.description { white-space: pre-line; font-size: .95rem; }
details summary { cursor: pointer; font-weight: 600; }

form.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  font: inherit; padding: 9px 11px; border-radius: 10px; width: 100%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
textarea { min-height: 180px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 400; }
.checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form > * { flex: 1 1 200px; }
.inline-form .btn { flex: 0 0 auto; }
code { background: var(--chip); padding: 1px 6px; border-radius: 6px; }

.login { max-width: 360px; margin: 12vh auto; }

.labels { display: flex; flex-wrap: wrap; gap: 4px; }
.label { font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.label.warn { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--text); }
.score.s-good, .score.s-ok, .score.s-bad { font-size: .85rem; }
.reasons { columns: 2 220px; font-size: .9rem; }
.reasons li { break-inside: avoid; }
.plus { color: var(--good); }
.minus { color: var(--bad); }
.range { display: flex; gap: 8px; align-items: center; }
.range input { max-width: 110px; }
.range select { max-width: 110px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 16px; }
