/* TCG Collection – Gestaltung nach dem abgestimmten Entwurf */
/* TCG Collection – Farbschemata (pro Profil wählbar: Schema + Dunkel/Hell/Gerät) */

/* Schrift: Manrope wird von assets/boot.js nur geladen, wenn die Datei in assets/fonts liegt (siehe LIESMICH dort). */

:root {
  --radius: 16px;
  font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --knob: #FFFFFF;
}

/* ---------- Atlantik Petrol · dunkel (Standard) ---------- */
:root, html[data-theme="atlantik"][data-mode="dark"] {
  color-scheme: dark;
  --ground: #0D1A1F; --surface: #132329; --soft: #1A2E35; --chip: #1A2E35; --chip-ink: #DCE7E9;
  --ink: #E6EEF0; --muted: #8FA6AC; --line: #25404A; --field: #2C4A55; --seg-ink: #B5C6CA;
  --accent: #55B9C4; --accent-ink: #06222A; --accent-soft: #123842; --info-ink: #BFE7EB;
  --us: #C9AE80; --us-line: #C9AE80; --up: #6CC4A4; --down: #E07A61;
  --gold: #C9AE80; --gold-ink: #2A2112; --grade-bg: #123842; --grade-ink: #7FD1D9;
  --hero: #123A43; --hero-text: #E6EEF0; --hero-muted: #9EC3C9; --chart-hero: #7FD9E0;
  --badge-up-bg: #1E4B45; --badge-up-ink: #8FE3C3; --badge-down-bg: #4A2A22; --badge-down-ink: #F4B19E; --badge-flat-bg: #1F3A40; --badge-flat-ink: #B5CDD1;
  --grid: #22383F; --switch-off: #36545E; --nav-bg: #0F1E23;
  --toast-bg: #E6EEF0; --toast-ink: #0D1A1F; --toast-err: #9A3E2B;
  --remove-bg: #3A2420; --tip-bg: #2A2618; --tip-ink: #E9D9B5; --dot-part: #C9AE80; --dot-none: #3A5560;
  --band-1: #123A43; --band-2: #2E7D8C; --band-3: #3E5F70; --band-4: #6A5A4C; --band-5: #24505A; --band-6: #4B5D66;
}

/* ---------- Atlantik Petrol · hell ---------- */
html[data-theme="atlantik"][data-mode="light"] {
  color-scheme: light;
  --ground: #F2F6F6; --surface: #FFFFFF; --soft: #EAF1F2; --chip: #E6EEF0; --chip-ink: #22383E;
  --ink: #22383E; --muted: #5F7477; --line: #D9E4E5; --field: #C9D7D9; --seg-ink: #4E6265;
  --accent: #2E7D8C; --accent-ink: #FFFFFF; --accent-soft: #DCEEF0; --info-ink: #154550;
  --us: #8C6E3C; --us-line: #B89A62; --up: #2C7A5C; --down: #B95440;
  --gold: #8C6E3C; --gold-ink: #FFFFFF; --grade-bg: #DCEEF0; --grade-ink: #1F5F6B;
  --hero: #123A43; --hero-text: #EAF3F4; --hero-muted: #A7C8CD; --chart-hero: #7FD9E0;
  --badge-up-bg: #1E4B45; --badge-up-ink: #8FE3C3; --badge-down-bg: #4A2A22; --badge-down-ink: #F4B19E; --badge-flat-bg: #22474F; --badge-flat-ink: #B5CDD1;
  --grid: #E3EBEC; --switch-off: #B9C9CC; --nav-bg: #FFFFFF;
  --toast-bg: #123A43; --toast-ink: #EAF3F4; --toast-err: #9A3E2B;
  --remove-bg: #F8E3DD; --tip-bg: #F6EFE1; --tip-ink: #4A3A1A; --dot-part: #B89A62; --dot-none: #C9D7D9;
  --band-1: #123A43; --band-2: #2E7D8C; --band-3: #3E5F70; --band-4: #7A6450; --band-5: #2B5F69; --band-6: #56686F;
}

