/* Gavelisten 2 — "gift wrap" theme: warm paper, evergreen, berry and gold. */

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7d8;
  --card: #fffdf9;
  --ink: #1d2721;
  --muted: #6d695e;
  --line: #e4dac8;
  --line-strong: #d3c6ae;
  --green: #24493a;
  --green-hover: #1b3a2e;
  --on-green: #ffffff;
  --green-soft: #e3ece6;
  --berry: #a8323f;
  --berry-soft: #f7e3e3;
  --gold: #c8962e;
  --gold-soft: #f5e8c8;
  --star-off: #ddd3c1;
  --focus: #c8962e;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 6px 18px -8px rgb(40 30 10 / 14%);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.6l3.15 6.55 7.2.95-5.27 4.98 1.33 7.14L12 17.7l-6.41 3.52 1.33-7.14L1.65 9.1l7.2-.95z'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131a16;
    --paper-2: #18211c;
    --card: #1b2520;
    --ink: #ece6da;
    --muted: #a59f90;
    --line: #2c3832;
    --line-strong: #3b4942;
    --green: #8cc4a6;
    --green-hover: #a6d6bc;
    --on-green: #10201a;
    --green-soft: #213029;
    --berry: #ec8a92;
    --berry-soft: #3a2427;
    --gold: #e0b45a;
    --gold-soft: #3a3020;
    --star-off: #3a4640;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 20px -10px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper-2); padding: .1em .35em; border-radius: 5px; }
code.copy { display: block; margin-top: .4rem; padding: .5rem .6rem; word-break: break-all; user-select: all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: 1120px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font: 600 1.3rem/1 var(--font-display); letter-spacing: -.01em; }
.mainnav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; padding: .45rem .75rem; border-radius: 999px; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--paper-2); }
.mainnav a.is-active { color: var(--green); background: var(--green-soft); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .2rem .5rem .2rem .2rem; border-radius: 999px; font-weight: 600; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--paper-2); }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .35rem; display: grid; }
.usermenu__panel a, .usermenu__panel button { text-align: left; padding: .55rem .7rem; border-radius: 6px; text-decoration: none; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--paper-2); }

