:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1d2230;
  --muted: #6b7280;
  --border: #e3e6eb;
  --accent: #1f7a4d;
  --accent-text: #fff;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok-bg: #e8f5ee;
  --err-bg: #fdecec;
  --info-bg: #eef2fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1c2027;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --border: #2c323b;
    --accent: #35a26c;
    --ok-bg: #18301f;
    --err-bg: #3a1c1c;
    --info-bg: #1c2433;
  }
}

* { 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: var(--accent); }
h1 { font-size: 1.6rem; margin: 1rem 0; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.danger { color: var(--danger); }

.top { background: var(--card); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
nav { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; }
.cards { list-style: none; padding: 0; margin: 0; }
.listing-card .title { font-weight: 600; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.price { font-weight: 700; margin: .2rem 0; }
.price.big { font-size: 1.4rem; }
.description { white-space: pre-line; margin-top: .75rem; overflow-wrap: anywhere; }
.clamp { max-height: 9em; overflow: hidden; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

.villages { font-size: 1.1rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.chip { padding: .25rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--text); font-size: .9rem; }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.alert { padding: .7rem 1rem; border-radius: 8px; background: var(--info-bg); }
.alert-ok { background: var(--ok-bg); }
.alert-error { background: var(--err-bg); }
ul.alert { padding-left: 2rem; }

.stack { display: flex; flex-direction: column; gap: .8rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
input, select, textarea, button { font: inherit; }
input, select, textarea { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
button, .btn { display: inline-block; padding: .5rem 1rem; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }
button.link.danger { color: var(--danger); }
.btn-ok { background: var(--accent); }
.btn-warn { background: var(--warn); }
.btn-danger { background: var(--danger); }
form.inline { display: inline; }

.badge { font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--info-bg); white-space: nowrap; }
.status-published { background: var(--ok-bg); }
.status-rejected { background: var(--err-bg); }

.mod-item { border-left-width: 5px; }
.mod-item.risk-low { border-left-color: var(--accent); }
.mod-item.risk-mid { border-left-color: var(--warn); }
.mod-item.risk-high { border-left-color: var(--danger); }
.flags { margin: .5rem 0; padding-left: 1.2rem; color: var(--warn); }
.author { margin-top: .6rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.reject-form { display: inline-flex; gap: .4rem; }
.reject-form input { width: 14rem; padding: .45rem .6rem; }

.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form input[name=pattern] { flex: 1 1 14rem; width: auto; }
.inline-form input[name=weight] { width: 6rem; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); }

@media (max-width: 560px) {
  .reject-form { display: flex; width: 100%; }
  .reject-form input { flex: 1; width: auto; }
}