/* ---------- Petrol Nacht · dunkel ---------- */
html[data-theme="petrol"][data-mode="dark"] {
  color-scheme: dark;
  --ground: #0C1416; --surface: #132022; --soft: #1A2B2E; --chip: #1A2B2E; --chip-ink: #DDE7E6;
  --ink: #E9F0EF; --muted: #92A7A6; --line: #253A3D; --field: #2E4649; --seg-ink: #B7C8C6;
  --accent: #3BB0A6; --accent-ink: #06201E; --accent-soft: #123A39; --info-ink: #BDE6E1;
  --us: #D7B46A; --us-line: #D7B46A; --up: #5CCB8E; --down: #F0936A;
  --gold: #D7B46A; --gold-ink: #2A2008; --grade-bg: #123A39; --grade-ink: #7FD3CA;
  --hero: #0F2F31; --hero-text: #E9F0EF; --hero-muted: #9DC2BE; --chart-hero: #5FD0C5;
  --badge-up-bg: #1C4A3A; --badge-up-ink: #8FE3B8; --badge-down-bg: #4A2A1E; --badge-down-ink: #F7B597; --badge-flat-bg: #1E3A3B; --badge-flat-ink: #B5CFCB;
  --grid: #213335; --switch-off: #34504F; --nav-bg: #101C1E;
  --toast-bg: #E9F0EF; --toast-ink: #0C1416; --toast-err: #9A3E2B;
  --remove-bg: #3A2620; --tip-bg: #2A2618; --tip-ink: #EBD9B0; --dot-part: #D7B46A; --dot-none: #36504F;
  --band-1: #0E5E62; --band-2: #1F4E5F; --band-3: #3A5243; --band-4: #5B4A3A; --band-5: #2C5A57; --band-6: #45555C;
}

/* ---------- Petrol Hell ---------- */
html[data-theme="petrol"][data-mode="light"] {
  color-scheme: light;
  --ground: #F3F5F4; --surface: #FFFFFF; --soft: #EDF2F1; --chip: #E6EDEC; --chip-ink: #14201F;
  --ink: #14201F; --muted: #56676A; --line: #DCE3E2; --field: #C8D3D2; --seg-ink: #4B5B5D;
  --accent: #0B6E6E; --accent-ink: #FFFFFF; --accent-soft: #DDEEED; --info-ink: #0B4A4A;
  --us: #8A6A1C; --us-line: #B8964A; --up: #1E7F4F; --down: #B4501E;
  --gold: #8A6A1C; --gold-ink: #FFFFFF; --grade-bg: #DDEEED; --grade-ink: #0B5A5A;
  --hero: #0E3B3D; --hero-text: #EAF3F2; --hero-muted: #A9CBC7; --chart-hero: #6FD3C8;
  --badge-up-bg: #1C4A3A; --badge-up-ink: #8FE3B8; --badge-down-bg: #4A2A1E; --badge-down-ink: #F7B597; --badge-flat-bg: #1E4446; --badge-flat-ink: #B5CFCB;
  --grid: #E4EAE9; --switch-off: #B8C6C5; --nav-bg: #FFFFFF;
  --toast-bg: #0E3B3D; --toast-ink: #EAF3F2; --toast-err: #9A3E2B;
  --remove-bg: #F6E3DA; --tip-bg: #F6EFE1; --tip-ink: #4A3A1A; --dot-part: #B8964A; --dot-none: #C8D3D2;
  --band-1: #0B6E6E; --band-2: #2E5566; --band-3: #4D6150; --band-4: #7A5E43; --band-5: #2F6A66; --band-6: #56686F;
}

