/* Fredoka (SIL Open Font License), lokal gehostet */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sun: #ffcb2e;
  --sun-deep: #f5a700;
  --sky: #2a75d8;
  --sky-soft: #dceaff;
  --cherry: #ef3e36;
  --grass: #23a05a;
  --navy: #16365f;

  --bg: #fff7df;
  --bg-dot: rgba(42, 117, 216, 0.08);
  --surface: #ffffff;
  --surface-2: #fff1c7;
  --ink: #16365f;
  --muted: #5d7190;
  --line: #e7dcbc;
  --gain: #1d8a4c;
  --loss: #d4302a;
  --focus: #2a75d8;
  --shadow: 0 4px 0 rgba(22, 54, 95, 0.14);
  --shadow-lg: 0 10px 30px rgba(22, 54, 95, 0.18);
  --radius: 1.25rem;
  --radius-card: 4.5% / 3.2%;
  --tabbar-h: 4.75rem;
  --font: "Fredoka", "Nunito", "Varela Round", ui-rounded, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10192c;
    --bg-dot: rgba(255, 203, 46, 0.06);
    --surface: #1b2844;
    --surface-2: #243457;
    --ink: #f6f1e1;
    --muted: #a7b4cc;
    --line: #2f4168;
    --sky-soft: #22385f;
    --gain: #5fd08f;
    --loss: #ff7a70;
    --focus: #ffcb2e;
    --shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: inherit; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 2px, transparent 2.5px);
  background-size: 22px 22px;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.ico { width: 1.5rem; height: 1.5rem; flex: none; }

/* ---------- App-Leiste ---------- */

