:root {
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1f2a24;
  --muted: #66706a;
  --line: #e3dccd;
  --green: #1d5c44;
  --green-ink: #ffffff;
  --red: #b3262e;
  --gold: #c08a2b;
  --soft: #eee7d8;
  --ok: #2e7d4f;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 24px rgba(40, 30, 10, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121814; --paper: #1a221d; --ink: #eae6dc; --muted: #9aa49d; --line: #2c3730;
    --green: #3f9a73; --green-ink: #0d1510; --red: #e0646a; --gold: #d9a84a; --soft: #222c26;
    --ok: #59b783; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}
h1, h2, h3, .serif { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 0 0 .25rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
a { color: var(--green); }
.wrap { max-width: 820px; margin: 0 auto; padding: 24px 16px 80px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.top a.brand { text-decoration: none; color: var(--ink); font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.15rem; display: flex; gap: 8px; align-items: center; }
.top .spacer { flex: 1; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card > .sub { color: var(--muted); margin: 0 0 16px; font-size: .94rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
label { display: block; font-weight: 600; font-size: .875rem; margin: 0 0 6px; }
input[type=text], input[type=number], textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; min-height: 42px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green); outline-offset: -1px; }
button, .btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 9px; padding: 9px 14px; min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--green); color: var(--green-ink); border-color: var(--green); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--red); }
button.ghost { border-color: transparent; background: transparent; }
button.icon { padding: 6px 10px; min-height: 36px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list > li:first-child { border-top: 0; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--soft); color: var(--muted); }
.pill.ok { color: var(--ok); }
.pill.red { color: var(--red); }
.pill.gold { color: var(--gold); }
.notice { border-radius: 10px; padding: 10px 12px; background: var(--soft); font-size: .92rem; margin: 12px 0 0; }
.notice.bad { color: var(--red); }
.notice.good { color: var(--ok); }
.hidden { display: none !important; }
.status { font-size: .82rem; color: var(--muted); }
.person { flex: 1 1 200px; min-width: 0; }
.person .name { font-weight: 600; }
.person .hint { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.archived .name { text-decoration: line-through; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); }
details > summary { cursor: pointer; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 9; transition: opacity .2s; }
.snow { color: var(--red); }
footer { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 32px; }
