@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Layout: ein Regal voller Wunschzettel. Listen sind Karten mit Bild-Collage,
   jeder Wunsch steht auf einem weißen Produktteller und trägt ein gelbes Preisschild. */
:root {
  --paper: #F3F2F7;
  --surface: #FFFFFF;
  --sunk: #EAE8F1;
  --ink: #1A1825;
  --muted: #64617A;
  --line: #DDDAE7;
  --berry: #C2185B;
  --berry-ink: #FFFFFF;
  --berry-soft: #F8E1EA;
  --sticker: #FFD23F;
  --sticker-ink: #2A2100;
  --danger: #B42318;
  --plate: #FFFFFF;
  --backdrop: rgb(16 12 28 / 0.5);
  --shadow: 0 1px 2px rgb(26 24 37 / 0.06), 0 8px 24px rgb(26 24 37 / 0.07);
  --shadow-lift: 0 2px 4px rgb(26 24 37 / 0.08), 0 16px 36px rgb(26 24 37 / 0.12);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13121A;
    --surface: #1C1B26;
    --sunk: #262433;
    --ink: #EDEBF5;
    --muted: #A5A2B8;
    --line: #322F41;
    --berry: #FF6B9A;
    --berry-ink: #1E0711;
    --berry-soft: #3A1828;
    --sticker: #F7CB3B;
    --sticker-ink: #231B00;
    --danger: #FF8A7E;
    --plate: #FFFFFF;
    --backdrop: rgb(0 0 0 / 0.6);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.28);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.45), 0 16px 36px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 6px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 8px 72px;
}

/* ---------- Kopfzeile ---------- */
.top {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 800 1.35rem/1 var(--font-display);
  letter-spacing: -0.03em;
}
.brand svg { width: 32px; height: 32px; flex: none; }
.brand.big { font-size: 1.6rem; }
.brand.big svg { width: 40px; height: 40px; }
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--berry-soft);
  color: var(--berry);
  font: 800 1.1rem/1 var(--font-display);
  cursor: pointer;
}
.avatar:hover { box-shadow: 0 0 0 3px var(--line); }

/* ---------- Typo ---------- */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
}
.meta { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 0.95rem/1.1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--berry); color: var(--berry-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn.danger.solid { background: var(--danger); color: #FFFFFF; border-color: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn svg { width: 18px; height: 18px; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--berry); color: var(--berry); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.field small { color: var(--muted); font-size: 0.8rem; }
input, textarea, select {
  width: 100%;
  font: 400 1rem/1.4 var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px var(--berry-soft); }
input[readonly] { color: var(--muted); }
.form-grid { display: grid; gap: 14px; }
.form-error {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.92rem;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Anmeldung ---------- */
.auth {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 32px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}
.auth-intro { display: grid; gap: 22px; min-width: 0; }
.auth-intro h1 { max-width: 13ch; }
.auth-intro > p { max-width: 46ch; color: var(--muted); font-size: 1.08rem; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  min-width: 0;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--sunk);
  border-radius: 12px;
  padding: 4px;
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  min-height: 40px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.fineprint { color: var(--muted); font-size: 0.86rem; }

.demo { position: relative; height: 270px; margin: 6px 12px 0; }
.demo-label {
  position: absolute;
  top: -4px; left: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-card {
  position: absolute;
  top: 26px;
  width: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-card:nth-of-type(1) { left: 0; transform: rotate(-5deg); }
.demo-card:nth-of-type(2) { left: calc(50% - 86px); top: 8px; transform: rotate(2deg); z-index: 1; }
.demo-card:nth-of-type(3) { left: calc(100% - 172px); top: 34px; transform: rotate(6deg); }
.demo-plate { background: var(--plate); height: 118px; display: grid; place-items: center; color: #3B3552; }
.demo-plate svg { width: 64px; height: 64px; }
.demo-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.demo-body b { font-size: 0.86rem; line-height: 1.25; }

/* ---------- Seitenkopf ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 28px;
}
.page-head > div { display: grid; gap: 10px; min-width: 0; }

/* ---------- Listen-Übersicht ---------- */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 20px;
}
.list-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
}
.list-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.list-card-body { padding: 14px 18px 18px; display: grid; gap: 4px; }
.list-card-body h2 { font: 700 1.25rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.list-card.new {
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 2px dashed var(--line);
  background: transparent;
  box-shadow: none;
  font: 700 1.05rem var(--font-display);
  color: var(--muted);
  cursor: pointer;
}
.list-card.new:hover { color: var(--berry); border-color: var(--berry); }

.collage {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  display: grid;
  gap: 2px;
  background: var(--line);
  position: relative;
}
.collage img { width: 100%; height: 100%; object-fit: contain; background: var(--plate); padding: 10%; min-height: 0; }
.collage.n1 { grid-template-columns: 1fr; }
.collage.n2 { grid-template-columns: 1fr 1fr; }
.collage.n3 { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.collage.n3 img:first-child { grid-row: span 2; }
.collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage.n3 img, .collage.n4 img { padding: 8%; }
.collage .ph, .collage.empty { background: var(--berry-soft); }
.collage.empty { display: grid; place-items: center; }
.collage.empty span {
  font: 800 4.5rem/1 var(--font-display);
  color: var(--berry);
  letter-spacing: -0.04em;
}

/* ---------- Leere Zustände ---------- */
.empty {
  border: 2px dashed var(--line);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 44px);
  display: grid;
  gap: 14px;
  justify-items: start;
}
.empty h2 { font: 800 1.6rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.empty p { color: var(--muted); max-width: 52ch; }

/* ---------- Liste ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 6px;
}
.back:hover { color: var(--ink); }
.list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 14px 0 26px;
}
.list-head-text { display: grid; gap: 10px; min-width: 0; flex: 1 1 320px; }
.list-note { max-width: 60ch; white-space: pre-line; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Großer Plus-Knopf über den Wünschen */
.add-wish {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  padding: 14px 18px;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.add-wish:hover { border-color: var(--berry); }
.add-wish:active { transform: translateY(1px); }
.add-plus {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--berry);
  color: var(--berry-ink);
  font: 600 2rem/1 var(--font-display);
}
.add-text { display: grid; gap: 2px; min-width: 0; }
.add-text b { font: 700 1.15rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.add-text small { color: var(--muted); font-size: 0.9rem; }

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 18px;
}
.item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  min-width: 0;
}
.item-img {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  background: var(--plate);
  overflow: hidden;
}
.item-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12%;
  transition: transform 0.25s;
}
a.item-img:hover img { transform: scale(1.04); }
.ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--berry-soft);
  color: var(--berry);
  font: 800 3.4rem/1 var(--font-display);
}
.item-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; min-width: 0; }
.item-site {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-title {
  font: 600 1rem/1.32 var(--font-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.item-note {
  font-size: 0.88rem;
  background: var(--sunk);
  border-radius: 10px;
  padding: 7px 10px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.item-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.shop-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--berry);
  text-decoration: none;
}
.shop-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Preisschild */
.price-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--sticker);
  color: var(--sticker-ink);
  font: 800 0.95rem/1 var(--font-display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  padding: 7px 10px 7px 20px;
  border-radius: 3px 7px 7px 3px;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
  white-space: nowrap;
}
.price-tag::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
}

/* Wird geladen */
.shimmer {
  background: linear-gradient(90deg, var(--sunk) 0%, var(--line) 50%, var(--sunk) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Handy: Wünsche als kompakte Zeilen */
@media (max-width: 560px) {
  .items { grid-template-columns: 1fr; gap: 12px; }
  .item { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; border-radius: 16px; }
  .item-img { margin: 10px 0 10px 10px; border-radius: 12px; border: 1px solid var(--line); }
  .item-img img { padding: 8%; }
  .ph { font-size: 2.2rem; }
  .item-body { padding: 12px 14px 12px 14px; }
  .item-title { font-size: 0.97rem; }
  .list-card.new { min-height: 88px; }
  .list-head .head-actions { width: 100%; }
  .list-head .head-actions .btn { flex: 1; }
  .add-wish { margin-bottom: 20px; }
}

/* ---------- Geteilte Ansicht ---------- */
.share-head { display: grid; gap: 12px; margin: 18px 0 30px; }
.share-head .list-note { color: var(--ink); font-size: 1.05rem; }
.owner-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--berry-soft);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  margin-bottom: 22px;
  font-weight: 600;
}
.foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
}
.foot a { color: var(--berry); font-weight: 700; text-decoration: none; }

