:root {
  --primary: #d61313;
  --primary-dark: #a30e0e;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e2e4e8;
  --danger: #d32f2f;
  --success: #2e7d32;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: env(safe-area-inset-top) 8px 0 8px;
  min-height: calc(56px + env(safe-area-inset-top));
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* Online/Offline-Pill am Settings-Zahnrad — oben rechts, gleiche Größe wie .badge */
.online-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4caf50;            /* online = grün */
  transition: background 0.2s;
  pointer-events: none;
}
.online-dot.offline {
  background: #f44336;            /* offline = rot */
}

/* Rechte Header-Gruppe: Settings + … + Cart, rechtsbündig */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Cart-Picker-Dropdown (Test) — Liste der Carts unter dem Header */
.cart-picker-panel {
  position: fixed;
  top: calc(56px + env(safe-area-inset-top));
  right: 8px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  min-width: 220px;
  max-width: 80vw;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.cart-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}
.cart-picker-item:active { background: var(--bg); }
.cart-picker-item.active {
  font-weight: 700;
  background: rgba(214, 19, 19, 0.08);
  color: var(--primary);
}
.cart-picker-item.add {
  color: var(--primary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 12px;
  font-weight: 600;
}
.cpi-name { flex: 1; }
.cpi-count {
  background: var(--text-muted);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 16px;
  border-radius: 10px;
  padding: 0 6px 1px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-picker-item.active .cpi-count { background: var(--primary); }

/* Update-Banner (oberhalb des Headers wenn neuer SW verfügbar) */
.update-banner {
  background: var(--primary-dark);
  color: #fff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.btn-update {
  background: #fff;
  color: var(--primary);
  border: 0;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.btn-update:active { background: #e0eaf5; }
.icon-btn {
  position: relative;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 6px 6px;
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:active { background: rgba(255,255,255,.15); }
.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Main + Screens */
main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.screen { padding: 16px; }

/* Scanner-Screen als flex-Column: Suchbar oben, Kamera füllt Rest, Trefferliste klappt rein */
#screenScanner {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.scanner-container {
  flex: 1;
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  min-height: 0;
}
#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.btn-torch {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}
.btn-torch svg { width: 22px; height: 22px; }
.btn-torch.is-on { background: #f9a825; color: #1a1a1a; }
.btn-torch:active { transform: scale(0.94); }
.scan-frame {
  width: 75%;
  aspect-ratio: 2/1;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}
.scan-hint {
  margin-top: 16px;
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  white-space: pre-line;     /* \n als echten Zeilenumbruch rendern */
  max-width: 90%;
}
.scan-hint.error {
  background: var(--danger);
  font-weight: 700;
}
/* Such-Bar im Scanner-Screen (oben fix) */
.search-bar {
  flex-shrink: 0;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.search-input-wrap {
  position: relative;
}
.search-input-wrap input {
  width: 100%;
  padding-right: 38px;   /* Platz für das X */
}
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--text-muted);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 2px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:active { background: var(--text); }
/* X nur zeigen wenn das Input einen Wert hat (Placeholder dann nicht sichtbar). */
.search-input-wrap input:placeholder-shown + .search-clear {
  display: none;
}

/* Wenn gesucht wird, Kamera ausblenden — die Trefferliste übernimmt den Platz. */
#screenScanner.searching .scanner-container { display: none; }
#screenScanner.searching .search-results {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.search-hint { flex-shrink: 0; }
.search-results { flex-shrink: 0; }
.search-bar input {
  width: 100%;
  font-size: 16px;
}
.search-hint {
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Trefferliste */
.search-results {
  display: flex;
  flex-direction: column;
}
.search-result {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto;
  grid-template-rows: auto auto auto;
  gap: 2px 12px;
  align-items: center;
  text-align: left;
  background: var(--card);
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.sr-fav {
  grid-column: 4;
  grid-row: 2 / 4;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 0;
  cursor: pointer;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sr-fav svg { width: 22px; height: 22px; transition: color 0.15s; }
.sr-fav.is-favorite { color: #f9a825; }
.search-result:active { background: #eef3fa; }
.sr-img {
  grid-column: 1;
  grid-row: 1 / 4;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #f0f2f5;
  border-radius: 6px;
}
.sr-name {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
  line-height: 1.25;
}
.sr-desc {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.sr-desc:empty { display: none; }
.sr-meta {
  grid-column: 2;
  grid-row: 3;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}
.sr-brand { font-weight: 600; color: var(--text); }
.sr-brand:empty { display: none; }
.sr-sku,
.sr-barcode { font-weight: 500; }
.sr-price {
  grid-column: 3 / 6;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
}
.sr-add {
  grid-column: 5;
  grid-row: 2 / 4;
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 1px 0 0 0;
  margin-left: 4px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sr-add:active { background: var(--primary-dark); }

/* Forms */
label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}
textarea { resize: vertical; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { background: #b0bec5; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-secondary:active { background: #eef3fa; }
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.actions .btn { flex: 1; }

/* Produkt-Karte */
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.product-image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f2f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}
.product-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.product-card h2 { margin: 0; font-size: 20px; flex: 1; }
.product-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}
.btn-favorite {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.btn-favorite svg {
  width: 26px;
  height: 26px;
  transition: color 0.15s;
}
.btn-favorite.is-favorite {
  color: #f9a825;
}
.btn-favorite.is-favorite svg {
  fill: #f9a825;
  stroke: #f9a825;
}
.product-shortdesc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  line-height: 1.35;
}
.product-shortdesc:empty { display: none; }
.product-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.product-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pm-brand { font-weight: 600; color: var(--text); }
.pm-brand:empty,
.pm-sku:empty,
.pm-barcode:empty { display: none; }
.pm-sku,
.pm-barcode { font-weight: 500; }

/* Qty */
.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.qty-btn:active { background: #eef3fa; }
.qty-control input {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

/* Mengen-Quick-Buttons (1, 5, 10, 24) im Produkt-Dialog */
.qty-quick {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.qty-quick button {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.qty-quick button:active { background: #eef3fa; }

/* Warenkorb-Screen als Flex-Column:
   - Tabs oben fix
   - Cart-Header + Items scrollen zusammen (im .cart-scroll-Container)
   - Footer immer unten fix */
#screenCart {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100%;
}
.cart-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 16px;
}

.cart-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 4px;
  background: var(--bg);
}
.cart-tab {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.cart-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.cart-tab-add {
  font-size: 18px;
  font-weight: 700;
  padding: 4px 12px;
  color: var(--primary);
}

.cart-header {
  background: var(--card);
  padding: 10px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 8px 0 10px;
}
.cart-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-name {
  flex: 1;
  background: transparent;
  border: 1px dashed transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 6px;
  border-radius: 6px;
}
.cart-name:hover {
  border-color: var(--border);
}
.cart-name:focus {
  outline: none;
  background: #fff;
  border: 1px solid var(--primary);
}
.cart-delete {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.cart-delete:not(:disabled):active { color: var(--danger); }
.cart-delete:disabled { opacity: 0.3; cursor: not-allowed; }
.cart-header .toggle-row { padding: 8px 0 0; }
.cart-mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.cart-mode-row .toggle-row { flex: 1; padding: 0; }
.btn-sm {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 13px;
}
.cart-comment {
  width: 100%;
  margin-top: 10px;
  resize: vertical;
  min-height: 40px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
}
.cart-comment:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  background: #fff;
  border-style: solid;
  border-color: var(--primary);
}
.cart-comment::placeholder { font-style: italic; color: var(--text-muted); }

/* Bestellhistorie */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}
.history-entry {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.he-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.he-id     { font-weight: 700; color: var(--primary); font-size: 15px; }
.he-date   { font-size: 12px; color: var(--text-muted); }
.he-summary{ font-weight: 600; }
.he-cart   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.he-comment{ margin-top: 6px; font-style: italic; color: var(--text-muted); font-size: 13px; }
.he-positions {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.he-position {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto;
  grid-template-rows: auto auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.he-position:last-child { border-bottom: 0; }
.he-position.inactive { opacity: 0.55; }
.he-position.inactive .hep-name { text-decoration: line-through; }
.hep-img {
  grid-column: 1;
  grid-row: 1 / 4;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #f0f2f5;
  border-radius: 6px;
}
.hep-name {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
}
.hep-desc {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}
.hep-desc:empty { display: none; }
.hep-meta {
  grid-column: 2;
  grid-row: 3;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}
.hep-brand { font-weight: 600; color: var(--text); }
.hep-brand:empty { display: none; }
.hep-sku,
.hep-barcode { font-weight: 500; }
.hep-qty {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}
.hep-price {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  width: 90px;
  text-align: right;
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
}
.hep-add {
  grid-column: 5;
  grid-row: 0 / 4;
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 1px 0 0 0;
  margin-left: 4px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hep-add:active { background: var(--primary-dark); }
.hep-add[disabled] {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}
.he-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.he-actions .btn { flex: 1; padding: 8px 12px; min-height: 36px; font-size: 13px; }

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 2px 12px;
  align-items: center;
}
.cart-item img {
  grid-row: 1 / 4;
  grid-column: 1;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #f0f2f5;
  border-radius: 6px;
  cursor: pointer;
}
.cart-item .ci-name { grid-column: 2; grid-row: 1; font-weight: 600; cursor: pointer; font-size: 14px }
.cart-item .ci-name:active,
.cart-item img:active { opacity: 0.7; }
.cart-item .ci-desc { grid-column: 2; grid-row: 2; font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.cart-item .ci-desc:empty { display: none; }
.cart-item .ci-meta { grid-column: 2; grid-row: 3; font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; }
.cart-item .ci-price {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.cart-item .ci-brand { font-weight: 600; color: var(--text); }
.cart-item .ci-sku,
.cart-item .ci-barcode { font-weight: 500; }
.cart-item .ci-bottom-row {
  grid-column: 1 / 4;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.cart-item .ci-bottom-row .ci-note { flex: 1; margin-top: 0; }
.cart-item .ci-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cart-item .ci-note {
  grid-column: 1 / 3;
  width: 100%;
  min-height: 28px;
  resize: vertical;
  padding: 4px 6px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  margin-top: 4px;
}
.cart-item .ci-note::placeholder {
  font-style: italic;
  color: var(--text-muted);
}
.cart-item .ci-note:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  background: #fff;
  border-style: solid;
  border-color: var(--primary);
}
.cart-item .ci-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cart-item .ci-qty button {
  width: 28px; height: 28px;
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  font-size: 17px; font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0 0 0;            /* oberer Padding zieht den Glyph optisch tiefer in die Mitte */
  line-height: 1;
  box-sizing: border-box;
}
.cart-item .ci-qty input {
  width: 48px; height: 28px;
  text-align: center;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
}
.cart-item .ci-remove {
  background: transparent; border: 0; color: var(--danger);
  font-size: 18px; cursor: pointer; padding: 2px 6px;
}
.cart-summary {
  background: var(--card);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

/* Footer im Cart: immer am unteren Rand des Cart-Screens (via flex-column) */
.cart-footer {
  flex-shrink: 0;
  background: var(--card);
  margin: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.06);
}
.cart-footer .cart-summary {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0 0 6px;
  margin: 0;
}
.cart-footer .info-banner {
  margin: 8px 0;
}
.cart-footer .actions {
  margin-top: 8px;
}

/* Form (Login + andere) */
.form { background: var(--card); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Favoriten-Screen — Sektions-Überschriften */
.fav-section-title {
  margin: 16px 4px 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.fav-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--card);
  border-radius: var(--radius);
}

/* Logo-Block (weißes Logo auf dunkelgrauem Hintergrund) */
.logo-block {
  background: #343d45;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.logo-block img {
  display: inline-block;
  max-width: 70%;
}
.logo-block.large { padding: 28px 16px; }
.logo-block.large img { max-height: 110px; }
.logo-block.small { padding: 14px 16px; }
.logo-block.small img { max-height: 50px; }

/* Tagline unter dem Logo — Favicon links + Name rechts */
.logo-tagline {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 10px;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.logo-favicon {
  display: inline-block;
  flex-shrink: 0;
}
.logo-block.large .logo-tagline { font-size: 22px; margin-top: 12px; }
.logo-block.large .logo-favicon { width: 28px; height: 28px; }
.logo-block.small .logo-tagline { font-size: 14px; margin-top: 6px; }
.logo-block.small .logo-favicon { width: 20px; height: 20px; }

/* Block-Button (volle Breite, z.B. Login + Sync) */
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:active { background: #a01818; }

/* Card-Sektion in den Settings */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
}
.kv:last-of-type { border-bottom: 0; }
.kv span:first-child { color: var(--text-muted); }
.kv span:last-child  { font-weight: 600; word-break: break-all; text-align: right; }

.muted { color: var(--text-muted); font-size: 13px; margin: 0 0 8px; }

/* Toggle-Reihe (Switch + Label) */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

/* iOS-Style Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #ccd0d6;
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}
.switch-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .switch-slider {
  background: var(--primary);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}
.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Hinweisbanner im Warenkorb (Order deaktiviert) */
.info-banner {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0 0;
  font-size: 13px;
}

/* Loading-Overlay (Sync, Login, andere Async-Calls) */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-text {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  max-width: 80%;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  max-width: 90%;
  z-index: 100;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.info { background: #1976d2; }   /* eigener Info-Blau, unabhängig vom Brand-Rot */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: inherit;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.toast-action:active { background: rgba(255, 255, 255, 0.2); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
