:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #f1ede4;
  --surface-3: #e8e2d6;
  --border: #e3ddd1;
  --border-strong: #cfc7b8;
  --ink: #1d1b17;
  --ink-2: #57524a;
  --ink-3: #8a8378;
  --accent: #f2b705;
  --accent-ink: #1d1b17;
  --accent-soft: #fdf1c7;
  --admin: #4a3aa7;
  --admin-soft: #ece9fb;
  --good: #0a7d32;
  --good-soft: #e3f4e8;
  --bad: #c2362f;
  --bad-soft: #fbe6e4;
  --warn: #9a6200;
  --warn-soft: #fdf0d5;
  --media-bg: #ffffff;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 4px 14px rgb(40 30 10 / 6%);
  --shadow-lg: 0 10px 40px rgb(30 20 0 / 18%);
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7; --c8: #e34948;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141310;
    --surface: #1e1c18;
    --surface-2: #26241f;
    --surface-3: #312e28;
    --border: #34312a;
    --border-strong: #4a463d;
    --ink: #f4f1ea;
    --ink-2: #c3beb2;
    --ink-3: #8f897d;
    --accent: #f2b705;
    --accent-soft: #3a2f0c;
    --admin: #9085e9;
    --admin-soft: #27234a;
    --good: #4cc27a;
    --good-soft: #15301f;
    --bad: #f07a72;
    --bad-soft: #3a1a18;
    --warn: #f0b54a;
    --warn-soft: #3a2c10;
    --media-bg: #f4f1ea;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 25%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141310;
  --surface: #1e1c18;
  --surface-2: #26241f;
  --surface-3: #312e28;
  --border: #34312a;
  --border-strong: #4a463d;
  --ink: #f4f1ea;
  --ink-2: #c3beb2;
  --ink-3: #8f897d;
  --accent: #f2b705;
  --accent-soft: #3a2f0c;
  --admin: #9085e9;
  --admin-soft: #27234a;
  --good: #4cc27a;
  --good-soft: #15301f;
  --bad: #f07a72;
  --bad-soft: #3a1a18;
  --warn: #f0b54a;
  --warn-soft: #3a2c10;
  --media-bg: #f4f1ea;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 25%);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }

.chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px; max-width: 220px;
}
.chip-btn:hover { border-color: var(--border-strong); }
.chip-btn .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn.admin { background: var(--admin-soft); border-color: transparent; color: var(--admin); }
.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c1); color: #fff; font-size: 12px; font-weight: 700;
}
.chip-btn.admin .avatar { background: var(--admin); }
.chip-btn.ghost { padding: 0 14px; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 28px 0 24px; display: grid; gap: 10px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2);
}
.pill.accent { background: var(--accent-soft); color: var(--ink); }
.pill.admin { background: var(--admin-soft); color: var(--admin); }
.pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ------------------------------------------------------------------ filter bar */
.toolbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: 12px;
  max-width: 100%; overflow-x: auto;
}
.segmented button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.segmented button .n { color: var(--ink-3); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.select {
  height: 38px; padding: 0 32px 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  appearance: none; cursor: pointer; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8378' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.admin { background: var(--admin); border-color: var(--admin); color: #fff; }
:root[data-theme="dark"] .btn.admin { color: #141310; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.admin { color: #141310; } }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.linklike { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ------------------------------------------------------------------ grid and cards */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  padding-bottom: 48px;
}
.skeleton { height: 420px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.is-done .card-media img { opacity: .55; filter: grayscale(.4); }
.card.is-received { opacity: .7; }

.card-media {
  position: relative; aspect-ratio: 4 / 3; background: var(--media-bg);
  display: grid; place-items: center; border-bottom: 1px solid var(--border);
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.card-media .placeholder { width: 64px; height: 64px; color: #c9c1b1; }
.media-tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgb(29 27 23 / 88%); color: #fff;
}
.tag.qty { background: var(--accent); color: #1d1b17; font-variant-numeric: tabular-nums; }
.tag.love { background: #fff; color: #c2362f; box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }
.tag.done { background: var(--good); color: #fff; margin-left: auto; }
.tag.low { background: #fff; color: var(--good); box-shadow: 0 1px 3px rgb(0 0 0 / 15%); }
:root[data-theme="dark"] .tag.done { color: #0d1f13; }

.card-body { padding: 16px 16px 4px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.store { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.card-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.notes { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.price-block {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 10px;
  margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  border: 0; text-align: left; cursor: pointer; width: 100%;
}
.price-block:hover { background: var(--surface-3); }
.price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price.none { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.price-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ink-3); }
.spark { width: 92px; height: 30px; display: block; }
.spark path.line { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--ink); stroke: var(--surface-2); stroke-width: 2; }

.trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.trend.down { color: var(--good); background: var(--good-soft); }
.trend.up { color: var(--bad); background: var(--bad-soft); }
.trend.flat { color: var(--ink-3); background: transparent; padding-left: 0; }

/* reservations */
.reserve { margin-top: 8px; display: grid; gap: 7px; }
.reserve-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.reserve-head strong { font-weight: 600; }
.reserve-head .muted { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; min-width: 4px; }
.bar span:first-child { border-radius: 4px 0 0 4px; }
.bar span:last-child { border-radius: 0 4px 4px 0; }
.bar span:only-child { border-radius: 4px; }
.contributors { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.contributors li { display: inline-flex; align-items: center; gap: 6px; }
.contributors .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.contributors .mine { color: var(--ink); font-weight: 600; }
.contributors .note { color: var(--ink-3); font-style: italic; }

.card-actions { padding: 12px 16px 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; }
.admin-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px; border-top: 1px dashed var(--border-strong); background: var(--admin-soft);
}
.admin-bar .label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--admin); margin-right: auto; padding-left: 6px; }
.admin-bar .icon-btn { width: 34px; height: 34px; color: var(--admin); }
.admin-bar .icon-btn:hover { background: color-mix(in srgb, var(--admin) 14%, transparent); }
.scrape-error { display: flex; gap: 6px; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); padding: 6px 10px; border-radius: 9px; }


.empty { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; padding: 72px 20px; color: var(--ink-2); }
.empty p { margin: 0; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); margin-bottom: 16px; }
.empty-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; color: var(--ink); }

/* ------------------------------------------------------------------ modals */
.modal {
  border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: var(--shadow-lg);
}
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(20 16 8 / 45%); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-inner { padding: 24px; display: grid; gap: 16px; }
@media (max-width: 480px) { .modal-inner { padding: 20px 18px; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 23px; line-height: 1.2; letter-spacing: -0.01em; flex: 1; }
.modal-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.modal-foot .left { margin-right: auto; }

.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12.5px; }
.input, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus, .btn:focus-visible, .icon-btn:focus-visible, .segmented button:focus-visible, .price-block:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
@media (max-width: 480px) { .row.stack-sm { flex-direction: column; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--admin); }
.url-row { display: flex; gap: 8px; }
.url-row .input { flex: 1; min-width: 0; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 11px; overflow: hidden; height: 42px; }
.stepper button { width: 42px; height: 100%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; font-weight: 600; }
.stepper button:hover { background: var(--surface-3); }
.stepper output { min-width: 48px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.prio-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prio-picker label { display: grid; gap: 4px; place-items: center; align-content: center; min-height: 64px; text-align: center; padding: 10px 6px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.prio-picker input { position: absolute; opacity: 0; pointer-events: none; }
.prio-picker label:has(input:checked) { border-color: var(--admin); background: var(--admin-soft); color: var(--ink); font-weight: 600; }

.preview-box { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.preview-box img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }

/* reserve dialog */
.gift-summary { display: flex; gap: 14px; align-items: center; }
.gift-summary img, .gift-summary .ph { width: 72px; height: 72px; object-fit: contain; background: var(--media-bg); border-radius: 12px; flex: none; padding: 6px; border: 1px solid var(--border); }
.gift-summary h2 { font-size: 19px; }
.amount-big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.amount-sub { color: var(--ink-2); font-size: 14px; }
.amount-box { display: grid; gap: 6px; padding: 16px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.range { width: 100%; accent-color: var(--accent); height: 28px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.quick button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.quick button:hover { background: var(--surface-3); }
.callout { padding: 10px 12px; border-radius: 11px; font-size: 13.5px; background: var(--surface-2); color: var(--ink-2); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.admin { background: var(--admin-soft); color: var(--ink); }
.callout code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.link-box { display: flex; gap: 8px; }
.link-box .input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* admin lists */
.list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; }
.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta { font-size: 12.5px; color: var(--ink-3); }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 -4px; }

/* price chart */
.chart-wrap { position: relative; }
.chart { width: 100%; height: 240px; display: block; touch-action: pan-y; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--c1); opacity: .08; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--c1); stroke: var(--surface); stroke-width: 2; }
.tooltip {
  position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 9px;
  background: var(--ink); color: var(--bg); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%);
  box-shadow: var(--shadow);
}
.tooltip b { font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.stat .k { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
details.table-view summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
details.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
details.table-view td, details.table-view th { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
details.table-view td:last-child, details.table-view th:last-child { text-align: right; }

/* ------------------------------------------------------------------ footer and toasts */
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 24px 32px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--border); }
.footer-admin { color: var(--ink-3); text-decoration: none; }
.footer-admin:hover { color: var(--ink); text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 500; font-size: 14px;
  box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.placeholder svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.segmented { scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 600px) {
  .hero { padding-top: 20px; }
}
.modal { overflow-x: hidden; }

/* Theme button icon: moon in light mode (switch to dark), sun in dark mode (switch to light). */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* Logo watermark, optionally linked (WATERMARK_URL) */
.watermark {
  position: fixed; right: 20px; bottom: 20px; z-index: 10;
  color: var(--ink); opacity: .14; transition: opacity .2s;
  line-height: 0;
}
.watermark[href]:hover, .watermark[href]:focus-visible { opacity: .55; }
.watermark .logo { height: 64px; width: auto; }
@media (max-width: 600px) {
  .watermark { right: 12px; bottom: 12px; opacity: .1; }
  .watermark .logo { height: 40px; }
}
/* Keep the watermark from covering the footer "Admin" link. */
@media (max-width: 1360px) { .site-footer { padding-right: 104px; } }
@media (max-width: 600px) { .site-footer { padding-right: 64px; } }

/* Summary under the header */
.summary { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.summary-main { display: grid; gap: 8px; min-width: 200px; }
.summary-count { font-size: 15px; color: var(--ink-2); }
.summary-count strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-count .sep { margin: 0 8px; color: var(--ink-3); }
.summary-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.summary-bar span { display: block; height: 100%; background: var(--good); border-radius: 2px; }
.summary .btn.admin { margin-left: auto; }

/* On small screens the filters move to a second row of the bar */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  /* Row 1: sort on the left, buttons on the right. Row 2: full-width filters. */
  .toolbar { display: contents; }
  .toolbar .select { order: 1; }
  .header-actions { order: 2; flex: none; margin-left: auto; }
  .toolbar .segmented { order: 3; width: 100%; }
  .toolbar .segmented button { flex: 1; }
}
@media (max-width: 600px) {
  .toolbar .select { flex: 1 1 0; width: 0; min-width: 0; }
  .header-actions { margin-left: 0; }
  .summary .btn.admin { margin-left: 0; width: 100%; }
}
.modal-head > :first-child { flex: 1; min-width: 0; }
.modal-head > [data-close] { margin-left: auto; flex: none; margin-top: -4px; margin-right: -6px; }

/* Priority flames */
.flame .outer { fill: var(--flame-outer); }
.flame .inner { fill: var(--flame-inner); }
.flame-high { --flame-outer: #e5402f; --flame-inner: #ffb020; width: 24px; height: 24px; }
.flame-mid { --flame-outer: #f2b705; --flame-inner: #fde68a; width: 15px; height: 15px; }
.flame-low { --flame-outer: var(--ink-3); --flame-inner: var(--surface-2); width: 13px; height: 13px; opacity: .5; }
.prio-picker .flame-high { width: 20px; height: 20px; }

/* Flame bubble, top-right corner of the image */
.flame-tag {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center; border-radius: 50%;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.flame-tag-high { width: 38px; height: 38px; background: rgb(229 64 47 / 22%); box-shadow: inset 0 0 0 1px rgb(229 64 47 / 35%); }
.flame-tag-mid { width: 30px; height: 30px; top: 14px; right: 14px; background: rgb(242 183 5 / 26%); box-shadow: inset 0 0 0 1px rgb(242 183 5 / 45%); }
.media-tags.has-flame { right: 56px; }

/* Dependencies between gifts */
.dep-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; padding: 9px 11px; border-radius: 10px; }
.dep-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dep-note.locked { background: var(--surface-2); color: var(--ink-2); }
.dep-note.pending { background: var(--warn-soft); color: var(--warn); }
/* Pending: faded, but the notice and the button stay readable */
.card.is-pending .card-media,
.card.is-pending .store, .card.is-pending .card-title, .card.is-pending .notes,
.card.is-pending .price-block, .card.is-pending .reserve { opacity: .5; }
/* Locked: more faded and greyscale */
.card.is-locked .card-media,
.card.is-locked .store, .card.is-locked .card-title, .card.is-locked .notes,
.card.is-locked .price-block, .card.is-locked .reserve { opacity: .4; }
.card.is-locked .card-media img { filter: grayscale(1); }
.card.is-locked .card-actions .btn:disabled { opacity: 1; color: var(--ink-3); background: var(--surface-2); border-color: transparent; }

.dep-picker { display: grid; gap: 2px; max-height: 200px; overflow: auto; padding: 4px; border: 1px solid var(--border-strong); border-radius: 11px; }
.dep-option { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.dep-option:hover { background: var(--surface-2); }
.dep-option input { width: 17px; height: 17px; accent-color: var(--admin); flex: none; }
.dep-option img, .dep-option .ph { width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.dep-option span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-opts { display: grid; gap: 12px; margin-top: 8px; }
.dep-opts .segmented { justify-self: start; }

/* Inline rename in the people list */
.rename-form { display: flex; align-items: center; gap: 4px; }
.rename-form .input { height: 36px; flex: 1; min-width: 0; }

/* Part of a gift in % or € */
.unit-toggle { justify-self: center; }
.unit-toggle button { min-width: 44px; font-weight: 700; }
.amount-eur { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; cursor: text; }
.eur-input {
  width: 6ch; text-align: right; font: inherit; color: var(--ink); font-variant-numeric: tabular-nums;
  background: transparent; border: 0; border-bottom: 2px solid var(--border-strong); padding: 0 2px; border-radius: 0;
}
.eur-input:focus { outline: none; border-bottom-color: var(--accent); }
.eur-input.invalid { border-bottom-color: var(--bad); color: var(--bad); }