/* ---------- Page ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.eyebrow { margin: 0 0 .25rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.display { font: 600 clamp(2rem, 4.2vw, 2.9rem)/1.05 var(--font-display); letter-spacing: -.02em; margin: 0 0 .4rem; }
.display--sm { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .75rem; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }
.h3 { font: 600 1.15rem var(--font-display); margin: 1.5rem 0 .6rem; }

.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1rem; border: 1px solid; font-size: .95rem; }
.flash--success { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.flash--error { background: var(--berry-soft); border-color: color-mix(in srgb, var(--berry) 35%, transparent); }
.flash--info { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 600 .95rem/1 var(--font-body); padding: .72rem 1.1rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn--primary { background: var(--green); color: var(--on-green); }
.btn--primary:hover { background: var(--green-hover); color: var(--on-green); }
.btn--accent { background: var(--gold); color: #24190a; }
.btn--accent:hover { background: color-mix(in srgb, var(--gold) 85%, #000); color: #24190a; }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }
.btn--danger { background: var(--berry); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--berry) 85%, #000); color: #fff; }
.btn--danger-ghost { background: transparent; color: var(--berry); border-color: color-mix(in srgb, var(--berry) 35%, transparent); }
.btn--danger-ghost:hover { background: var(--berry-soft); color: var(--berry); }
.btn--plain { background: none; color: var(--muted); }
.btn--plain:hover { color: var(--ink); }
.btn--small { font-size: .85rem; padding: .48rem .8rem; }
.btn--block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.iconbtn { width: 2rem; height: 1.6rem; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 6px; cursor: pointer; font-size: .7rem; }
.iconbtn:hover:not(:disabled) { color: var(--green); border-color: var(--green); }
.iconbtn:disabled { opacity: .35; cursor: default; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); flex: none; }
.avatar--xs { width: 22px; height: 22px; border-width: 1px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 72px; height: 72px; }
.avatar--xl { width: 96px; height: 96px; }
.avatar--xxl { width: 140px; height: 140px; }

/* ---------- Dashboard ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 1rem 0 1.5rem; }
.hero__actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.section { margin-top: 2rem; }
.section__title { font: 600 1.35rem var(--font-display); margin: 0 0 .9rem; display: flex; align-items: center; gap: .6rem; }
.section__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.bdays { list-style: none; margin: 0 -1rem; padding: .25rem 1rem 1rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.bday { scroll-snap-align: start; }
.bday a { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: 1.1rem .8rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.bday a:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--ink); }
.bday .avatar { margin-bottom: .5rem; }
.bday__name { font-weight: 700; line-height: 1.25; }
.bday__date { font: 600 1.05rem var(--font-display); color: var(--green); }
.bday__meta { font-size: .82rem; color: var(--muted); }
.bday--next a { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--card) 70%); }
.bday--next .avatar { box-shadow: 0 0 0 2px var(--gold); }
.bday--today a { border-color: var(--berry); background: linear-gradient(180deg, var(--berry-soft), var(--card) 70%); }
@media (min-width: 900px) { .bdays { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; } }

.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 1fr; gap: .7rem; }
.people > li { display: flex; min-width: 0; }
.people > li.people__managed { align-items: center; gap: .5rem; }
.person { flex: 1; min-width: 0; min-height: 5.5rem; display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.person:hover { border-color: var(--green); color: var(--ink); }
.person--me { background: var(--green-soft); }
.person > .avatar { flex: none; }
.person__text { flex: 1; min-width: 0; display: grid; align-content: center; gap: .1rem; }
.person__name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.person__name em { font-style: normal; font-weight: 500; color: var(--muted); }
.person__meta { font-size: .85rem; color: var(--muted); }
.person__meta--pending { font-size: .78rem; font-style: italic; }
.person__arrow { flex: none; color: var(--muted); transition: transform .15s; }
.person:hover .person__arrow { transform: translateX(3px); color: var(--green); }
.claimlist { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.claimlist li { display: flex; flex-wrap: wrap; gap: .25rem .6rem; padding: .6rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.claimlist a { font-weight: 600; }
.empty { text-align: center; padding: 3rem 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty h2 { font: 600 1.4rem var(--font-display); color: var(--ink); margin: 0 0 .4rem; }

/* ---------- Gift list ---------- */
.switcher { display: inline-flex; gap: .25rem; padding: .25rem; margin: 0 0 1rem; background: var(--paper-2); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.switcher a { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .9rem .35rem .4rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.switcher a:hover { color: var(--ink); }
.switcher a.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.listhead { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: .5rem 0 1.25rem; }
.listhead__text { flex: 1; min-width: 220px; }
.listhead__text .muted { margin: 0; }
.listhead__actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.category { margin-top: 2rem; }
.category__title { font: 600 1.45rem var(--font-display); margin: 0 0 .9rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); display: flex; align-items: baseline; gap: .6rem; }
.category__count { font: 700 .75rem var(--font-body); background: var(--ink); color: var(--paper); border-radius: 999px; padding: .2rem .55rem; transform: translateY(-3px); }
.gifts { display: grid; gap: .8rem; }

.gift {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 1.1rem; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}
.gift:target { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); }
.gift--suggestion { border-style: dashed; border-color: var(--line-strong); }
.gift__img { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--line-strong); }
.gift__img img { width: 100%; height: 100%; object-fit: contain; }
.gift__img svg { width: 44%; }
.gift__stamp { position: absolute; inset: auto 0 0 0; background: var(--berry); color: #fff; font: 700 .72rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: .25rem; }
.gift--claimed .gift__img img { opacity: .55; filter: grayscale(.6); }
.gift__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.gift__title { font: 600 1.2rem/1.25 var(--font-display); margin: 0; }
.gift__comment { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; }
.gift__facts { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: .7rem 0 0; }
.gift__facts div { display: grid; }
.gift__facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.gift__facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.5rem; display: flex; align-items: center; }
.gift__dates { margin: .55rem 0 0; font-size: .8rem; color: var(--muted); }
.gift__actions { display: flex; flex-direction: column; gap: .4rem; align-items: stretch; }
.gift__actions form { display: contents; }
.gift__actions > :not(.gift__edit) + .gift__edit { margin-top: .6rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.badge--suggest { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 60%, var(--ink)); }