.appbar {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem 0.5rem;
}
.appbar-logo { width: 2.75rem; height: 2.75rem; border-radius: 0.8rem; box-shadow: var(--shadow); }
.appbar-title { flex: 1; min-width: 0; line-height: 1.15; }
.appbar-hello { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.appbar h1 { margin: 0; font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }

/* ---------- Wert-Karte ---------- */

.hero { max-width: 76rem; margin: 0 auto; padding: 0.75rem 1rem 0; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  padding: 1.4rem 1.4rem 1.1rem;
  color: #fff;
  background:
    radial-gradient(circle at 110% -10%, rgba(255, 203, 46, 0.55) 0 28%, transparent 29%),
    radial-gradient(circle at -10% 120%, rgba(255, 255, 255, 0.12) 0 30%, transparent 31%),
    linear-gradient(135deg, #2a75d8, #1b4f9e);
  box-shadow: 0 6px 0 #133e7c, var(--shadow-lg);
}
.hero-sparkles {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 1.5px, transparent 2px) 18% 22% / 100% 100% no-repeat,
    radial-gradient(circle, #fff 0 2px, transparent 2.5px) 72% 14% / 100% 100% no-repeat,
    radial-gradient(circle, #ffe58a 0 2px, transparent 2.5px) 88% 62% / 100% 100% no-repeat,
    radial-gradient(circle, #fff 0 1.5px, transparent 2px) 46% 80% / 100% 100% no-repeat;
  opacity: 0.8;
}
.hero-label { margin: 0; font-size: 1rem; font-weight: 500; opacity: 0.9; position: relative; }
.total {
  position: relative;
  margin: 0.1rem 0 0.75rem;
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--sun);
  text-shadow: 0 3px 0 #133e7c;
}

.stats { position: relative; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stat {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.stat strong { font-weight: 700; }
.stat.up { background: #23a05a; }
.stat.down { background: #ef3e36; }

.trend { position: relative; margin: 0.9rem 0 0; }
.trend svg { width: 100%; height: 4rem; display: block; color: var(--sun); }
.trend figcaption { font-size: 0.85rem; opacity: 0.9; margin-top: 0.2rem; }
.trend .empty { margin: 0; font-size: 0.85rem; opacity: 0.8; }

/* ---------- Buttons & Felder ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  line-height: 1.2;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s;
}
.btn:active { transform: translateY(3px); box-shadow: none !important; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--sun); color: var(--navy); box-shadow: 0 4px 0 var(--sun-deep); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-plain { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); }
.btn-danger { background: transparent; color: var(--loss); box-shadow: inset 0 0 0 2px var(--loss); }
.btn-big { width: 100%; padding: 0.95rem 1.25rem; font-size: 1.15rem; }

.icon-btn {
  font: inherit; background: none; border: 0; color: var(--muted);
  width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  display: inline-grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.field { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.65rem 0.85rem;
  width: 100%;
  min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sky); outline: none; }
.field textarea { min-height: 4.5rem; resize: vertical; }

/* ---------- Suche & Sortierung ---------- */

.toolbar {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.field-search { flex: 1 1 14rem; position: relative; }
.field-search .ico { position: absolute; left: 0.9rem; top: 50%; translate: 0 -50%; width: 1.25rem; height: 1.25rem; color: var(--muted); }
.field-search input { padding-left: 2.6rem; border-radius: 999px; box-shadow: var(--shadow); }
.field-sort { flex: 0 1 14rem; }
.field-sort select { border-radius: 999px; box-shadow: var(--shadow); font-weight: 500; }

/* ---------- Ordner mit 9er-Seiten ---------- */

.binder {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 68rem) {
  .binder { grid-template-columns: 1fr 1fr; }
}

.page {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.8rem 0.8rem 1.9rem;
  box-shadow: 0 5px 0 var(--line), var(--shadow-lg);
  border-top: 6px solid var(--page-color, var(--sky));
}
.page:nth-child(4n+2) { --page-color: var(--cherry); }
.page:nth-child(4n+3) { --page-color: var(--grass); }
.page:nth-child(4n+4) { --page-color: var(--sun); }

.page-number {
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  translate: -50% 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--surface);
  background: var(--page-color, var(--sky));
  border-radius: 999px;
  padding: 0.05rem 0.65rem;
}
.page:nth-child(4n+4) .page-number { color: var(--navy); }

.pockets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.pocket {
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--surface-2);
  border: 0;
  border-radius: 0.9rem;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  min-width: 0;
  transition: transform 0.15s ease;
}
.pocket:hover { transform: translateY(-3px) rotate(-1deg); }
.pocket:active { transform: scale(0.97); }

.pocket-empty {
  border: 2.5px dashed var(--line);
  background: transparent;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  aspect-ratio: 63 / 100;
  cursor: default;
}
.pocket-empty:hover { transform: none; }
.pocket-empty.is-add { cursor: pointer; color: var(--sky); border-color: var(--sky); background: var(--sky-soft); }
.pocket-empty.is-add .plus {
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--sky); color: #fff; font-size: 1.6rem; line-height: 1;
  box-shadow: 0 3px 0 #133e7c;
}

.card-img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--line);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.card-img.is-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}

.slab { display: grid; gap: 0.15rem; min-width: 0; line-height: 1.2; }
.slab-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slab-value {
  justify-self: start;
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--sun);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
}
.slab-value.is-none { background: transparent; color: var(--muted); font-weight: 500; padding: 0; }
.slab-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-qty {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  background: var(--cherry);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  box-shadow: 0 2px 0 #a8221d;
  z-index: 1;
}

@media (max-width: 30rem) {
  .pockets { gap: 0.45rem; }
  .page { padding: 0.55rem 0.55rem 1.8rem; }
  .pocket { padding: 0.3rem; }
  .slab-name { font-size: 0.8rem; }
  .slab-value { font-size: 0.76rem; }
  .slab-sub { font-size: 0.66rem; }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty-state .big-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: 0.5rem; }
.empty-state h2 { color: var(--ink); margin: 0 0 0.5rem; font-size: 1.5rem; }
.empty-state p { max-width: 32rem; margin: 0 auto 1.25rem; }

/* ---------- Navigation unten ---------- */

.tabbar {
  position: fixed;
  z-index: 50;
  left: 50%;
  translate: -50% 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  width: min(30rem, calc(100vw - 1.5rem));
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--surface);
  border-radius: 1.75rem;
  box-shadow: 0 5px 0 var(--line), 0 12px 32px rgba(22, 54, 95, 0.22);
  padding: 0 0.4rem;
}
.tab {
  font: inherit;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: none;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0;
  border-radius: 1rem;
  cursor: pointer;
}
.tab:hover, .tab.is-active { color: var(--sky); }
.tab.is-busy .ico { animation: spin 0.8s linear infinite; }
.tab:disabled { cursor: progress; }
.fab {
  justify-self: center;
  width: 4rem;
  height: 4rem;
  margin-top: -2.2rem;
  border-radius: 50%;
  border: 4px solid var(--bg);
  background: var(--cherry);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #a8221d, 0 8px 20px rgba(239, 62, 54, 0.4);
  transition: transform 0.12s ease;
}
.fab .ico { width: 2rem; height: 2rem; stroke-width: 3; }
.fab:hover { transform: scale(1.06) rotate(90deg); }
.fab:active { transform: translateY(3px); box-shadow: 0 2px 0 #a8221d; }

/* ---------- Dialoge (Bottom-Sheet am Handy) ---------- */

.sheet {
  border: 0;
  padding: 0;
  width: min(54rem, calc(100vw - 2rem));
  max-height: min(92vh, 60rem);
  border-radius: 1.75rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.sheet::backdrop { background: rgba(16, 25, 44, 0.55); backdrop-filter: blur(3px); }
.sheet[open] { display: flex; flex-direction: column; animation: pop 0.22s ease-out; }
.sheet-grabber { display: none; }

@media (max-width: 40rem) {
  .sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 1.75rem 1.75rem 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sheet[open] { animation: slide-up 0.25s ease-out; }
  .sheet-grabber {
    display: block;
    width: 3rem; height: 0.35rem; border-radius: 999px;
    background: var(--line);
    margin: 0.6rem auto 0;
  }
}
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(0.95); opacity: 0; } }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.5rem 1.25rem;
}
.sheet-head h2 { margin: 0; font-size: 1.4rem; }
.sheet-body { padding: 0.5rem 1.25rem 1.5rem; overflow-y: auto; flex: 1; }

