/* Foilio - Oberflaeche
   Gestaltungsidee "Holo-Foil": Karten wie Holo-Raritaeten. Tiefes Tintenschwarz
   mit einem Hauch Polarlicht oben, Flaechen wie mattes Glas. Schmuck ist allein
   der schillernde Holo-Verlauf (Gold, Pink, Lila, Cyan, Mint) - auf Hauptknoepfen,
   dem Gesamtwert, dem Scan-Knopf und als Glanz, der ueber Karten wandert.
   Gruen/Rot nur fuer Wertaenderungen, Zahlen tabellarisch. Ueberschriften und
   Betraege in Sora. Folgt dem Hell/Dunkel-Modus des Handys (hell: Perlmutt),
   Bewegung nur, wenn das Handy sie nicht abgeschaltet hat. */

@font-face {
  font-family: "Sora";
  src: url("/static/fonts/sora-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07080e;
  --bg-card: #10121b;
  --bg-elev: #181b28;
  --bg-hover: #202435;
  --glass: rgba(255, 255, 255, .04);
  --glass-strong: rgba(255, 255, 255, .075);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f2f3fb;
  --dim: #a3a8c3;
  --faint: #6f7491;
  --accent: #c7a6ff;          /* Lavendel aus dem Holo-Verlauf: Links, Linien, Fokus */
  --accent-strong: #ddc8ff;
  --accent-ink: #120b21;      /* dunkle Schrift auf Holo-Flaechen */
  --good: #4be3a0;
  --bad: #ff6f91;
  --holo: linear-gradient(115deg, #ffd36e 0%, #ff86c8 27%, #b994ff 50%, #6fe3ff 73%, #a8ffbf 100%);
  /* fuer wandernden Glanz: Verlauf, der an beiden Enden gleich ist */
  --holo-loop: linear-gradient(115deg, #ffd36e, #ff86c8, #b994ff, #6fe3ff, #a8ffbf, #ffd36e, #ff86c8);
  --sheen: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .42) 48%, transparent 64%);
  --aurora: radial-gradient(42% 55% at 15% 0%, rgba(255, 134, 200, .17), transparent 70%),
            radial-gradient(38% 50% at 85% 0%, rgba(111, 227, 255, .15), transparent 70%),
            radial-gradient(45% 60% at 50% 10%, rgba(185, 148, 255, .14), transparent 72%);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --glow: 0 6px 24px rgba(185, 148, 255, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 66px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Sora", var(--sans);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f5fb;
    --bg-card: #ffffff;
    --bg-elev: #f0eef8;
    --bg-hover: #e8e5f4;
    --glass: rgba(255, 255, 255, .7);
    --glass-strong: rgba(255, 255, 255, .92);
    --border: rgba(40, 24, 90, .1);
    --border-strong: rgba(40, 24, 90, .18);
    --text: #15122a;
    --dim: #5d5878;
    --faint: #8c88a6;
    --accent: #7547f5;
    --accent-strong: #5f33e0;
    --accent-ink: #120b21;
    --good: #0f9b5f;
    --bad: #d4335f;
    --aurora: radial-gradient(42% 55% at 15% 0%, rgba(255, 134, 200, .22), transparent 70%),
              radial-gradient(38% 50% at 85% 0%, rgba(111, 227, 255, .22), transparent 70%),
              radial-gradient(45% 60% at 50% 10%, rgba(185, 148, 255, .2), transparent 72%);
    --shadow: 0 8px 24px rgba(40, 20, 90, .08);
    --glow: 0 6px 22px rgba(117, 71, 245, .25);
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
}
/* Polarlicht oben: liegt hinter allem, scrollt nicht mit */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 75vh; z-index: -1; pointer-events: none;
  background: var(--aurora);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Holo-Schrift (Gesamtwert, Wortmarke) - wandert langsam */
.holo-text, .total .value, .brand .wordmark {
  background: var(--holo-loop); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }

/* --- Kopf ------------------------------------------------------------------ */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
header.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--holo); opacity: .35;
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px/1.2 var(--display); letter-spacing: .005em; }
.brand-logo { width: 30px; height: 36px; flex: none; filter: drop-shadow(0 3px 8px rgba(185, 148, 255, .45)); }
header.top .spacer { flex: 1; }
.back {
  border: 0; background: none; color: var(--text); font-size: 15px; padding: 6px 8px 6px 0;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; min-height: 0;
}
.back:hover { background: none; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -.005em; }
h1 { font-size: 23px; margin: 0 0 4px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 650; }
p { margin: 0 0 10px; }

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

