:root {
  --paper: #F3EBDD; --card: #FBF7EF; --line: #D8C8AD; --line-soft: #E8DBC5; --kraft: #D9BF98; --kraft-dark: #BFA47B;
  --ink: #3A2E24; --muted: #66533F; --primary: #A2543A; --secondary: #4A6572;
  --serif: Fraunces, Georgia, serif; --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
body.xmas { --primary: #A32A2A; --secondary: #2F5D3A; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--ink); }
a:hover { color: var(--primary); }
h1, h2 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 21px; }
p { margin: 0; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 64px; }
.ribbon { height: 10px; background: repeating-linear-gradient(135deg, var(--primary) 0 14px, var(--paper) 14px 22px, var(--secondary) 22px 36px, var(--paper) 36px 44px); }

.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px 32px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 23px var(--serif); color: var(--ink); min-height: 44px; }
.brand svg { color: var(--primary); }
.nav { display: flex; gap: 24px; flex-grow: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 11px 0; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--secondary); }
.nav .narrow { display: none; }
.plain-link { margin-left: auto; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--kraft); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; text-decoration: none; flex-shrink: 0; margin-left: auto; }
.avatar.static { background: var(--line-soft); margin-left: 0; }

.cols { display: flex; flex-wrap: wrap; gap: 40px; }
.main { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 280px; min-width: 0; }
.narrow-page { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.narrow-page.wide { max-width: 680px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { color: var(--secondary); font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.strong { font-weight: 600; }
.lead { font-size: 18px; color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.soon { color: var(--primary); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel.accent { border: 2px solid var(--secondary); padding: 22px; }
.panel.rows { padding: 0; }
.panel.gone { border-style: dashed; }
.note { background: var(--line-soft); border-radius: 8px; padding: 12px 16px; }
.flash { background: var(--card); border: 1px solid var(--secondary); border-left-width: 1px; border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-weight: 600; }
.error { color: #8C1D18; font-weight: 600; }
.divide { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.linkbox { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; overflow-wrap: anywhere; }
.backlink { font-size: 15px; padding: 8px 0; align-self: flex-start; }

.btn { font: 600 16px var(--sans); min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: var(--secondary); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--kraft-dark); }
.btn.danger { background: transparent; color: #8C1D18; border-color: #8C1D18; }
.btn.full { width: 100%; }
.btn:hover { filter: brightness(.94); color: inherit; }
.btn.primary:hover, .btn.secondary:hover { color: #fff; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; padding: 0; }
input[type=text], input[type=email], input[type=url], input[type=number], select, textarea {
  font: 16px var(--sans); min-height: 44px; padding: 8px 12px; border: 1px solid var(--kraft-dark); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
textarea { resize: vertical; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.inline > input, .inline > select { flex: 1 1 180px; width: auto; }
.grow { flex: 1 1 240px; min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.photo-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--kraft-dark); background: var(--card); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; font-size: 15px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); font-weight: 600; }
.chip.on:hover { color: var(--card); }
.chip-link { margin-left: auto; font-weight: 600; padding: 10px 4px; }

.tag { background: var(--kraft); border-radius: 8px; padding: 12px 18px 12px 40px; position: relative; text-align: center; transform: rotate(-3deg); box-shadow: 0 2px 0 var(--kraft-dark); display: flex; flex-direction: column; font-size: 14px; font-weight: 600; }
.tag strong { font: 600 34px/1 var(--serif); color: var(--primary); }
.tag .hole { position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 0 var(--kraft-dark); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card.mine { border: 2px solid var(--secondary); }
.photo { width: 100%; height: 150px; object-fit: contain; background: #fff; display: block; border-bottom: 1px solid var(--line-soft); }
.photo.none { background: var(--line-soft); height: 56px; border: 0; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.card h2 { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.top-pick { color: var(--primary); font: 600 14px var(--sans); white-space: nowrap; }
.card-actions { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--secondary); font-weight: 600; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row.flat { padding: 0; border: 0; flex-wrap: nowrap; align-items: flex-start; }
.row.person { text-decoration: none; flex-wrap: nowrap; }
.row.person:hover { background: var(--paper); color: var(--ink); }
.row-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.row-title { font: 500 19px/1.25 var(--serif); }
.row.person .row-title { font: 600 16px var(--sans); }
.row-actions { display: flex; gap: 8px; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line-soft); flex-shrink: 0; }
.thumb.none { background: var(--line-soft); border: 0; }
.thumb.big { width: 104px; height: 104px; }
.count { white-space: nowrap; }
.badge { font: 600 13px var(--sans); color: var(--secondary); border: 1px solid var(--secondary); border-radius: 4px; padding: 0 6px; margin-left: 4px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.claim-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 20px; padding-bottom: 96px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line); gap: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom); }
  .nav a { min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border-bottom: 0; border-top: 3px solid transparent; text-align: center; }
  .nav a.on { border-top-color: var(--secondary); }
  .nav .wide { display: none; }
  .nav .narrow { display: inline; }
  .cols { gap: 24px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 0 12px; }
  .card .photo { width: 76px; height: 76px; border: 1px solid var(--line-soft); border-radius: 8px; }
  .card .photo.none { height: 76px; border: 0; }
  .card-body { padding: 0; flex: 1 1 0; min-width: 0; gap: 4px; }
  .card-actions { padding-top: 8px; }
  .chip-link { margin-left: 0; }
  .row-actions { width: 100%; }
  .row-actions > * { flex: 1; }
  .row-actions .btn { width: 100%; }
}
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