.search-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-row .field { flex: 1 1 14rem; }
.search-row .btn { align-self: end; }
.btn-scan { background: var(--sky); color: #fff; box-shadow: 0 4px 0 #133e7c; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0.75rem 0 0; display: flex; align-items: center; gap: 0.5rem; }
.notice { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 1rem; background: var(--sky-soft); font-size: 0.95rem; }
.notice.is-error { background: rgba(239, 62, 54, 0.12); color: var(--loss); }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.result {
  font: inherit; color: inherit; text-align: left;
  background: var(--surface-2); border: 0; padding: 0.4rem; border-radius: 1rem; cursor: pointer;
  display: grid; gap: 0.35rem; align-content: start;
  transition: transform 0.15s ease;
}
.result:hover { transform: translateY(-3px); }
.result-name { font-weight: 600; font-size: 0.92rem; line-height: 1.2; }
.result-sub { font-size: 0.78rem; color: var(--muted); line-height: 1.25; }

.detail { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) {
  .detail { grid-template-columns: minmax(12rem, 17rem) 1fr; }
}
.detail-img { max-width: 17rem; margin: 0 auto; width: 100%; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); transform: rotate(-2deg); }
@media (max-width: 40rem) { .detail-img { max-width: 11rem; } }
.detail h3 { margin: 0; font-size: 1.75rem; line-height: 1.1; }
.detail .sub { color: var(--muted); margin: 0.3rem 0 1.25rem; font-size: 0.95rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; align-items: end; }
.form-grid .span { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}
.chip input:checked + span { background: var(--sky); color: #fff; box-shadow: 0 3px 0 #133e7c; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.estimate {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  background: var(--sun);
  color: var(--navy);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  align-items: baseline;
  box-shadow: 0 4px 0 var(--sun-deep);
}
.estimate .big { font-size: 1.8rem; font-weight: 700; }
.estimate .small { grid-column: 1 / -1; font-size: 0.82rem; opacity: 0.8; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.actions .push { margin-left: auto; }

/* ---------- Login ---------- */

.login-page { padding-bottom: 0; }
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  position: relative;
  overflow: hidden;
}
.login-burst {
  position: absolute;
  width: 140vmax; height: 140vmax;
  background: repeating-conic-gradient(rgba(255, 203, 46, 0.22) 0 10deg, transparent 10deg 20deg);
  border-radius: 50%;
  animation: spin 90s linear infinite;
}
.login-card {
  position: relative;
  width: min(24rem, 100%);
  background: var(--surface);
  border-radius: 2rem;
  padding: 2rem 1.5rem 1.75rem;
  display: grid;
  gap: 1rem;
  text-align: center;
  box-shadow: 0 6px 0 var(--line), var(--shadow-lg);
}
.login-card .field { text-align: left; }
.login-logo { width: 4.5rem; height: 4.5rem; margin: -4rem auto 0; border-radius: 1.3rem; box-shadow: 0 5px 0 #133e7c; animation: bounce 2.4s ease-in-out infinite; }
.login-card h1 { margin: 0; font-size: 1.9rem; line-height: 1.1; }
.login-sub { margin: -0.5rem 0 0.25rem; color: var(--muted); }
.login-card .notice { margin: 0; text-align: left; }
.login-card .btn { margin-top: 0.5rem; }
@keyframes bounce { 50% { transform: translateY(-6px) rotate(-3deg); } }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  transform: translate(-50%, 1rem);
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: calc(100vw - 2rem);
  box-shadow: var(--shadow-lg);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--cherry); }

