/* ==========================================================================
   Korbfuchs – Ultra-Smooth Organic Glassmorphism System
   Inspiriert von der organischen Glassmorphism-Architektur & Touch-Ergonomie
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg-gradient: radial-gradient(at 0% 0%, #f1f5f9 0, transparent 55%),
                 radial-gradient(at 100% 0%, #fff7ed 0, transparent 45%),
                 radial-gradient(at 100% 100%, #ede9fe 0, transparent 50%),
                 radial-gradient(at 0% 100%, #ecfdf5 0, transparent 45%),
                 #f8fafc;
  --bg: #f8fafc;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --card-border: rgba(255, 255, 255, 0.85);
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(203, 213, 225, 0.75);
  --line-light: rgba(226, 232, 240, 0.6);
  
  /* Brand: Sunset Fox Orange & Fresh Emerald */
  --brand: #ea580c;
  --brand-2: #c2410c;
  --brand-soft: rgba(254, 215, 170, 0.4);
  --brand-glow: 0 0 25px rgba(234, 88, 12, 0.25);
  
  --mint: #10b981;
  --mint-soft: rgba(209, 250, 229, 0.75);
  --mint-border: rgba(167, 243, 208, 0.8);
  
  --sun: #f59e0b;
  --sun-soft: rgba(254, 243, 199, 0.75);
  --sun-ink: #b45309;
  
  --coral: #f97316;
  --coral-soft: rgba(255, 237, 213, 0.75);
  
  --field: rgba(255, 255, 255, 0.9);
  --field-focus: #ffffff;
  
  --shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 45px -8px rgba(99, 102, 241, 0.18), 0 4px 16px rgba(15, 23, 42, 0.06);
  
  --radius: 24px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-pill: 9999px;
  --tabbar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg-gradient: radial-gradient(at 0% 0%, rgba(30, 27, 75, 0.7) 0, transparent 60%),
                 radial-gradient(at 100% 0%, rgba(67, 20, 7, 0.5) 0, transparent 50%),
                 radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.9) 0, transparent 70%),
                 #080c16;
  --bg: #080c16;
  --card: rgba(17, 24, 39, 0.72);
  --card-solid: #111827;
  --card-border: rgba(255, 255, 255, 0.12);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.1);
  --line-light: rgba(255, 255, 255, 0.06);
  
  --brand: #fb923c;
  --brand-2: #ea580c;
  --brand-soft: rgba(251, 146, 60, 0.2);
  --brand-glow: 0 0 30px rgba(251, 146, 60, 0.35);
  
  --mint: #34d399;
  --mint-soft: rgba(12, 51, 43, 0.75);
  --mint-border: rgba(52, 211, 153, 0.35);
  
  --sun: #fbbf24;
  --sun-soft: rgba(56, 45, 13, 0.75);
  --sun-ink: #fef08a;
  
  --coral: #fb923c;
  --coral-soft: rgba(60, 30, 17, 0.75);
  
  --field: rgba(15, 23, 42, 0.82);
  --field-focus: rgba(26, 36, 56, 0.95);
  
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg-gradient: radial-gradient(at 0% 0%, rgba(30, 27, 75, 0.7) 0, transparent 60%),
                   radial-gradient(at 100% 0%, rgba(67, 20, 7, 0.5) 0, transparent 50%),
                   radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.9) 0, transparent 70%),
                   #080c16;
    --bg: #080c16;
    --card: rgba(17, 24, 39, 0.72);
    --card-solid: #111827;
    --card-border: rgba(255, 255, 255, 0.12);
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(255, 255, 255, 0.1);
    --line-light: rgba(255, 255, 255, 0.06);
    --brand: #fb923c;
    --brand-2: #ea580c;
    --brand-soft: rgba(251, 146, 60, 0.2);
    --brand-glow: 0 0 30px rgba(251, 146, 60, 0.35);
    --mint: #34d399;
    --mint-soft: rgba(12, 51, 43, 0.75);
    --mint-border: rgba(52, 211, 153, 0.35);
    --sun: #fbbf24;
    --sun-soft: rgba(56, 45, 13, 0.75);
    --sun-ink: #fef08a;
    --coral: #fb923c;
    --coral-soft: rgba(60, 30, 17, 0.75);
    --field: rgba(15, 23, 42, 0.82);
    --field-focus: rgba(26, 36, 56, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 22px; font-weight: 800; letter-spacing: -.025em; margin: 0; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 10px; }
