:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1f1b16;
  --muted: #6b645a;
  --line: #e2dccf;
  --brand: #2f5d3a;
  --brand-ink: #ffffff;
  --gold: #b7862b;
  --ok: #1f7a3d;
  --ok-bg: #e5f4e9;
  --warn: #a4320f;
  --warn-bg: #fdeae3;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.narrow { max-width: 420px; }

.masthead { padding: 12px 0 18px; border-bottom: 3px solid var(--gold); margin-bottom: 20px; }
.masthead h1 { margin: 2px 0 0; font-size: 1.6rem; line-height: 1.2; }
.eyebrow { margin: 0; color: var(--muted); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- forms ---------- */
.form .field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.form.compact .field { margin-bottom: 14px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.req { color: var(--warn); }
input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=password], input[type=search], select {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border: 1px solid #cfc7b7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.checks { display: grid; gap: 8px; }
.logo { display: block; width: 64px; height: 64px; border-radius: 50%; margin-bottom: 10px; }
.field .choice {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; margin: 0;
  padding: 10px 14px; border: 1px solid #cfc7b7; border-radius: 8px; background: #fff; cursor: pointer;
  flex: 1 1 120px;
}
.field .choice:has(input:checked) { border-color: var(--brand); background: #eef4ef; }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.has-err input, .has-err select, .has-err .field .choice, .has-err .choice { border-color: var(--warn); }
.err { color: var(--warn); margin: 6px 0 0; font-size: .9rem; }
.hint { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

.alert { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; cursor: pointer;
  padding: 12px 18px; background: #e8e2d4; color: var(--ink);
}
.btn.block { display: block; width: 100%; }
.btn.primary { background: var(--brand); color: var(--brand-ink); font-size: 1.05rem; padding: 14px 18px; }
.btn.go { background: var(--ok); color: #fff; padding: 12px 16px; min-width: 112px; }
.btn.ghost { background: transparent; border: 1px solid #cfc7b7; color: var(--muted); }
.btn.small { padding: 8px 12px; font-size: .875rem; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- success ---------- */
.done { text-align: center; }
.big-no {
  font-size: 4.5rem; font-weight: 800; letter-spacing: .06em; line-height: 1;
  margin: 8px 0 16px; color: var(--brand); font-variant-numeric: tabular-nums;
}

/* ---------- admin ---------- */
.topbar { background: var(--brand); color: #fff; }
.topbar-in { max-width: 640px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.who { font-size: .875rem; opacity: .9; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.stats > div { padding: 10px 8px; text-align: center; font-size: .8rem; color: var(--muted); }
.stats > div + div { border-left: 1px solid var(--line); }
.stats span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab { font: inherit; background: none; border: 0; padding: 10px 12px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }

.search { font-size: 1.15rem !important; padding: 14px !important; position: sticky; top: 8px; z-index: 2; }
#list-label { margin: 10px 2px 6px; }

.results { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-no { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.4em; color: var(--brand); }
.row-info { flex: 1; min-width: 0; }
.row-name { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { font-size: .825rem; color: var(--muted); overflow-wrap: anywhere; }
.row-similar { font-size: .825rem; color: #7a4b00; background: #fdf0d2; border-radius: 6px; padding: 3px 8px; margin-top: 4px; }
.row-status { font-size: .825rem; color: var(--ok); font-weight: 600; }
.row.is-collected { background: #f3f8f4; }
.row.is-collected .row-no { color: var(--muted); }
.row.flash-ok { animation: flashOk 1.2s ease-out; }
.row.flash-warn { animation: flashWarn 2s ease-out; }
@keyframes flashOk { from { background: #bfe6c9; } }
@keyframes flashWarn { from { background: #f8c7b6; } }
.empty { padding: 18px; margin: 0; color: var(--muted); text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 8px;
  background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 10;
}
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }

@media (max-width: 420px) {
  .row { flex-wrap: wrap; }
  .row-act { width: 100%; }
  .row-act .btn { width: 100%; }
  .big-no { font-size: 3.6rem; }
}