/* ---------- Petrol Nacht × Atlantik · dunkel (hell = Atlantik Petrol hell) ---------- */
html[data-theme="mix"][data-mode="dark"] {
  color-scheme: dark;
  --ground: #0C1416; --surface: #132022; --soft: #1A2B2E; --chip: #1A2B2E; --chip-ink: #DDE7E6;
  --ink: #E9F0EF; --muted: #92A7A6; --line: #253A3D; --field: #2E4649; --seg-ink: #B7C8C6;
  --accent: #55B9D1; --accent-ink: #07202A; --accent-soft: #14343F; --info-ink: #C2E6F0;
  --us: #D3B27A; --us-line: #D3B27A; --up: #5CCB8E; --down: #D96B52;
  --gold: #D3B27A; --gold-ink: #2A2008; --grade-bg: #14343F; --grade-ink: #8FD3E4;
  --hero: #172C46; --hero-text: #EDF2F8; --hero-muted: #A9BBD3; --chart-hero: #6FC8DE;
  --badge-up-bg: #1C4A3A; --badge-up-ink: #8FE3B8; --badge-down-bg: #4A2620; --badge-down-ink: #F2A795; --badge-flat-bg: #22344D; --badge-flat-ink: #B9C7DA;
  --grid: #213335; --switch-off: #34504F; --nav-bg: #101C1E;
  --toast-bg: #EDF2F8; --toast-ink: #0C1416; --toast-err: #9A3E2B;
  --remove-bg: #3A2420; --tip-bg: #2A2618; --tip-ink: #EBD9B0; --dot-part: #D3B27A; --dot-none: #36504F;
  --band-1: #172C46; --band-2: #0E5E62; --band-3: #2F5F8F; --band-4: #5B4A3A; --band-5: #24505A; --band-6: #3D4F66;
}

body { background: var(--ground); color: var(--ink); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }

.shell { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 1 auto; padding: 20px 20px calc(100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.loading { color: var(--muted); text-align: center; margin-top: 40vh; }

/* Navigation */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--nav-bg); border-top: 1px solid var(--line);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); z-index: 10; }
.nav-inner { max-width: 520px; margin: 0 auto; }
.nav button { border: none; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 52px; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; padding: 0; }
.nav button[aria-current="page"] { color: var(--accent); }
@media (min-width: 560px) { .nav { left: 50%; transform: translateX(-50%); max-width: 520px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* Allgemein */
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.title { font-size: 26px; font-weight: 700; }
.h2 { font-size: 18px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; }
.sep { height: 1px; background: var(--line); }
.up { color: var(--up); }
.down { color: var(--down); }
.empty { background: var(--surface); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* Buttons */
.btn { height: 48px; border-radius: 14px; border: none; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; padding: 0 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { height: 44px; border-radius: 12px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); font-size: 14px; font-weight: 600; padding: 0 14px; }
.btn-soft { height: 44px; border-radius: 12px; border: none; background: var(--soft); color: var(--ink); font-size: 14px; font-weight: 500; padding: 0 14px; }
.btn-dashed { height: 48px; border-radius: 14px; border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; }
.btn-danger { height: 44px; border-radius: 12px; border: 1.5px solid var(--down); background: var(--surface); color: var(--down); font-size: 14px; font-weight: 600; padding: 0 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fab { width: 48px; height: 48px; border-radius: 24px; border: none; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Chips */
.chip { font-size: 11px; font-weight: 600; background: var(--chip); color: var(--chip-ink); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.chip.grade { background: var(--grade-bg); color: var(--grade-ink); }
.chip.first { background: var(--gold); color: var(--gold-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Pills & Segmente */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--field); background: var(--surface); font-size: 14px; font-weight: 500; }
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--line); padding: 4px; border-radius: 14px; }
.seg button { height: 44px; border: none; border-radius: 10px; background: transparent; color: var(--seg-ink); font-size: 14px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; }
.mini-seg { display: flex; gap: 4px; background: var(--soft); padding: 3px; border-radius: 10px; }
.mini-seg button { height: 32px; min-width: 40px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.mini-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field input, .field select { height: 46px; border-radius: 12px; border: 1.5px solid var(--field); padding: 0 14px; font-size: 16px; background: var(--surface); min-width: 0; width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch-row { width: 100%; border: none; background: transparent; padding: 0; display: flex; justify-content: space-between; align-items: center; min-height: 52px; text-align: left; }
.switch { width: 50px; height: 30px; border-radius: 15px; position: relative; flex: none; background: var(--switch-off); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: var(--knob); transition: left .15s; }
.switch-row[aria-checked="true"] .switch { background: var(--accent); }
.switch-row[aria-checked="true"] .switch::after { left: 23px; }

/* Profil */
.profile-chip { border: none; background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; display: inline-flex; align-items: center; gap: 8px; height: 44px; font-size: 15px; font-weight: 600; }
.avatar { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

/* Gesamtwert */
.hero { background: var(--hero); color: var(--hero-text); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hero .label { font-size: 13px; color: var(--hero-muted); }
.hero .big { font-size: 32px; font-weight: 700; margin-top: 4px; }
.badge-up { background: var(--badge-up-bg); color: var(--badge-up-ink); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.badge-down { background: var(--badge-down-bg); color: var(--badge-down-ink); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.badge-flat { background: var(--badge-flat-bg); color: var(--badge-flat-ink); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }

/* Kartenliste */
.item { border: none; background: var(--surface); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; }
.thumb { width: 48px; height: 67px; border-radius: 5px; object-fit: cover; flex: none; background: var(--chip); }
.thumb-ph { width: 48px; height: 67px; border-radius: 5px; flex: none; background: var(--chip); color: var(--muted); font-size: 10px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; }
.item .mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .name { font-weight: 600; font-size: 15px; }
.item .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .right { text-align: right; flex: none; display: flex; flex-direction: column; gap: 3px; }
.item .price { font-weight: 600; font-size: 15px; }
.item .delta { font-size: 12px; font-weight: 600; }

/* Detail */
.detail-top { display: flex; gap: 16px; align-items: flex-start; }
.detail-img { width: 140px; border-radius: 8px; flex: none; background: var(--chip); aspect-ratio: 600 / 825; object-fit: cover; }
.detail-ph { width: 140px; aspect-ratio: 600 / 825; border-radius: 8px; flex: none; background: var(--chip); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.price-box { background: var(--surface); border-radius: 14px; padding: 14px; }
.price-box .p { font-size: 22px; font-weight: 700; margin-top: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-eu { width: 16px; height: 3px; background: var(--accent); border-radius: 2px; }
.lg-us { width: 16px; height: 0; border-top: 2px dashed var(--us-line); }
.chart { width: 100%; height: auto; display: block; }
.note-row { display: flex; gap: 10px; font-size: 13px; }
.note-row .d { color: var(--muted); flex: none; width: 52px; }

/* Suche */
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.result { border: 2px solid transparent; background: var(--surface); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.result[aria-pressed="true"] { border-color: var(--accent); }
.result img, .result .ph { width: 100%; aspect-ratio: 245 / 337; border-radius: 6px; object-fit: cover; background: var(--chip); }
.result .ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.result .n { font-size: 12px; font-weight: 600; line-height: 1.25; }
.result .s { font-size: 11px; color: var(--muted); line-height: 1.25; }

/* Decks */
.bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.bar > div { height: 8px; border-radius: 4px; background: var(--accent); }
.line { background: var(--surface); border-radius: 14px; padding: 10px 10px 10px 14px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.line .mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line .name { font-size: 15px; font-weight: 600; }
.step { width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--soft); font-size: 20px; font-weight: 500; flex: none; }
.count { width: 40px; text-align: center; font-size: 15px; font-weight: 600; flex: none; }
.deck-tile { border: none; background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }

/* PIN */
.pin-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-top: 40px; }
.dots { display: flex; gap: 16px; }
.dots span { width: 16px; height: 16px; border-radius: 8px; border: 2px solid var(--ink); }
.dots span.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 280px; }
.keypad button { height: 64px; border-radius: 32px; border: none; background: var(--surface); font-size: 24px; font-weight: 500; }
.keypad button.txt { background: transparent; font-size: 15px; }
.shake { animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-tile { border: none; background: var(--surface); border-radius: 18px; padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--toast-bg); color: var(--toast-ink); padding: 12px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 40px); z-index: 20; }
.toast.err { background: var(--toast-err); color: #FFFFFF; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Preis-Check */
.price-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.price-table div { display: flex; flex-direction: column; gap: 2px; }
.price-table .k { font-size: 12px; color: var(--muted); }
.price-table .v { font-size: 17px; font-weight: 700; }
.price-table .v.big { font-size: 22px; color: var(--accent); }
.btn-cm { height: 52px; border-radius: 14px; border: none; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 0 16px; }
.btn-cm:hover { color: var(--accent-ink); }
.info { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.45; color: var(--info-ink); }
.check-head { display: flex; gap: 14px; align-items: flex-start; }
.check-head img, .check-head .thumb-ph { width: 92px; height: auto; aspect-ratio: 600 / 825; border-radius: 6px; flex: none; }

/* ---------- 0.3 ---------- */
.btn-link { border: none; background: none; padding: 0 4px; height: 44px; color: var(--accent); font-size: 15px; font-weight: 500; }

/* Suchfeld mit Leeren-Button */
.search-box { display: flex; align-items: center; gap: 4px; height: 48px; border-radius: 12px; border: 1.5px solid var(--field); background: var(--surface); padding: 0 2px 0 12px; }
.search-box:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.search-box .sb-icon { color: var(--muted); display: flex; flex: none; }
.search-box input { flex: 1 1 auto; min-width: 0; height: 44px; border: none; outline: none; padding: 0 6px; font-size: 16px; background: transparent; }
.search-box button { flex: none; width: 44px; height: 44px; border-radius: 10px; border: none; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.search-box button[hidden] { display: none; }

/* Set-Ordner und Deck-Kacheln */
.folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.folder { border: none; background: var(--surface); border-radius: 16px; padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.folder-band { height: 72px; display: flex; align-items: center; justify-content: center; padding: 10px; width: 100%; }
.folder-logo { max-width: 100%; max-height: 52px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.folder-logo.big { max-height: 64px; max-width: 70%; align-self: flex-start; filter: none; }
.logo-pill { display: inline-block; max-width: 100%; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 800; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.fname { font-size: 15px; font-weight: 600; }
.fbar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; display: block; margin-top: 4px; }
.fbar > span { display: block; height: 6px; border-radius: 3px; }
.folder-head { background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; }
.fh-band { width: 10px; flex: none; }
.deck-band { height: 56px; color: #fff; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 10px 8px; width: 100%; }
.tbadges { display: flex; gap: 4px; }
.tbadge { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.new-deck { border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--accent); min-height: 160px; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }
.bar > div { background: var(--accent); }

/* Deck-Editor */
.sugg { height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.tchip { height: 44px; padding: 0 12px 0 8px; border-radius: 22px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--field); background: var(--surface); }
.tchip[aria-pressed="true"] { font-weight: 600; }
.step.remove { background: var(--remove-bg); color: var(--down); }

/* Profil */
.swatch { width: 44px; height: 44px; border-radius: 22px; border: 3px solid transparent; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--surface); box-shadow: 0 0 0 3px var(--ink); }
.chev { display: flex; color: var(--muted); transition: transform .15s; }
.chev.open { transform: rotate(180deg); }

/* Preis-Check: kompakte Filter */
.filter-head { width: 100%; border: none; background: transparent; padding: 10px 0; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.frow { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.frow > span { width: 74px; flex: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.cseg { flex: 1 1 auto; display: grid; border: 1.5px solid var(--field); border-radius: 12px; overflow: hidden; }
.cseg button { height: 44px; border: none; border-right: 1.5px solid var(--field); background: var(--surface); font-size: 13px; font-weight: 500; padding: 0 2px; }
.cseg button:last-child { border-right: none; }
.cseg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav[hidden] { display: none; }

/* Dunkler Modus: Flächen bekommen eine feine Kante statt Schatten */
html[data-mode="dark"] .card, html[data-mode="dark"] .item, html[data-mode="dark"] .folder, html[data-mode="dark"] .line,
html[data-mode="dark"] .price-box, html[data-mode="dark"] .folder-head, html[data-mode="dark"] .empty,
html[data-mode="dark"] .profile-tile, html[data-mode="dark"] .result { box-shadow: inset 0 0 0 1px var(--line); }
html[data-mode="dark"] .folder.new-deck { box-shadow: none; }
.chart .grid { stroke: var(--grid); }

/* Darstellung im Profil */
.theme-opt { border: 1.5px solid var(--field); background: var(--surface); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 56px; }
.theme-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-sw { display: flex; flex: none; border-radius: 8px; overflow: hidden; }
.theme-sw span { width: 16px; height: 32px; display: block; }

/* Familien-Zugang */
.gate-wrap { max-width: 420px; margin: 0 auto; padding-top: 12vh; display: flex; flex-direction: column; gap: 14px; }

/* Scanner */
.scan-row { display: flex; gap: 8px; align-items: flex-end; }
.scan-row .field { flex: 1; min-width: 0; }
.scan-btn { flex: none; width: 52px; height: 48px; border-radius: 12px; border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.scan-btn svg { width: 24px; height: 24px; }
body.scan-open { overflow: hidden; }
.scan { position: fixed; inset: 0; z-index: 50; background: var(--ground); color: var(--ink); display: flex; flex-direction: column; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
.scan-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.scan-stage { position: relative; flex: 1; min-height: 300px; max-height: 62vh; border-radius: 18px; overflow: hidden; background: #000; }
.scan-stage video, .scan-stage .scan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-stage .scan-photo { object-fit: contain; }
.scan-frame { position: absolute; left: 50%; top: 50%; height: 86%; aspect-ratio: 63 / 88; max-width: 86%; transform: translate(-50%, -50%); border: 3px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); pointer-events: none; }
.scan-frame::before, .scan-frame::after { content: ''; position: absolute; left: 4%; right: 4%; border: 1.5px dashed rgba(255, 255, 255, .7); border-radius: 6px; }
.scan-frame::before { top: 2.5%; height: 9%; }
.scan-frame::after { bottom: 1.5%; height: 11%; }
.scan-msg { position: absolute; inset: auto 16px 16px 16px; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.scan-status { min-height: 20px; color: var(--muted); text-align: center; }
.scan-actions, .scan-result { display: flex; flex-direction: column; gap: 10px; }
.scan-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.scan-file { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.scan [hidden] { display: none !important; }

/* Set-Symbol als Ersatz für fehlende Logos */
.sym-pill { display: inline-flex; align-items: center; gap: 6px; }
.sym-pill img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.folder-symbol { width: 40px; height: 40px; object-fit: contain; align-self: flex-start; }
.logo-btn { display: inline-flex; align-items: center; cursor: pointer; }

/* Eigene Fotos */
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-slot { display: flex; flex-direction: column; gap: 6px; }
.ph-slot img, .ph-empty { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 10px; background: var(--soft); }
.ph-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; border: 1.5px dashed var(--field); }
.ph-actions { display: flex; gap: 6px; }
.ph-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; min-height: 40px; padding: 0 10px; }
.ph-actions .ph-btn:last-child:not(:first-child) { flex: none; width: 44px; }

/* Grading-Check */
.gc-body { display: flex; flex-direction: column; gap: 12px; }
.gc-intro p { margin: 0 0 8px; line-height: 1.5; }
.gc-tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.gc-side { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
html[data-mode="dark"] .gc-side { box-shadow: inset 0 0 0 1px var(--line); }
.gc-side-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gc-side-actions > * { flex: 1; min-width: 140px; }
.gc-file { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.gc-ok { color: var(--up); font-weight: 600; font-size: 14px; }
.gc-hint { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.gc-hint strong { color: var(--ink); }
.gc .gc-stage { position: relative; height: 58vh; min-height: 320px; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 16px; overflow: hidden; touch-action: none; }
.gc-canvas { touch-action: none; cursor: crosshair; }
.gc-lupe { position: absolute; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; }
.gc-live { display: flex; justify-content: space-around; font-size: 15px; }
.gc-grade { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gc-grade:last-of-type { border-bottom: none; }
.gc-grade strong { font-size: 20px; color: var(--accent); }
.gc-lv-ok { color: var(--up); } .gc-lv-minor { color: var(--gold); } .gc-lv-major { color: var(--down); font-weight: 600; }