input, select, button, textarea { font: inherit; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: var(--brand); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kopfzeile (Frosted Glass Header) ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line-light);
  box-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  flex: none;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
  transition: transform .2s ease;
}
.logo:hover { transform: scale(1.05) rotate(-3deg); }
.brand { flex: 1; min-width: 0; line-height: 1.15; }
.wordmark {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s;
}
.chip-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.chip-btn svg { color: var(--brand); flex: none; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px calc(var(--tabbar) + var(--safe-b) + 95px);
}
.view { display: none; animation: fade .22s cubic-bezier(0.16, 1, 0.3, 1); }
.view.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Tableiste (Schwebende Organic Frosted Pille) ---------- */
.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(10px + var(--safe-b));
  z-index: 30;
  max-width: 612px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--tabbar);
  padding: 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.tabbar button {
  position: relative;
  border: 0;
  background: none;
  border-radius: var(--radius-pill);
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s cubic-bezier(0.16, 1, 0.3, 1), color .2s, transform .08s;
}
.tabbar button:active { transform: scale(0.95); }
.tabbar .ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar button.on {
  background: linear-gradient(135deg, var(--brand), #f59e0b);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
}
.badge-n {
  position: absolute;
  top: 4px;
  left: calc(50% + 7px);
  background: #ef4444;
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}
.badge-n:empty { display: none; }

/* ---------- Karten & Formulare (Organic Glass Surface) ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
details.card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-right: 4px;
}
details.card[open] > summary::after { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: 14px; }

.field {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 14px;
}
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}

/* Touch-Ergonomie: Mindestens 48px Höhe, samtiger Focus-State */
input, select, textarea {
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 48px;
  font-weight: 600;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: var(--field-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea { font: 13px/1.45 ui-monospace, Consolas, monospace; resize: vertical; border-radius: 18px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button {
  border: 0;
  background: var(--field);
  border-radius: 16px;
  padding: 12px 18px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .1s, filter .15s, background .15s, box-shadow .15s;
}
button:active { transform: scale(.96); }
button.primary {
  background: linear-gradient(135deg, var(--brand), #f59e0b);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
}
button.primary:hover { filter: brightness(1.06); }
button.danger {
  background: transparent;
  color: #ef4444;
  box-shadow: inset 0 0 0 1.5px #ef4444;
}
button.danger:hover { background: rgba(239, 68, 68, 0.1); }
button.wide { width: 100%; }
button.round {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  flex: none;
}
button:disabled { opacity: .55; cursor: not-allowed; }

.seg {
  display: inline-flex;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: 5px 0 12px;
}
.seg.full { display: flex; }
.seg button {
  background: transparent;
  min-height: 40px;
  flex: 1;
  border-radius: var(--radius-pill);
  color: var(--muted);
  padding: 7px 14px;
  font-weight: 700;
}
.seg button.on {
  background: var(--card-solid);
  color: var(--brand);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.scroll-x {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 -16px 12px;
  padding: 2px 16px 10px;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid rgba(234, 88, 12, 0.25);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.08);
  transition: transform .1s, background .15s, box-shadow .15s;
}
.chip:hover { background: color-mix(in srgb, var(--brand-soft) 80%, white); transform: translateY(-1px); }
.chip:active { transform: scale(0.96); }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px rgba(0,0,0,.08);
}

/* Schalter */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 32px;
  min-height: 32px;
  border-radius: 16px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  flex: none;
  border: 0;
  padding: 0;
  transition: background .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
  transition: left .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch:checked { background: var(--mint); }
.switch:checked::after { left: 23px; }
.switch:disabled { opacity: .4; }
.switchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.switchrow small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- Liste & Artikel (Organic Frosted Cards) ---------- */
.addbar { display: flex; gap: 8px; margin-bottom: 12px; }
.addbar input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  border-radius: 18px;
}
.addbar .round {
  background: linear-gradient(135deg, var(--brand), #f59e0b);
  color: #fff;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
}
.budgetline {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin: 6px 4px 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 12px 14px 12px 18px;
  margin-bottom: 10px;
  transition: transform .12s, box-shadow .15s;
}
.item:hover { transform: translateY(-1px); }
.item .txt { flex: 1; min-width: 0; cursor: pointer; }
.item .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 12px; color: var(--coral); font-weight: 700; }

.stepper {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.stepper button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  background: var(--card-solid);
  color: var(--brand);
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.stepper span {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar) + var(--safe-b) + 20px);
  z-index: 25;
  max-width: 608px;
  margin: 0 auto;
  min-height: 54px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--brand) 0%, #f59e0b 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  box-shadow: 0 10px 30px rgba(234, 88, 12, 0.4);
  transition: transform .1s, filter .15s;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(0.98); }

/* ---------- Ergebnis (Hero & Spar-Banner) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(254, 243, 199, 0.6) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(67, 20, 7, 0.6) 100%);
  border-color: rgba(255, 255, 255, 0.15);
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--sun);
  opacity: .18;
  filter: blur(20px);
}
.hero .meta { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero .big {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  color: var(--brand);
  margin-top: 4px;
}
.hero.over .big { color: #ef4444; }
.bar {
  height: 12px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 16px;
}
.bar > div { height: 100%; background: linear-gradient(90deg, var(--mint), #34d399); border-radius: 6px; }
.hero.over .bar > div { background: #ef4444; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; font-weight: 700; }
.facts span {
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.note {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--sun-soft);
  color: var(--sun-ink);
}
.note.warn { background: var(--sun-soft); color: var(--sun-ink); border-color: rgba(245, 158, 11, 0.4); }
.note.bad { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* Store Card & Checkliste */
.store { margin-bottom: 16px; }
.store h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.015em;
}
.store .addr { font-size: 12px; color: var(--muted); margin: 3px 0 12px; font-weight: 500; }
.store .tot {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid rgba(234, 88, 12, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.1);
}