/* ---------- Dialoge ---------- */
dialog.sheet {
  border: 0;
  padding: 0;
  border-radius: 22px;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  overflow: auto;
}
dialog.sheet::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.sheet-inner { padding: 22px 24px 24px; display: grid; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h2 { font: 800 1.45rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.sheet p { color: var(--muted); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { min-width: 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 0.92rem; }
.danger-zone[open] summary { margin-bottom: 10px; }
.danger-zone > div { display: grid; gap: 10px; justify-items: start; }
.confirm-box {
  display: grid;
  gap: 10px;
  background: var(--sunk);
  border-radius: 12px;
  padding: 12px 14px;
}
.confirm-box p { color: var(--ink); font-weight: 600; }
.sheet .form-error { color: var(--danger); }
.sheet .hint { font-size: 0.88rem; }
.sheet .notice-inline {
  color: var(--ink);
  background: var(--sunk);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

/* Vorschau eines Wunsches: Bild links, Knöpfe rechts */
.wish-media {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.wish-img {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.wish-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.wish-img .ph { font-size: 2.6rem; }
.wish-img.shimmer { border: 0; }
.wish-media-actions { display: flex; flex-wrap: wrap; gap: 8px; align-content: center; }
.wish-media-actions:has(#wish-file:focus-visible) label[for="wish-file"] { outline: 3px solid var(--berry); outline-offset: 2px; }
.wish-loading {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 4px 0 12px;
}
.wish-loading b { color: var(--ink); }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.sheet-actions .row { gap: 8px; }

@media (max-width: 560px) {
  dialog.sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    max-height: calc(100% - 24px);
  }
  .sheet-inner {
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .wish-media { grid-template-columns: 108px minmax(0, 1fr); gap: 14px; }
}

/* ---------- Meldungen ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  z-index: 100;
}
.toast.error { background: var(--danger); color: #FFFFFF; }

.loading { color: var(--muted); padding: 40px 0; font-weight: 600; }
.boot { min-height: 60vh; }
.noscript { padding: 24px; }
.notice { display: grid; gap: 14px; justify-items: start; padding: 40px 0; }
.notice h1 { font: 800 2rem/1.1 var(--font-display); }
.notice p { color: var(--muted); max-width: 50ch; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; align-items: start; min-height: 0; padding-top: 20px; }
  .auth-intro h1 { max-width: none; }
}
@media (max-width: 440px) {
  .demo { height: 230px; }
  .demo-card { width: 138px; }
  .demo-card:nth-of-type(2) { left: calc(50% - 69px); }
  .demo-card:nth-of-type(3) { left: calc(100% - 138px); }
  .demo-plate { height: 96px; }
  .demo-plate svg { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
