:root {
  --bg: #fbf7f0;
  --card: #ffffff;
  --ink: #1d2420;
  --muted: #5f6b64;
  --line: #e6ded0;
  --pine: #1f5b42;
  --pine-ink: #ffffff;
  --berry: #b3263e;
  --gold: #c99a2e;
  --soft: #eef5f0;
  --warn: #fdf0f1;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121815;
    --card: #1b2420;
    --ink: #eef2ee;
    --muted: #a3b0a8;
    --line: #2e3a34;
    --pine: #3f9a70;
    --pine-ink: #0c1310;
    --berry: #ef6b80;
    --gold: #e0b852;
    --soft: #1f2e27;
    --warn: #2d1a1e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121815; --card: #1b2420; --ink: #eef2ee; --muted: #a3b0a8; --line: #2e3a34;
  --pine: #3f9a70; --pine-ink: #0c1310; --berry: #ef6b80; --gold: #e0b852; --soft: #1f2e27; --warn: #2d1a1e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 "Inter", system-ui, -apple-system, sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.wide { max-width: 960px; }

header.top { text-align: center; padding: 28px 0 8px; }
.mark { font-size: 44px; line-height: 1; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 700; line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: clamp(30px, 7vw, 42px); color: var(--pine); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.fact { background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.fact b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fact span { font-weight: 700; font-size: 17px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  border: 0; border-radius: 999px;
  padding: 12px 20px;
  background: var(--pine); color: var(--pine-ink);
  cursor: pointer; text-decoration: none;
  min-height: 46px;
}
button.full { width: 100%; margin-top: 18px; }
button.ghost, .btn.ghost { background: transparent; color: var(--pine); border: 2px solid var(--pine); }
button.danger { background: var(--berry); color: #fff; }
button.link { background: none; color: var(--muted); padding: 6px; min-height: 0; font-weight: 600; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0 0; list-style: none; }
.chips li { background: var(--soft); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 15px; }

.msg { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.msg.err { background: var(--warn); color: var(--berry); }
.msg.ok { background: var(--soft); color: var(--pine); }

.reveal { text-align: center; padding: 28px 20px; border: 2px solid var(--gold); }
.reveal .who { font-family: "Fraunces", Georgia, serif; font-size: clamp(34px, 9vw, 52px); color: var(--berry); font-weight: 700; margin: 6px 0 12px; overflow-wrap: anywhere; }
.wish { white-space: pre-wrap; background: var(--soft); border-radius: 12px; padding: 14px; text-align: left; }

/* organiser */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.table-scroll { overflow-x: auto; }
.tick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; }
.tick-list label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; padding: 6px 8px; border-radius: 8px; background: var(--soft); }
.tick-list input { width: auto; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--soft); color: var(--pine); margin: 2px 4px 2px 0; }
.pill.red { background: var(--warn); color: var(--berry); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 20px; width: min(560px, calc(100vw - 32px)); max-height: 90vh; }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.tabs button { background: var(--soft); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--pine); color: var(--pine-ink); }
[hidden] { display: none !important; }
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.thread { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.bubble { max-width: 85%; background: var(--soft); border-radius: 14px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble b { display: block; font-size: 12px; color: var(--muted); }
.bubble.mine { align-self: flex-end; background: var(--card); border: 1px solid var(--line); }
.items { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; text-align: left; }
.item { display: flex; gap: 12px; align-items: center; background: var(--soft); border-radius: 12px; padding: 10px; }
.item img, .item .nopic { width: 64px; height: 64px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; }
.item .nopic { display: grid; place-items: center; font-size: 28px; background: var(--card); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-body a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.chips.pick button { background: var(--soft); color: var(--ink); min-height: 40px; padding: 8px 14px; font-weight: 600; }
.chips.pick button[aria-pressed="true"] { background: var(--pine); color: var(--pine-ink); }
.help { text-align: center; color: var(--muted); font-size: 15px; margin-top: 28px; }
.help a { color: var(--pine); font-weight: 700; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 6px 0; }
.steps li.now { font-weight: 700; color: var(--pine); }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; max-width: 200px; }
