:root {
  --bg: #faf7f1;
  --fg: #2a241c;
  --muted: #74695a;
  --rule: #e4dccd;
  --panel: #f2ebdf;
  --accent: #8a5a1f;
  --link: #6b3f12;
  --good: #3d6b3a;
  --good-bg: #e6efdf;
  --maybe: #8a5a1f;
  --maybe-bg: #f6e8cf;
  --danger: #9b2c2c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1714;
    --fg: #ebe4d8;
    --muted: #a39782;
    --rule: #3a332a;
    --panel: #24201b;
    --accent: #d9a65e;
    --link: #e3b878;
    --good: #9ccc8f;
    --good-bg: #26331f;
    --maybe: #e3b878;
    --maybe-bg: #3a2e1c;
    --danger: #e08a8a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
}
a { color: var(--link); }
.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
  max-width: 760px; margin: 0 auto; padding: 22px 16px 14px; border-bottom: 3px double var(--rule);
}
.mark { border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 700; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }
.masthead nav { display: flex; gap: 16px; }
.masthead nav a, .kicker, .meta, .facts, .hint, label, button, .button, .badge, footer, .flash, .crumb, summary, select, input, textarea {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.masthead nav a { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--fg); }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; }
h2 { font-size: 1.45rem; margin: 32px 0 12px; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted, .meta, .hint, .facts { color: var(--muted); }
.meta, .facts { font-size: 0.85rem; }
.crumb { margin: 20px 0 -16px; font-size: 0.85rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.flash { margin: 20px 0 0; padding: 10px 14px; background: var(--good-bg); color: var(--good); border-radius: 6px; font-size: 0.9rem; }

.flash.problem { background: transparent; border: 1px solid var(--danger); color: var(--danger); }

.items { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.items li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.items .item-name { font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.items .meta { display: block; }
.items .empty { color: var(--muted); }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 0.72rem; font-weight: 600; vertical-align: 2px; }

.find { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.find.new { border-left: 3px solid var(--accent); padding-left: 12px; }
.find.dismiss, .find.ended { opacity: 0.6; }
.thumb { flex: none; width: 96px; height: 96px; border-radius: 6px; overflow: hidden; background: var(--panel); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.find-body { min-width: 0; flex: 1; }
.find h3 { font-size: 1.1rem; line-height: 1.3; margin: 2px 0 2px; overflow-wrap: anywhere; }
.find h3 a { text-decoration: none; }
.find h3 a:hover { text-decoration: underline; }
.find p { margin: 0 0 6px; }
.kicker { font-size: 0.75rem; color: var(--muted); margin: 0; }
.kicker a { color: var(--muted); }
.match { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 4px; }
.match.strong { color: var(--good); background: var(--good-bg); }
.match.possible { color: var(--maybe); background: var(--maybe-bg); }
.reason { font-size: 0.95rem; }
@media (max-width: 480px) { .thumb { width: 72px; height: 72px; } }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.actions form, form.inline { display: inline; }
button, .button {
  display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 7px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg); text-decoration: none; line-height: 1.3;
}
button.quiet, .button.quiet { background: transparent; color: var(--fg); border-color: var(--rule); }
button.quiet:hover, .button.quiet:hover { border-color: var(--muted); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.item-form { display: flex; flex-direction: column; }
.item-form label { font-weight: 600; font-size: 0.9rem; margin-top: 18px; }
.hint { font-size: 0.8rem; margin: 2px 0 6px; }
input, textarea, select {
  width: 100%; font-size: 1rem; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg); color: var(--fg);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.item-form .actions { margin-top: 24px; gap: 16px; }
.item-form .actions a { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.9rem; color: var(--muted); }

details { margin: 16px 0; }
summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
details.danger { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); }
.details dt { font-weight: 600; font-size: 0.85rem; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--muted); margin-top: 10px; }
.details dd { margin: 2px 0 0; }
.hunts { list-style: none; padding: 0; margin: 0; }
.hunts li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }

.notify h3 { margin: 0 0 4px; font-size: 1rem; color: var(--fg); }
.notify p { margin: 0 0 8px; }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--muted); }
code { font-size: 0.9em; background: var(--panel); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 340px; }
.login h1 { margin: 0 0 4px; font-size: 1.6rem; }
.login p { margin: 0 0 20px; font-size: 0.9rem; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.login .err { color: var(--danger); }
.login .logo { display: block; margin-bottom: 14px; }
.login input { margin-bottom: 12px; }
.login button { width: 100%; padding: 10px; font-size: 1rem; }