.claim { margin-top: .75rem; padding-top: .7rem; border-top: 1px dashed var(--line); display: grid; gap: .45rem; }
.claim__info { margin: 0; font-size: .9rem; color: var(--muted); }
.claim__row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.claim__mine { font-weight: 700; color: var(--green); font-size: .92rem; }
.claim__qty select { padding: .4rem .5rem; }

@media (max-width: 640px) {
  .gift { grid-template-columns: 84px 1fr; gap: .85rem; }
  .gift__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .gift__actions > :not(.gift__edit) + .gift__edit { margin-top: 0; margin-left: .6rem; }
  .gift__title { font-size: 1.08rem; }
  .gift__facts { gap: .4rem 1.1rem; }
}

/* ---------- Stars ---------- */
.stars {
  --s: 18px;
  display: inline-block; vertical-align: middle;
  width: calc(var(--s) * 5); height: var(--s);
  background: linear-gradient(90deg, var(--gold) var(--pct, 0%), var(--star-off) var(--pct, 0%));
  -webkit-mask: var(--star) left center / var(--s) var(--s) repeat-x;
  mask: var(--star) left center / var(--s) var(--s) repeat-x;
}
.stars--input { --s: 30px; cursor: pointer; touch-action: none; }
.rating { display: flex; align-items: center; gap: .7rem; min-height: 2.9rem; flex-wrap: wrap; }
.rating__value { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.2em; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.form > .btn { justify-self: start; }
.auth .form > .btn { justify-self: stretch; }
.field { display: grid; gap: .35rem; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > span:first-child, .field > label:first-child, .field legend, .field__label { font-weight: 600; font-size: .9rem; }
.field legend { margin-bottom: .4rem; }
.field__help { font-size: .82rem; color: var(--muted); }
.field__error { font-size: .85rem; color: var(--berry); font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--berry); }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: .68rem .8rem; min-height: 2.9rem;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 5.5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.check { display: flex; align-items: center; gap: .55rem; font-size: .95rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
.inputrow { display: flex; gap: .5rem; align-items: stretch; }
.inputrow input { flex: 1; min-width: 0; }
.inputrow--card { padding: .8rem; margin-bottom: 1.25rem; }
.inputrow--inline { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 110px auto; gap: 1rem; align-items: start; }
.form__actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem 1rem; }
@media (max-width: 640px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :last-child { grid-column: 1 / -1; }
  .inputrow { flex-wrap: wrap; }
  .inputrow input { flex: 1 1 100%; }
  .inputrow .btn { flex: 1 1 auto; }
  .catrow .inputrow { flex-wrap: nowrap; }
  .catrow .inputrow input { flex: 1 1 auto; }
  .catrow .inputrow .btn { flex: none; }
}

.formpage { max-width: 880px; }
.giftform__grid { display: grid; grid-template-columns: 1fr 220px; gap: 1.6rem; }
.giftform__main { display: grid; gap: 1rem; }
.giftform__side { display: grid; gap: .5rem; align-content: start; }
@media (max-width: 760px) {
  .giftform__grid { grid-template-columns: 1fr; }
  .giftform__side { order: -1; grid-template-columns: 140px 1fr; align-items: end; }
  .giftform__side .field__label { grid-column: 1 / -1; }
}
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius); background: #fff; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; overflow: hidden; }
.thumb.has-image { border-style: solid; border-color: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb__empty { color: #8a8475; font-size: .85rem; text-align: center; padding: 1rem; }
.thumb__spinner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.thumb.is-loading img { opacity: .3; }
@keyframes spin { to { transform: rotate(360deg); } }

.importbox { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1.6rem; }
.importbox--focus { box-shadow: 0 0 0 3px var(--gold-soft); border-color: var(--gold); }
.importbox__title { font: 600 1.15rem var(--font-display); margin: 0 0 .25rem; }
.importbox__lead { margin: 0 0 .8rem; font-size: .92rem; color: var(--muted); }
.importbox__status { margin: .6rem 0 0; font-size: .92rem; min-height: 1.2em; }
.importbox__status.is-error { color: var(--berry); font-weight: 600; }
.importbox__status.is-ok { color: var(--green); font-weight: 600; }
.field--filled input, .field--filled select { background: color-mix(in srgb, var(--gold-soft) 55%, var(--card)); }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px -10px rgb(0 0 0 / 40%); }
dialog::backdrop { background: rgb(20 25 22 / 55%); backdrop-filter: blur(2px); }
.confirm { width: min(92vw, 420px); }
.confirm form { padding: 1.4rem; }
.confirm__title { font: 600 1.3rem var(--font-display); margin: 0 0 .5rem; }
.confirm__text { margin: 0 0 1.25rem; color: var(--muted); }
.confirm__actions { display: flex; justify-content: flex-end; gap: .5rem; }
.picker { width: min(94vw, 860px); max-height: 86vh; }
.picker[open] { display: flex; flex-direction: column; }
.picker__head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.picker__head h2 { font: 600 1.2rem var(--font-display); margin: 0; }
.picker__status { margin: 0; padding: .8rem 1.2rem 0; color: var(--muted); font-size: .92rem; }
.picker__status:empty { display: none; }
.picker__grid { padding: 1rem 1.2rem 1.2rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.picker__item { aspect-ratio: 1; padding: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; overflow: hidden; transition: border-color .15s, transform .1s; }
.picker__item:hover, .picker__item:focus-visible { border-color: var(--green); transform: scale(1.02); }
.picker__item img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Cards, admin ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card__title { font: 600 1.15rem var(--font-display); margin: 0 0 1rem; }
.stack { display: grid; gap: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .65rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--green); border-bottom-color: var(--green); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .display { margin: 0; }
.toolbar__actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: .8rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.table__actions form { margin: 0; }
.cellperson { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.status { font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.status--active { background: var(--green-soft); color: var(--green); }
.status--pending { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 60%, var(--ink)); }
.status--expired { background: var(--berry-soft); color: var(--berry); }
.status--child { background: var(--paper-2); color: var(--muted); }
@media (max-width: 860px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: .2rem 0; display: flex; gap: .6rem; }
  .table td[data-label]::before { content: attr(data-label); min-width: 7.5rem; color: var(--muted); font-size: .82rem; }
  .table td:first-child::before { display: none; }
  .table__actions { justify-content: flex-start; padding-top: .5rem; }
}
.rowhead { display: flex; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; flex-wrap: wrap; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem .25rem .3rem; border-radius: 999px; background: var(--paper-2); color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 600; }
.chip:hover { background: var(--green-soft); color: var(--green); }
.catlist { list-style: none; padding: 0; margin: 0; }
.catrow { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem .6rem .5rem; margin-bottom: .55rem; flex-wrap: wrap; }
.catrow.is-dragging { position: fixed; z-index: 60; margin: 0; box-shadow: 0 18px 40px -12px rgb(0 0 0 / 35%); border-color: var(--gold); transform: rotate(.6deg) scale(1.01); }
.catrow--gap { list-style: none; margin-bottom: .55rem; border: 2px dashed var(--gold); border-radius: var(--radius); background: var(--gold-soft); }
body.is-sorting { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.draghandle { flex: none; width: 2.2rem; height: 2.6rem; display: grid; place-items: center; font-size: 1.35rem; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: grab; touch-action: none; }
.draghandle:hover, .draghandle:focus-visible { color: var(--green); background: var(--green-soft); }
.is-dragging .draghandle { cursor: grabbing; color: var(--gold); }
.draghint { color: var(--green); font-weight: 700; }
.catrow__pos { min-width: 1.8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.catrow__name { flex: 1 1 440px; }
.catrow .catrow__name.inputrow { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(9rem, 1fr) auto; grid-template-areas: "name kw btn"; gap: .5rem; }
.catrow__name input[name=name] { grid-area: name; font-weight: 600; }
.catrow__name .catrow__kw { grid-area: kw; font-size: .9rem; }
.catrow__name .btn { grid-area: btn; }
.catrow__side { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-left: auto; min-width: 13.5rem; }
.catrow__count { min-width: 4.5rem; font-size: .88rem; text-align: right; }
.catmove { position: relative; }
.catmove summary { list-style: none; }
.catmove summary::-webkit-details-marker { display: none; }
.catmove[open] summary { border-color: var(--green); color: var(--green); }
.catmove__panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 30; width: 270px; display: grid; gap: .5rem; padding: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.catmove__panel label { font-weight: 600; font-size: .9rem; }
.catmove__panel .btn { justify-self: start; }
.sortstatus { margin: 0 0 .6rem; min-height: 1.3em; font-size: .92rem; color: var(--muted); }
.sortstatus.is-ok { color: var(--green); font-weight: 600; }
.sortstatus.is-error { color: var(--berry); font-weight: 600; }
@media (max-width: 640px) {
  .catrow { gap: .4rem .5rem; }
  .catrow__name { flex: 1 1 0; min-width: 0; }
  .catrow .catrow__name.inputrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btn" "kw kw"; }
  .catrow__pos { display: none; }
  .catrow__side { width: 100%; min-width: 0; }
  .catmove__panel { width: min(270px, 80vw); }
}

.toggle { display: flex; gap: .9rem; align-items: flex-start; cursor: pointer; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.toggle:last-of-type { border-bottom: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__switch { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; margin-top: .1rem; }
.toggle__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .2s; }
.toggle input:checked + .toggle__switch { background: var(--green); }
.toggle input:checked + .toggle__switch::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__switch { outline: 3px solid var(--focus); outline-offset: 2px; }
.toggle__text { display: grid; gap: .15rem; }
.toggle__text small { color: var(--muted); font-size: .88rem; }

.profilegrid { display: grid; grid-template-columns: 280px 1fr; gap: 1.25rem; align-items: start; }
.profilegrid > .card:nth-child(3) { grid-column: 2; }
@media (max-width: 760px) { .profilegrid { grid-template-columns: 1fr; } .profilegrid > .card:nth-child(3) { grid-column: auto; } }
.avatarbox { display: grid; justify-items: center; gap: .9rem; text-align: center; }
.avatarbox .form { justify-items: center; gap: .6rem; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Auth pages ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
  background:
    radial-gradient(circle at 15% 10%, var(--gold-soft), transparent 40%),
    radial-gradient(circle at 85% 90%, var(--green-soft), transparent 45%),
    var(--paper); }
.auth__box { width: min(100%, 400px); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 2rem 1.75rem; box-shadow: var(--shadow); }
.auth__box--wide { width: min(100%, 640px); }
.auth__logo { display: block; margin: 0 auto .6rem; }
.auth__title { font: 600 1.9rem var(--font-display); text-align: center; margin: 0 0 .3rem; letter-spacing: -.02em; }
.auth__lead { text-align: center; color: var(--muted); margin: 0 0 1.4rem; }
.auth__foot { text-align: center; margin: 1.2rem 0 0; font-size: .92rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; font-size: .93rem; }
.checklist .ok { color: var(--green); }
.checklist .bad { color: var(--berry); font-weight: 600; }

@media (max-width: 560px) {
  .usermenu__name { display: none; }
  .brand span { display: none; }
  .page { padding-top: 1rem; }
  .avatar--xl { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Gaveknap ---------- */
.importbox__tip { margin: .5rem 0 0; font-size: .88rem; color: var(--muted); }
.importbox--bm { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.gk .lead { margin-bottom: 1.5rem; }
.gk__install { display: grid; gap: 1.4rem; }
.gk__step { display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; align-items: start; }
.gk__step p { margin: 0 0 .5rem; }
.gk__step .card__title { margin-bottom: .35rem; }
.gk__num { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--on-green); font: 700 1.1rem var(--font-display); }
.gk__drag { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .8rem 0 !important; }
.gk__button { display: inline-flex; align-items: center; gap: .4rem; padding: .8rem 1.3rem; border-radius: 999px; background: var(--gold); color: #24190a; font-weight: 700; text-decoration: none; cursor: grab; box-shadow: 0 6px 18px -8px rgb(120 80 10 / 60%); border: 2px dashed color-mix(in srgb, #24190a 35%, transparent); }
.gk__button:hover { color: #24190a; background: color-mix(in srgb, var(--gold) 88%, #fff); }
.gk__button:active { cursor: grabbing; }
.gk__button.is-nudge { animation: nudge .45s ease; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } 60% { transform: translateY(2px); } }
.gk__arrow { color: var(--gold); font-weight: 700; font-size: .95rem; }
kbd { font: 600 .82em var(--font-body); padding: .1em .45em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--card); }
.gk__more summary { cursor: pointer; }
.gk__more ol { margin: 1rem 0; padding-left: 1.2rem; display: grid; gap: .6rem; }
.gk__code { width: 100%; font: .78rem ui-monospace, Menlo, monospace; resize: none; }
.gk__copied { color: var(--green); font-weight: 700; font-size: .9rem; }
.gk__facts { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }

/* ---------- Avatar cropper ---------- */
.cropper { width: min(94vw, 420px); }
.cropper__head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.cropper__head h2 { font: 600 1.2rem var(--font-display); margin: 0; }
.cropper__body { padding: 1.2rem; display: grid; gap: .9rem; justify-items: center; }
.cropper__stage { position: relative; width: min(320px, 78vw); aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: #222; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cropper__stage:active { cursor: grabbing; }
.cropper__stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.cropper__mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgb(0 0 0 / 50%); border: 2px solid rgb(255 255 255 / 85%); pointer-events: none; }
.cropper__zoom { display: flex; align-items: center; gap: .6rem; width: min(320px, 78vw); font-weight: 700; color: var(--muted); }
.cropper__zoom input { flex: 1; accent-color: var(--green); }
.cropper__help { text-align: center; margin: 0; }
.cropper__actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.2rem 1.2rem; }
.filebtn.is-busy { opacity: .6; pointer-events: none; }

/* ---------- Share a list (dialog on list.php) ---------- */
.sharebox { width: min(94vw, 560px); }
.sharebox__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.sharebox__head h2 { font: 600 1.2rem var(--font-display); margin: 0; }
.sharebox__body { padding: 1.2rem; display: grid; gap: .9rem; }
.sharebox__body p { margin: 0; }
.sharebox__body .hint { margin: 0; }
.sharebox__body form { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0; }
.sharebox__meta { font-size: .88rem; color: var(--muted); }
.sharebox__copied { display: block; color: var(--green); font-weight: 700; margin-bottom: .2rem; }
.sharebox__actions { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding-top: .3rem; border-top: 1px dashed var(--line); }
.sharebox__actions form { margin-top: .6rem; }

/* ---------- Shared list (delt.php, public) ---------- */
.page--shared { max-width: 920px; }
.shared__head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: 1rem 0 .5rem; }
.shared__head > div { flex: 1; min-width: 220px; }
.shared__head .muted { margin: 0; }
.shared__status { margin: .7rem 0 0; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .92rem; font-weight: 600; color: color-mix(in srgb, var(--gold) 60%, var(--ink)); }
.shared__status--bought { color: var(--berry); }
.shared__foot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.shared__foot p { margin: 0 0 .3rem; }
.shared__gone { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.shared__gone svg { color: var(--line-strong); margin-bottom: .5rem; }
.shared__gone .display { color: var(--ink); }
.table__sub { display: block; font-size: .8rem; color: var(--muted); }

/* ---------- Image zoom (lightbox, assets/js/zoom.js) ---------- */
.gift__zoom { all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; cursor: zoom-in; border-radius: inherit; }
.gift__zoom:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gift__zoom img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (hover: hover) { .gift__zoom:hover img { transform: scale(1.04); transition: transform .2s ease; } }
html.zoom-open { overflow: hidden; }
dialog.zoom { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: auto; overscroll-behavior: contain; color: #fff; }
dialog.zoom::backdrop { background: rgb(12 15 13 / 88%); backdrop-filter: blur(3px); }
.zoom__stage { box-sizing: border-box; min-width: 100%; min-height: 100%; width: max-content; display: flex; padding: 3.2rem 1rem 1rem; cursor: zoom-out; }
.zoom__figure { margin: auto; display: grid; justify-items: center; gap: .7rem; }
.zoom__img { display: block; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 7rem); width: auto; height: auto; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 20px 60px -10px rgb(0 0 0 / 60%); cursor: default; }
.zoom.is-shrunk .zoom__img { cursor: zoom-in; }
.zoom.is-full .zoom__img { max-width: none; max-height: none; cursor: zoom-out; }
.zoom.is-full .zoom__stage { width: max-content; }
.zoom__caption { max-width: min(90vw, 640px); text-align: center; font: 600 1.05rem/1.3 var(--font-display); color: #fff; cursor: default; }
.zoom__close { position: fixed; top: max(.7rem, env(safe-area-inset-top)); right: max(.7rem, env(safe-area-inset-right)); z-index: 1; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: rgb(255 255 255 / 16%); color: #fff; font-size: 1.2rem; cursor: pointer; }
.zoom__close:hover { background: rgb(255 255 255 / 28%); }
.zoom__close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Nyheder (release notes, nyheder.php) ---------- */
.mainnav a { position: relative; }
.navdot { display: inline-block; width: .5rem; height: .5rem; margin-left: .35rem; vertical-align: .15em; border-radius: 50%; background: var(--berry); box-shadow: 0 0 0 2px var(--card); }
.rn { max-width: 880px; margin: 0 auto; }
.rn__head { margin-bottom: 2rem; }
.rn__index { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.rn__index a { text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--muted); padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); }
.rn__index a:hover { color: var(--green); border-color: var(--green); }
.rn__index a.is-new { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.rn__release { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem 1.6rem 1.4rem; margin-bottom: 1.5rem; scroll-margin-top: 5rem; }
.rn__release--latest { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); background: linear-gradient(180deg, var(--green-soft), var(--card) 14rem); }
.rn__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.rn__version { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.rn__new { font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: var(--berry-soft); color: var(--berry); }
.rn__title { font: 600 clamp(1.45rem, 3vw, 1.9rem)/1.15 var(--font-display); letter-spacing: -.015em; margin: 0 0 .5rem; }
.rn__intro { font-size: 1.05rem; color: var(--muted); margin: 0 0 1.3rem; max-width: 62ch; }
.rn__features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .9rem; }
.rn__feature { display: grid; grid-template-columns: 2.6rem 1fr; gap: .85rem; align-items: start; padding: 1rem; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); }
.rn__feature--admin { border-style: dashed; }
.rn__icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 1.25rem; line-height: 1; }
.rn__ftitle { font: 600 1.05rem/1.25 var(--font-display); margin: .2rem 0 .35rem; }
.rn__ftitle .badge { vertical-align: .15em; margin-left: .2rem; font-family: var(--font-body); }
.rn__feature p { margin: 0; font-size: .95rem; line-height: 1.5; }
.rn__feature p + p { margin-top: .5rem; }
.rn__tip { padding: .5rem .7rem; border-radius: 8px; background: var(--gold-soft); font-size: .88rem !important; }
.rn__other { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.rn__otitle { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; }
.rn__other ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; font-size: .95rem; }
@media (max-width: 560px) {
  .rn__release { padding: 1.2rem 1rem 1rem; }
  .rn__features { grid-template-columns: 1fr; }
  .rn__feature { grid-template-columns: 2.2rem 1fr; padding: .85rem; }
  .rn__icon { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; }
}
.usermenu summary { position: relative; }
.navdot--user { display: none; position: absolute; top: .1rem; left: 1.7rem; margin: 0; }
@media (max-width: 760px) { .navdot--user { display: block; } }