/* Interaktive Zeilen mit Checkbox zum Einkaufen */
.line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  cursor: pointer;
  user-select: none;
  transition: opacity .15s;
}
.line.done {
  opacity: 0.45;
}
.line.done .l .name {
  text-decoration: line-through;
}
.check-box {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 8px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .18s, border-color .18s;
}
.line.done .check-box {
  background: var(--mint);
  border-color: var(--mint);
}
.check-box svg { width: 14px; height: 14px; stroke-width: 2.6; stroke: currentColor; fill: none; }

.line .l { flex: 1; min-width: 0; }
.line .l .name { font-weight: 700; font-size: 15px; }
.line .p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.line .p a { color: var(--muted); font-weight: 600; text-decoration: none; }
.line .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 800; }
.line .r small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--field);
  color: var(--muted);
  margin: 3px 4px 0 0;
}
.tag.offer { background: var(--coral-soft); color: var(--coral); }
.tag.own { background: var(--mint-soft); color: var(--mint); }
.disc { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }

details.more { margin-top: 6px; }
details.more summary { font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 4px 0; list-style: none; }
details.more summary::before { content: "+ "; color: var(--brand); font-weight: 800; }
details.more[open] summary::before { content: "− "; }
.alt { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--muted); }

.tablewrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.first { position: sticky; left: 0; background: var(--card-solid); white-space: normal; min-width: 100px; font-weight: 600; }
#map { height: 280px; border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------- Märkte & Rabatte ---------- */
.chaincard {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: opacity .2s, border-color .15s;
}
.chaincard.off { opacity: .55; background: var(--field); }
.chaincard .head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.chaincard .head .nm { flex: 1; min-width: 0; }
.chaincard .head .nm b { display: block; font-weight: 700; font-size: 15px; }
.chaincard .head .nm small { color: var(--muted); font-size: 12px; }
.chaincard .pills { display: flex; gap: 5px; }
.pill {
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  background: var(--sun-soft);
  color: var(--sun-ink);
  white-space: nowrap;
}
.chaincard .body { display: none; padding: 8px 16px 16px; border-top: 1px dashed var(--line); background: var(--field); }
.chaincard.open .body { display: block; }
.chaincard .body input:not(.switch) { background: var(--card-solid); }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; font-weight: 500; }

/* ---------- Bons ---------- */
.filebtn {
  display: block;
  text-align: center;
  border: 2px dashed var(--brand);
  background: var(--brand-soft);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  transition: border-color .15s, background .15s, transform .1s;
}
.filebtn:hover { background: color-mix(in srgb, var(--brand-soft) 80%, white); transform: translateY(-1px); }
.filebtn input { display: none; }
.filebtn.has { border-style: solid; }

.pitem { border-top: 1px dashed var(--line); padding: 12px 0; }
.pitem .top2 { display: flex; gap: 8px; align-items: center; }
.pitem .top2 input[type=text] { flex: 1; min-width: 0; }
.pitem .row3 { display: grid; grid-template-columns: 1fr 1fr 78px; gap: 6px; margin-top: 6px; }
.pitem input[type=checkbox]:not(.switch) { width: 22px; height: 22px; min-height: 22px; accent-color: var(--brand); }

.mprice { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px dashed var(--line); }
.mprice .l { flex: 1; min-width: 0; }
.mprice .l div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mprice .l .muted { font-weight: 500; }
.mprice .r { font-weight: 800; font-variant-numeric: tabular-nums; }
.mprice button { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; color: var(--muted); }

.plainlist { padding-left: 20px; margin: 0 0 10px; }
.plainlist li { margin-bottom: 6px; }

/* ---------- Sheet & Modals ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 640px;
  margin: 0 auto;
  background: var(--card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  border-radius: 32px 32px 0 0;
  padding: 14px 20px calc(20px + var(--safe-b));
  max-height: 90vh;
  overflow-y: auto;
  animation: up .22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -12px 45px rgba(0,0,0,.2);
}
.sheet-body::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--line);
  margin: 0 auto 14px;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }

/* ---------- Auth View ---------- */
.auth {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 20px 40px;
  background: var(--bg-gradient);
}
.auth[hidden] { display: none; }
.auth-box {
  width: 100%;
  max-width: 390px;
  text-align: center;
  background: var(--card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 28px 22px;
  box-shadow: var(--shadow-lg);
}
.auth-box form { text-align: left; margin-top: 10px; }
.auth-logo { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 14px 35px rgba(234, 88, 12, 0.25); margin-bottom: 16px; }
.auth h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.auth .muted { margin: 4px 0 20px; }
.auth .field input { background: var(--field); }
button.link { background: none; color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 10px; min-height: 40px; }
button.link:hover { color: var(--brand); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--safe-b) + 95px);
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: opacity .2s, transform .2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 90vw;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