nav.bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--border);
}
nav.bottom a {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); font-size: 11.5px; font-weight: 550; text-decoration: none;
}
nav.bottom a svg { width: 24px; height: 24px; }
nav.bottom a.active { color: var(--text); }
nav.bottom a.active:not(.scan-btn)::after {
  content: ""; position: absolute; top: 7px; width: 22px; height: 3px; border-radius: 3px; background: var(--holo);
}
/* Scan-Knopf: Holo-Kachel, die aus der Leiste herausragt */
nav.bottom a.scan-btn svg {
  width: 48px; height: 48px; padding: 11px; margin-top: -18px; border-radius: 16px;
  background: var(--holo-loop); background-size: 300% 100%; color: var(--accent-ink);
  box-shadow: var(--glow); animation: shimmer 9s linear infinite;
}
nav.bottom a.scan-btn.active { color: var(--text); }

/* --- Flaechen ---------------------------------------------------------- */

.card {
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.banner {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  font-size: 14px;
}
.banner.warn { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); color: var(--text); }
.banner.ok { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }

/* Wert-Kopf der Sammlung: gross, schillernd */
.total {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 16px;
}
.total::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--holo);
}
.total::after {
  content: ""; position: absolute; inset: -40% -60% auto auto; width: 70%; height: 140%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(185, 148, 255, .16), transparent);
}
.total .label { color: var(--dim); font-size: 13px; }
.total .value { font: 750 36px/1.15 var(--display); letter-spacing: -.02em; display: inline-block; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* --- Bedienelemente ---------------------------------------------------- */

button, .button {
  font: inherit;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--text);
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
button:hover, .button:hover { background: var(--bg-hover); text-decoration: none; }
button:active, .button:active { transform: scale(.98); }
button.primary, .button.primary {
  background: var(--holo-loop); background-size: 300% 100%; border-color: transparent;
  color: var(--accent-ink); font-weight: 700; box-shadow: var(--glow);
}
button.primary:hover, .button.primary:hover { background: var(--holo-loop); background-size: 300% 100%; background-position: 40% 0; }
button.danger { color: var(--bad); }
button.small { min-height: 34px; padding: 6px 11px; font-size: 14px; border-radius: 10px; }
button.block, .button.block { width: 100%; }
button:disabled { opacity: .55; cursor: default; transform: none; }

label.field { display: block; font-size: 13px; color: var(--dim); margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;            /* kleiner als 16px zoomt iOS beim Antippen */
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--dim);
  border-radius: 999px;
  padding: 6px 13px;
  min-height: 34px;
  font-size: 14px;
}
.chip.active { color: var(--accent-ink); background: var(--holo); border-color: transparent; font-weight: 650; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.switch input { width: 46px; height: 28px; accent-color: var(--accent); }

.segmented { display: flex; background: var(--glass); border: 1px solid var(--border); border-radius: 14px; padding: 3px; }
.segmented button {
  flex: 1; border: 0; background: none; min-height: 38px; border-radius: 11px; color: var(--dim); padding: 6px 8px;
}
.segmented button:hover { background: none; color: var(--text); }
.segmented button.active {
  background: var(--bg-elev); color: var(--text); font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--accent), var(--shadow);
}