.spinner {
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 3px solid var(--sky); border-right-color: transparent;
  animation: spin 0.7s linear infinite; display: inline-block; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 0.3rem; }

/* ---------- Kamera-Scanner ---------- */

.camera {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  background: #000;
  color: #fff;
  overflow: hidden;
}
.camera[open] { display: block; }
.camera::backdrop { background: #000; }
.camera-video, .camera-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.camera-video { object-fit: cover; }
.camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.camera-flash.is-on { animation: flash 0.35s ease-out; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }

.camera-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 0.75rem) 0.75rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.camera-close {
  font: inherit; font-size: 1.2rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; flex: none;
  background: rgba(0, 0, 0, 0.45); color: #fff; cursor: pointer;
}
.camera-hint {
  margin: 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: center;
  translate: -1.4rem 0;
}

.camera-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1rem 2rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.camera-side {
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45);
  font-size: 1.5rem;
  cursor: pointer;
}
.camera-side.is-spacer { visibility: hidden; }
.shutter {
  --p: 0;
  width: 5rem; height: 5rem; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: conic-gradient(#3ddc84 calc(var(--p) * 360deg), rgba(255, 255, 255, 0.85) 0);
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.shutter-ring { width: 4rem; height: 4rem; border-radius: 50%; background: #fff; border: 3px solid #000; }
.shutter:active .shutter-ring { transform: scale(0.92); }
.shutter:disabled { opacity: 0.5; }

/* ---------- Eigene Fotos ---------- */

.photo-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 0.6rem;
  border-radius: 1rem;
  background: var(--surface-2);
  font-size: 0.92rem;
}
.photo-chip img { width: 2.75rem; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 0.3rem; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.photo-chip span { flex: 1; }

.badge-photo {
  position: absolute;
  left: 0.15rem;
  top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.2rem 0.3rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.detail-media { display: grid; gap: 0.75rem; justify-items: center; align-content: start; position: relative; }
.photo-mini {
  position: absolute;
  width: 32%;
  right: 0;
  bottom: -0.5rem;
  transform: rotate(6deg);
  border: 3px solid var(--surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
@media (min-width: 40rem) { .photo-mini { right: -0.75rem; } }

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.2rem;
}
.segmented button {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  border: 0; background: none; color: var(--muted);
  padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--sky); color: #fff; }

.photo-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.btn-small { font-size: 0.88rem; padding: 0.45rem 0.85rem; }

/* ---------- Schon in der Sammlung ---------- */

.result { position: relative; }
.result.is-owned { box-shadow: inset 0 0 0 3px var(--grass); }
.owned-badge {
  position: absolute;
  top: 0.1rem;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  background: var(--grass);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  box-shadow: 0 2px 0 #157a42;
}
.notice.is-owned { background: rgba(35, 160, 90, 0.14); color: var(--ink); }
.notice.is-owned::first-letter { color: var(--grass); font-weight: 700; }
.owned-note { margin: -0.5rem 0 1rem; }
#owned-match { margin: -0.4rem 0 1rem; color: var(--gain); font-weight: 500; }
