:root {
  --bg: #fbf7f2;
  --card: #fff;
  --ink: #2b2522;
  --muted: #7a6f68;
  --line: #eadfd5;
  --red: #b3261e;
  --red-dark: #8c1d17;
  --green: #2e6b47;
  --gold: #c99a2e;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--red); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
h3 { font-size: 1.05rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  padding: .8rem 1.25rem; background: var(--red); color: #fff;
}
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.15rem; }
.top nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.top nav a:hover, .top .linkish:hover { text-decoration: underline; }
.top .linkish { color: #fff; }

main { max-width: 820px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.card > h2:first-child { margin-top: 0; }
.narrow { max-width: 420px; margin: 2rem auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.grid .card { margin: 0; text-decoration: none; color: inherit; transition: transform .1s, box-shadow .1s; }
.grid .card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.card.mine { border-color: var(--gold); }
.card.event { border-left: 5px solid var(--red); }

.muted { color: var(--muted); }
.big { font-size: 1.1rem; }
.pre { white-space: pre-wrap; }
.price { font-weight: 600; color: var(--green); margin: 0; }

label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
input, select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.inline input, .inline select { flex: 1; min-width: 120px; width: auto; }
.inline-form { display: inline; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 9px;
  padding: .6rem 1.1rem; background: var(--red); color: #fff; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: var(--red-dark); }
button.small, .button.small { padding: .35rem .75rem; font-size: .9rem; }
button.secondary, .button.secondary { background: #f1e9e1; color: var(--ink); }
button.secondary:hover, .button.secondary:hover { background: #e6dbd0; }
button.danger { background: transparent; color: var(--red); border: 1px solid currentColor; }
button.danger:hover { background: #fbeceb; }
button.linkish { background: none; padding: 0; color: var(--red); font-weight: normal; text-decoration: underline; }

.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.actions form { margin: 0; }

.flash { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 1rem; }
.flash.ok { background: #e7f3ec; color: var(--green); }
.flash.err { background: #fbeceb; color: var(--red-dark); }

.tag { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 99px; background: #f1e9e1; color: var(--muted); }
.tag.ok { background: #e7f3ec; color: var(--green); }
.tag.warn { background: #fdf3dc; color: #8a6510; }
.tag.mine { background: #e7f3ec; color: var(--green); font-weight: 600; }

.items { list-style: none; padding: 0; margin: 0; }
.item.claimed:not(:has(.tag.mine)) { opacity: .6; }

details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: .8rem; }
details.manage { margin-top: .4rem; }
details.manage > summary { font-weight: normal; color: var(--muted); font-size: .9rem; }

.members, .events { list-style: none; padding: 0; margin: 1rem 0 0; }
.members > li { padding: .8rem 0; border-top: 1px solid var(--line); }
.events > li { padding: .4rem 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.copy { display: flex; gap: .4rem; margin-top: .3rem; }
.copy input { font-family: ui-monospace, monospace; font-size: .85rem; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
label.check { flex-direction: row; align-items: center; font-weight: normal; }
label.check input { width: auto; }

.santa { text-align: center; padding: 2rem 1rem; background: linear-gradient(135deg, #fff 0%, #fdf3dc 100%); }
.reveal { font-size: 2.4rem; font-weight: 800; color: var(--red); margin: .2rem 0 1rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
dt { font-weight: 600; }
dd { margin: 0; }