/* --- Kartenraster ------------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.tile {
  display: block;
  color: var(--text);
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  text-decoration: none;
  position: relative;
  transition: transform .15s, border-color .15s;
}
.tile:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); }
.tile .pic {
  position: relative;
  aspect-ratio: 63 / 88;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-elev);
}
.tile .pic img { width: 100%; height: 100%; object-fit: cover; }
/* Holo-Glanz, der beim Antippen/Darueberfahren ueber die Karte wandert */
.tile .pic::after, .detail .big::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--sheen); background-size: 250% 100%; background-position: 120% 0; mix-blend-mode: soft-light;
  transition: background-position .7s ease;
}
.tile:hover .pic::after, .tile:active .pic::after { background-position: -120% 0; }
.tile .name { font-weight: 650; font-size: 14px; margin-top: 8px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .price { font: 700 15px/1.35 var(--display); margin-top: 2px; }
.qty {
  position: absolute; top: 13px; right: 13px; z-index: 1;
  background: var(--holo); color: var(--accent-ink); font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 1px 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* Trefferliste (Scan/Suche) */
.list { display: flex; flex-direction: column; gap: 10px; }
.hit {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass)); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; color: var(--text); text-decoration: none; text-align: left; width: 100%;
  min-height: 0; justify-content: flex-start;
}
.hit:hover { background: var(--bg-hover); text-decoration: none; }
.hit .pic { width: 64px; flex: none; aspect-ratio: 63 / 88; border-radius: 7px; overflow: hidden; background: var(--bg-elev); }
.hit .pic img { width: 100%; height: 100%; object-fit: cover; }
.hit .info { flex: 1; min-width: 0; }
.hit .name { font-weight: 650; line-height: 1.3; }
.hit .meta { font-size: 13px; color: var(--dim); }
.hit .price { font: 700 14.5px/1.3 var(--display); text-align: right; white-space: nowrap; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: var(--dim);
  margin-right: 4px; white-space: nowrap;
}
.badge.gold { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--border)); }

/* --- Kartendetail ------------------------------------------------------ */

.detail { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail .big {
  position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-elev); aspect-ratio: 63 / 88;
  box-shadow: var(--shadow), 0 0 0 1px var(--border), 0 18px 50px rgba(185, 148, 255, .18);
}
.detail .big img { width: 100%; height: 100%; object-fit: contain; }
.detail .big:hover::after { background-position: -120% 0; }
.photo-toggle { margin-top: 8px; }

.prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prices .p { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.prices .p .l { font-size: 12px; color: var(--dim); }
.prices .p .v { font: 700 16px/1.35 var(--display); }
.headline-price { font: 780 34px/1.1 var(--display); letter-spacing: -.02em; }

.chart { width: 100%; height: auto; margin-top: 6px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.chart .axis { stroke: var(--border); }

.entry { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.entry:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* --- Scan -------------------------------------------------------------- */

/* Scan-Feld mit umlaufendem Holo-Rahmen */
.scan-zone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 220px; text-align: center;
  border: 0; border-radius: 20px; padding: 24px;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass)); cursor: pointer;
}
.scan-zone::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: var(--holo-loop); background-size: 300% 100%; animation: shimmer 9s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.scan-zone .icon { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center;
  background: var(--holo); color: var(--accent-ink); box-shadow: var(--glow); }
.scan-zone .icon svg { width: 32px; height: 32px; }
.scan-zone b { font-family: var(--display); font-size: 16px; }
.preview { width: 120px; border-radius: 10px; box-shadow: var(--shadow); }

.spinner {
  width: 34px; height: 34px; border-radius: 50%; margin: 8px auto;
  background: conic-gradient(from 0deg, #ffd36e, #ff86c8, #b994ff, #6fe3ff, #a8ffbf, transparent 85%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.small-spinner { display: inline-block; width: 16px; height: 16px; margin: 0 6px -3px 0; vertical-align: baseline; }

/* --- Blatt von unten (Formulare) ------------------------------------------ */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 4, 10, .6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  position: relative;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
}
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--holo); }
.sheet h2 { margin-top: 0; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  z-index: 60; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow), var(--glow); max-width: calc(100% - 32px);
}

table.users { width: 100%; border-collapse: collapse; }
table.users td { padding: 9px 6px; border-top: 1px solid var(--border); vertical-align: middle; }

.empty { text-align: center; color: var(--dim); padding: 36px 12px; }
.empty .big-icon { font-size: 40px; margin-bottom: 6px; }

.install-hint {
  position: fixed; left: 12px; right: 12px; z-index: 40;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 14px; padding: 10px 12px;
  font-size: 13.5px; box-shadow: var(--shadow);
}

/* Einladungen */
.invite-open { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--border); }

