/* zeelbase – gemeinsames Design (dunkel, Schwarz/Dunkelblau, Akzent Elektro-Cyan) */
:root {
  color-scheme: dark;
  --bg: #03060f;
  --bg2: #070d1f;
  --panel: #0b1530;
  --panel2: #102046;
  --line: #1d3266;
  --line2: #2a4688;
  --text: #e8eeff;
  --muted: #9aaad0;
  --dim: #6b7aa3;
  --acc: #3ee0ff;
  --acc2: #2fc8f0;
  --acc-ink: #03111a;
  --ok: #3ddc97;
  --warn: #ffcc4d;
  --bad: #ff6b6b;
  --r: 16px;
  --r-s: 10px;
  --schatten: 0 10px 30px #0009;
  --kopf: 58px;
  font-synthesis: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1100px 700px at 15% -10%, #12285e 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--acc); text-decoration: none; }
h1, h2, h3, .titel { font-family: "Avenir Next", -apple-system, "SF Pro Display", sans-serif; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 24px; margin: 4px 0 14px; }
h2 { font-size: 18px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 8px; color: #cfe0ff; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.klein { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rechts { text-align: right; }
.zentriert { text-align: center; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .acc { color: var(--acc); }
.versteckt { display: none !important; }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 20;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #03060fee 60%, #03060f00);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.kopf .marke { display: flex; align-items: center; gap: 9px; font: 600 19px "Avenir Next", -apple-system, sans-serif; letter-spacing: .03em; color: var(--text); }
.kopf .marke img { width: 32px; height: 32px; }
.kopf .zurueck { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); border: 1px solid var(--line); background: #0b153099; }
.kopf .seitentitel { font: 600 17px "Avenir Next", -apple-system, sans-serif; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .rund { padding: 0; min-height: 0; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; color: var(--acc); background: #0b153099; cursor: pointer; }
.kopf .rund.an { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.flex1 { flex: 1; }

.seite { max-width: 1180px; margin: 0 auto; padding: 4px 16px 90px; }
.seite.schmal { max-width: 720px; }

/* Leisten */
.leiste { border-radius: 12px; padding: 9px 12px; margin: 0 0 10px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.leiste.warn { background: #2a1f08; border: 1px solid #6a4a1a; color: #ffd27a; }
.leiste.bad { background: #2b0d12; border: 1px solid #7a2533; color: #ffb3bd; }
.leiste.info { background: #0b2238; border: 1px solid #1d4a70; color: #bfe9ff; }
.leiste.ok { background: #0b2a22; border: 1px solid #1d6a50; color: #b5f5da; }
.leiste .flex1 { flex: 1; }
.leiste button { flex: none; }

/* Fehlerleiste unten (immer sichtbar bis geschlossen) */
.fehlerleiste { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 100; max-width: 720px; margin: 0 auto;
  background: #3a0f17; border: 1px solid #b23a4c; color: #ffe1e6; border-radius: 14px; padding: 12px 14px; box-shadow: var(--schatten); }
.fehlerleiste b { display: block; margin-bottom: 2px; }
.fehlerleiste .zeile { display: flex; gap: 8px; margin-top: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90;
  background: #0d2a3a; border: 1px solid #2a7aa0; color: #d9f6ff; border-radius: 99px; padding: 9px 18px; box-shadow: var(--schatten); font-size: 14px; white-space: nowrap; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .kacheln { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .kacheln { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1150px) { .kacheln { grid-template-columns: repeat(5, 1fr); } }
.kachel {
  position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; padding: 14px; color: var(--text);
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(155deg, #132a5c 0%, #0a1534 55%, #060b1c 100%);
  border: 1px solid #1d3570; box-shadow: inset 0 1px 0 #ffffff10; transition: transform .12s ease, border-color .12s;
}
.kachel:active { transform: scale(.98); }
@media (hover: hover) { .kachel:hover { border-color: #2f5bb0; } }
.kachel::after { content: ""; position: absolute; inset: 0; background: radial-gradient(140px 90px at 85% 0%, #3ee0ff22, transparent 70%); pointer-events: none; }
.kachel b { font: 600 17px "Avenir Next", -apple-system, sans-serif; position: relative; z-index: 1; }
.kachel small { display: block; color: #9fb3e0; font-size: 12.5px; margin-top: 2px; position: relative; z-index: 1; min-height: 1.2em; }
.kachel .bild { position: absolute; top: 14px; left: 14px; right: 14px; height: 56%; display: flex; align-items: center; justify-content: center; color: var(--acc); }
.kachel .bild svg { width: 56px; height: 56px; filter: drop-shadow(0 0 8px #3ee0ff66); }
.kachel .abzeichen { position: absolute; top: 11px; left: 11px; z-index: 2; font-size: 11.5px; font-weight: 700; background: var(--acc); color: var(--acc-ink); border-radius: 99px; padding: 1px 8px; }
.kachel .abzeichen.bad { background: var(--bad); color: #fff; }
.facher { position: relative; width: 120px; height: 100%; }
.facher img { position: absolute; bottom: 0; width: 62px; border-radius: 4px; box-shadow: 0 4px 10px #000a; background: #0a1534; aspect-ratio: 63/88; object-fit: cover; }
.facher img:nth-child(1) { left: 2px; transform: rotate(-14deg); }
.facher img:nth-child(2) { left: 29px; bottom: 6px; z-index: 2; }
.facher img:nth-child(3) { left: 56px; transform: rotate(14deg); }
.ampelzahl { display: flex; gap: 7px; }
.ampelzahl span { display: flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 99px; font: 700 12.5px sans-serif; color: #03060f; }

/* Panels, Formulare */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 12px; }
.panel.glanz { background: linear-gradient(180deg, #0f2147, #0b1530); }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.raster3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .raster3 { grid-template-columns: 1fr 1fr; } }
label.feld { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
label.feld > span { display: block; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #060c1f; border: 1px solid var(--line2);
  border-radius: var(--r-s); padding: 10px 12px; outline: none; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px #3ee0ff26; }
input.fehlerhaft { border-color: var(--bad); }
input[type=checkbox] { width: 20px; height: 20px; padding: 0; border-radius: 6px; flex: none; position: relative; cursor: pointer; }
input[type=checkbox]:checked { background: var(--acc); border-color: var(--acc); }
input[type=checkbox]:checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--acc-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.haken { display: flex; gap: 9px; align-items: center; font-size: 15px; color: var(--text); cursor: pointer; padding: 6px 0; }

button, .knopf {
  font: 600 15px -apple-system, sans-serif; border-radius: 12px; padding: 10px 16px; border: 1px solid var(--line2); cursor: pointer;
  background: #0f1f45; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; text-decoration: none;
}
button:disabled { opacity: .45; cursor: default; }
button.haupt, .knopf.haupt { background: linear-gradient(180deg, #4ee6ff, #22bfe8); color: var(--acc-ink); border-color: #6aeaff; box-shadow: 0 4px 16px #3ee0ff33; }
button.gefahr { background: #3a0f17; border-color: #8a2a3a; color: #ffc7cf; }
button.leise { background: transparent; border-color: transparent; color: var(--acc); padding: 8px 10px; }
button.klein, .knopf.klein { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.knopfreihe.voll > * { flex: 1; }
.segment { display: inline-flex; background: #060c1f; border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.segment button { min-height: 34px; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.segment button.an { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.chip.acc { border-color: #2a7aa0; color: #bfefff; background: #0b2a3e; }
.chip.ok { border-color: #1d6a50; color: #b5f5da; background: #0b2a22; }
.chip.warn { border-color: #6a4a1a; color: #ffd27a; background: #2a1f08; }
.chip.bad { border-color: #7a2533; color: #ffb3bd; background: #2b0d12; }

/* Ampelpunkt */
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.punkt.gruen { background: var(--ok); box-shadow: 0 0 6px #3ddc9799; }
.punkt.gelb { background: var(--warn); box-shadow: 0 0 6px #ffcc4d99; }
.punkt.rot { background: var(--bad); box-shadow: 0 0 6px #ff6b6b99; }
.punkt.grau { background: #56618a; }

/* Kartenraster und Listen */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .raster { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.karte { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--text); display: flex; flex-direction: column; position: relative; }
.karte .kbild { aspect-ratio: 63/88; background: #060c1f; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.karte .kbild img { width: 100%; height: 100%; object-fit: contain; }
.karte .kinfo { padding: 8px 10px 10px; font-size: 13px; }
.karte .kname { font-weight: 600; font-size: 14px; line-height: 1.25; }
.karte .kpreis { font: 600 16px -apple-system, sans-serif; margin-top: 4px; font-variant-numeric: tabular-nums; }
.karte .kchips { position: absolute; top: 7px; left: 7px; right: 7px; display: flex; gap: 4px; flex-wrap: wrap; }
.karte .kchips .chip { background: #03060fcc; backdrop-filter: blur(4px); }
.platzhalter { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--dim); font-size: 12px; text-align: center; padding: 10px;
  background: repeating-linear-gradient(135deg, #0a1430, #0a1430 10px, #0b1736 10px, #0b1736 20px); }

.liste { display: flex; flex-direction: column; gap: 8px; }
.zeile { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; color: var(--text); }
.zeile .mini { width: 44px; aspect-ratio: 63/88; border-radius: 4px; overflow: hidden; background: #060c1f; flex: none; }
.zeile .mini img { width: 100%; height: 100%; object-fit: cover; }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .haupt .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .haupt .u { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th, table.tab td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tab th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tabrahmen { overflow-x: auto; }

/* Modal */
.huelle { position: fixed; inset: 0; z-index: 80; background: #000a; display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
@media (min-width: 700px) { .huelle { align-items: center; } }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px; padding: 16px; box-shadow: var(--schatten); }

/* Ladeanzeige */
.laden { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 30px 0; }
.laden::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--acc); animation: dreh 0.8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Startbildschirm */
.startbild { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(500px 500px at 50% 40%, #11265a, #02040b); transition: opacity .3s; }
.startbild img { width: 110px; height: 110px; animation: puls 1.6s ease-in-out infinite; }
.startbild .wort { font: 600 22px "Avenir Next", -apple-system, sans-serif; letter-spacing: .08em; color: #cfe0ff; }
.startbild .balken { width: 90px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); background-size: 200% 100%; animation: lauf 1.2s linear infinite; }
@keyframes puls { 50% { filter: drop-shadow(0 0 18px #3ee0ff88); transform: scale(1.03); } }
@keyframes lauf { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.diskret { letter-spacing: .1em; color: var(--dim); }
.leer { text-align: center; color: var(--muted); padding: 40px 10px; }
.leer svg { width: 54px; height: 54px; color: var(--line2); margin-bottom: 8px; }
hr.trenner { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.preisgitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.preisfeld { background: #060c1f; border: 1px solid var(--line2); border-radius: 12px; padding: 9px 11px; }
.preisfeld .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.preisfeld input { border: 0; padding: 2px 0; background: transparent; font: 600 19px -apple-system, sans-serif; font-variant-numeric: tabular-nums; box-shadow: none; }
.preisfeld input:focus { box-shadow: none; }
.preisfeld.fokus { border-color: var(--acc); }
.klein-eingabe{padding:6px 8px;font-size:15px;min-width:0}

/* Bildrahmen: Bild füllt den Rahmen ohne Verzerrung */
.bildrahmen { aspect-ratio: 63/88; border-radius: 14px; overflow: hidden; background: #060c1f; border: 1px solid var(--line); }
.bildrahmen > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mini > img, .kbild > img { image-orientation: from-image; }
.bilanz-betrag { font: 700 24px -apple-system, sans-serif !important; text-align: center; font-variant-numeric: tabular-nums; }
.bilanz-betrag.ok { color: var(--ok); } .bilanz-betrag.warn { color: var(--warn); }

/* "Deine Zahlen" in der Deal-Theke: nebeneinander auf breiten, untereinander auf schmalen Bildschirmen */
.zahlen-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.zahlen-raster table.tab { table-layout: fixed; }
.zahlen-raster td { overflow-wrap: anywhere; }
.zahlen-raster td.rechts { width: 42%; white-space: nowrap; }
.klein-eingabe.fest { border-color: var(--acc); }
