
:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --ink: #18211d;
  --ink-soft: #46554d;
  --muted: #6b7a72;
  --line: #e0dfd6;
  --line-strong: #cdccc1;
  --accent: #1f4d3a;
  --accent-ink: #ffffff;
  --accent-soft: #e7efe9;
  --accent-line: #c2d6c9;
  --warn: #8a5a12;
  --warn-soft: #f7eeda;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(24,33,29,.05), 0 6px 20px -12px rgba(24,33,29,.18);
  --maxw: 54rem;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --surface: #161d19;
    --surface-2: #1d2621;
    --ink: #e9ebe6;
    --ink-soft: #b9c4bd;
    --muted: #8e9d95;
    --line: #26302a;
    --line-strong: #36423a;
    --accent: #78b996;
    --accent-ink: #0f1411;
    --accent-soft: #1a2620;
    --accent-line: #2c3f34;
    --warn: #e0b267;
    --warn-soft: #2a2317;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; padding-bottom: 12px; }
.brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: .01em;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand svg { flex: none; color: var(--accent); }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}
nav.tabs a:hover { background: var(--surface-2); color: var(--ink); }
nav.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

main { padding: 28px 0 72px; }
h1 { font-family: var(--serif); font-size: 1.65rem; line-height: 1.25; margin: 0 0 .35rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-size: 1.2rem; margin: 2rem 0 .6rem; font-weight: 600; }
h3 { font-size: .95rem; margin: 1.4rem 0 .4rem; font-weight: 650; }
.lede { color: var(--muted); margin: 0 0 1.75rem; max-width: 42rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: 2px; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pid { font-family: var(--mono); font-size: .95rem; font-weight: 600; letter-spacing: .02em; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .92rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card .actions { margin-top: auto; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.chip.listed   { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.chip.claimed  { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip.returned { background: var(--surface-2); color: var(--ink-soft); }
.chip.sold, .chip.disposed { background: transparent; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 11px 16px; min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none; cursor: pointer;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.quiet { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn.danger { background: transparent; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: .875rem; width: auto; }
@media (min-width: 520px) { .btn.auto { width: auto; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > * { flex: 1 1 10rem; }

/* ---------- forms ---------- */
form.stack { display: flex; flex-direction: column; gap: 18px; max-width: 34rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: .9rem; font-weight: 600; }
.field .hint { font-size: .82rem; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: 44px;
  width: 100%;
  appearance: none;
}
textarea { min-height: 88px; resize: vertical; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, nav.tabs a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; }
.filters .field { flex: 1 1 11rem; gap: 4px; }
.filters .field > label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }

/* ---------- notices / prose ---------- */
.notice {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 1.5rem;
}
.notice h2 { margin-top: 0; }
.empty { color: var(--muted); text-align: center; padding: 48px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.prose { max-width: 38rem; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: .5rem; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.site-foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: .85rem; }

/* ---------- admin ---------- */
.admin-head { background: var(--accent); }
.admin-head .wrap { padding-top: 12px; padding-bottom: 10px; }
.admin-head .brand, .admin-head .brand svg { color: var(--accent-ink); }
.admin-head nav.tabs a { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
.admin-head nav.tabs a:hover { background: color-mix(in srgb, var(--accent-ink) 14%, transparent); color: var(--accent-ink); }
.admin-head nav.tabs a[aria-current="page"] { background: var(--accent-ink); color: var(--accent); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.tile .n { font-family: var(--serif); font-size: 1.9rem; line-height: 1; display: block; }
.tile .k { font-size: .82rem; color: var(--muted); }
.tile.flag .n { color: var(--warn); }
.row {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.row .meta { color: var(--muted); font-size: .88rem; }
.row.unhandled { border-left: 3px solid var(--warn); }
.compare { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .compare { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel.mine { border-color: var(--accent-line); background: var(--accent-soft); }
.panel h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 8.5rem 1fr; gap: 3px 12px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.log { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 14px; margin-bottom: 12px; }
details.fold > summary { cursor: pointer; padding: 13px 0; font-weight: 600; }
details.fold[open] { padding-bottom: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