/* Rechtliches: AGB, Datenschutz, Impressum */
.legal { max-width: 760px; margin: 0 auto; }
.legal article { line-height: 1.6; overflow-wrap: anywhere; }
.legal h1 { font: 800 26px/1.2 var(--display); margin: 0 0 6px; }
.legal h2 { font: 700 17px/1.3 var(--display); margin: 26px 0 6px; }
.legal h3 { font-size: 15px; margin: 16px 0 4px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal-links { text-align: center; margin: 4px 0 12px; }
.legal-links a[aria-current] { color: var(--text); font-weight: 700; }
.legal-foot { text-align: center; margin-top: 10px; }
mark.fehlt { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--text); padding: 0 4px; border-radius: 4px; }

/* Stufen: Foilio Free / Holo */
.plan-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 12.5px/1.3 var(--display);
  border: 1px solid var(--border-strong); color: var(--dim); white-space: nowrap;
}
.plan-badge.small { padding: 1px 7px; font-size: 11px; vertical-align: 1px; }
.plan-badge.holo { background: var(--holo); color: var(--accent-ink); border-color: transparent; box-shadow: var(--glow); }
.paket.holo { border-color: transparent; background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box, var(--holo) border-box; border: 1px solid transparent; }
.meter-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-top: 12px; color: var(--dim); }
.meter { height: 8px; border-radius: 999px; background: var(--glass-strong); overflow: hidden; margin-top: 5px; }
.meter span { display: block; height: 100%; background: var(--holo); border-radius: inherit; }
.holo-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 14px; }
.holo-list li::before { content: "✦"; margin-right: 8px; background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.holo-teaser {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; text-align: left;
  background: var(--glass); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--dim); font-size: 14px; cursor: pointer;
}
.holo-teaser:hover { background: var(--glass-strong); }
.plan-edit { gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.plan-edit select, .plan-edit input { width: auto; min-height: 0; padding: 4px 8px; font-size: 13px; }
.plan-edit label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.plan-edit input[type="date"] { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
@media (max-width: 640px) {
  /* Benutzerliste am Handy: Name oben, Knoepfe darunter statt daneben */
  table.users tr { display: block; border-top: 1px solid var(--border); padding: 8px 0; }
  table.users tr:first-child { border-top: 0; }
  table.users td { display: block; border-top: 0; padding: 4px 2px; text-align: left !important; white-space: normal !important; }
  table.users td:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
}

/* Anleitung "Als App installieren" */
.install-sheet { text-align: left; }
.install-sheet .install-icon { width: 64px; height: 64px; border-radius: 16px; margin: 4px 0 10px; box-shadow: var(--glow); }
.install-sheet h3 { margin: 18px 0 8px; font-size: 15px; }
.install-steps { list-style: none; counter-reset: schritt; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.install-steps li { counter-increment: schritt; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; line-height: 1.45; }
.install-steps li::before {
  content: counter(schritt); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--holo); color: var(--accent-ink); font: 700 14px/1 var(--display);
}

/* Anmeldung */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 14px; text-align: center; }
.login-logo svg { width: 84px; height: 100px; filter: drop-shadow(0 10px 24px rgba(185, 148, 255, .45)); }
.login-logo .wordmark { font: 800 32px/1 var(--display); letter-spacing: -.01em; }

@media (max-width: 640px) {
  main { padding: 12px; }
  .detail { grid-template-columns: 1fr; }
  .detail .big { max-width: 300px; margin: 0 auto; width: 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  nav.bottom { left: 50%; transform: translateX(-50%); bottom: 14px; width: 520px; border: 1px solid var(--border);
    border-radius: 20px; height: var(--nav-h); padding-bottom: 0; box-shadow: var(--shadow); }
  body { padding-bottom: calc(var(--nav-h) + 44px); }
}

/* --- Treffer nach Kategorien (aufklappbar) ------------------------------- */

.groups { display: flex; flex-direction: column; gap: 10px; }
.group {
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.group-head {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; border-radius: 0;
  padding: 10px 12px; min-height: 60px;
  text-align: left; justify-content: flex-start;
}
.group-head:hover { background: var(--glass); }
.group-head:active { transform: none; }
.group-head .grow { display: flex; flex-direction: column; min-width: 0; }
.group-head .title { font-weight: 650; line-height: 1.3; }
.group-head .sub { font-size: 12.5px; color: var(--dim); }
.group-head .thumbs { display: flex; flex: none; padding-left: 8px; }
.group-head .thumbs img {
  width: 28px; height: 39px; object-fit: cover; border-radius: 4px;
  margin-left: -10px; border: 2px solid var(--bg-card); background: var(--bg-elev);
}
.group-head .chev { flex: none; color: var(--dim); transition: transform .18s ease; }
.group.open .group-head .chev { transform: rotate(90deg); }
.group .list { padding: 0 8px 8px; }
.group .hit { background: var(--glass-strong); border-color: transparent; }
.group .hit:hover { background: var(--bg-hover); }

/* --- Live-Kamera mit Selbstauslöser ------------------------------------------
   Immer dunkel (Kamerabild), unabhängig vom Hell/Dunkel-Modus. Der Rahmen hat
   Kartenformat 63:88; alles außerhalb ist abgedunkelt. */

.camera {
  position: fixed; inset: 0; z-index: 80; background: #000; color: #fff;
  overflow: hidden; touch-action: none;
  --accent: #c7a6ff;
}
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-guide {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(80vw, calc(62vh * 63 / 88)); aspect-ratio: 63 / 88;
  border: 3px solid rgba(255, 255, 255, .85); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); transition: border-color .15s, box-shadow .15s;
}
.camera.ready .camera-guide {
  border-color: #c7a6ff; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 0 26px rgba(199, 166, 255, .75);
}
.camera.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .55; }
.camera-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
}
.camera-status {
  position: relative; overflow: hidden;
  flex: 1; text-align: center; font-weight: 650; font-size: 15px; padding: 8px 12px;
  background: rgba(10, 8, 20, .62); border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.camera.ready .camera-status { color: #ddc8ff; }
.camera-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--holo);
  transition: width .14s linear;
}
.camera-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(10, 8, 20, .62); color: #fff; border: 1px solid rgba(255, 255, 255, .25); padding: 0; font-size: 18px; min-height: 0;
}
.camera-btn.on { background: var(--holo); color: var(--accent-ink); }
.camera-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 18px);
}
.camera-shutter {
  width: 74px; height: 74px; border-radius: 50%; padding: 0; min-height: 0;
  background: #fff padding-box; border: 5px solid transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .4), 0 0 24px rgba(199, 166, 255, .5);
}
.camera-shutter:hover { background: #fff padding-box; }
.camera-shutter:active { transform: scale(.94); }
.camera-ai { background: var(--holo); color: var(--accent-ink); border: 0; font-weight: 750; }
.camera-tip { font-size: 13px; color: rgba(255, 255, 255, .8); text-align: center; text-shadow: 0 1px 3px #000; }

/* --- Rückmeldungen ------------------------------------------------------------ */

.fb-text { white-space: pre-wrap; margin: 8px 0 6px; }
.fb-photo { max-width: 160px; max-height: 200px; border-radius: var(--radius-sm); margin-top: 8px; border: 1px solid var(--border); }
.fb-answer {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}

/* --- Massen-Scan --------------------------------------------------------------- */

.camera-done { width: auto; padding: 0 16px; border-radius: 999px; font-weight: 750; font-size: 15px; }
.camera-count {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 66px); transform: translateX(-50%);
  font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: rgba(10, 8, 20, .62); white-space: nowrap;
}
.camera-added {
  display: flex; align-items: center; gap: 10px; max-width: 92vw; padding: 8px 12px 8px 8px;
  background: rgba(8, 24, 18, .88); border: 1px solid var(--good); border-radius: 14px; font-size: 14px;
  box-shadow: 0 0 22px rgba(75, 227, 160, .3);
}
.camera-added img { width: 40px; border-radius: 4px; }
.mass-row { gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.mass-row:last-child { border-bottom: 0; }
.mass-thumb { width: 40px; border-radius: 4px; flex: none; }

/* Wer weniger Bewegung eingestellt hat, bekommt keinen wandernden Glanz */
@media (prefers-reduced-motion: reduce) {
  .holo-text, .total .value, .brand .wordmark, nav.bottom a.scan-btn svg, .scan-zone::before { animation: none; }
  .tile, .tile .pic::after, .detail .big::after { transition: none; }
}
