:root {
  --navy: #071d33;
  --navy-2: #0b2a47;
  --orange: #f28c00;
  --orange-dark: #d97706;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
}

body.dark {
  --bg: #07111f;
  --card: #0d1b2d;
  --text: #e5eef9;
  --muted: #9fb0c4;
  --line: #1d3049;
  --shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 18px 18px;
  color: white;
  background:
    radial-gradient(circle at 80% 0%, rgba(242, 140, 0, .25), transparent 34%),
    linear-gradient(145deg, var(--navy), var(--navy-2));
  box-shadow: 0 8px 24px rgba(7, 29, 51, .22);
}

.topbar h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -.04em;
  line-height: 1;
}

.topbar h1 span {
  color: var(--orange);
}

.topbar p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
}

.topbar p i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.topbar p.ok i {
  background: var(--ok);
}

.topbar p.err i {
  background: var(--danger);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 19px;
}

main {
  padding: 18px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn .18s ease both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel,
.product-card,
.cart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.hero-panel {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 9px;
}

.search-box {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.search-box span {
  color: var(--muted);
  font-size: 22px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 16px;
  border: 0;
  font-weight: 850;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(160deg, #ffb11f, var(--orange));
  color: #1f1300;
  box-shadow: 0 10px 22px rgba(242, 140, 0, .22);
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

#scannerBtn {
  width: 100%;
  margin-top: 12px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}

.section-head h2,
.panel h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.03em;
}

.section-head span,
.muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.list {
  display: grid;
  gap: 10px;
}

.product-card,
.cart-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.thumb {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--orange);
  background: rgba(242, 140, 0, .1);
  border: 1px solid rgba(242, 140, 0, .16);
  font-size: 25px;
  font-weight: 900;
}

.item-title {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.02em;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.item-meta span {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--line), transparent 30%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.add-btn,
.delete-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--orange);
  font-size: 24px;
}

.delete-btn {
  color: var(--danger);
  font-size: 18px;
}

.qty-control {
  display: grid;
  grid-template-columns: 32px 34px 32px;
  gap: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.qty-control button {
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--orange);
  font-size: 18px;
}

.qty-control strong {
  text-align: center;
  font-size: 14px;
}

.scanner-preview {
  margin-top: 18px;
}

.scanner-frame {
  height: 146px;
  border-radius: 17px;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.06) 1px, transparent 1px),
    #07111f;
  background-size: 18px 18px;
  color: white;
}

.scanner-frame span {
  position: absolute;
  inset: 22px;
  border: 2px solid var(--orange);
  border-radius: 10px;
  opacity: .85;
}

.scanner-frame strong {
  font-size: 13px;
  opacity: .82;
}

.print-footer {
  position: sticky;
  bottom: 76px;
  margin-top: 18px;
  padding: 12px;
  background: color-mix(in srgb, var(--bg), transparent 8%);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
}

.print-btn {
  width: 100%;
}

.print-footer p {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

form {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

label input {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  outline: 0;
}

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

.settings-panel {
  margin-top: 14px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row span {
  color: var(--muted);
}

.setting-row strong {
  text-align: right;
}

.full {
  width: 100%;
  margin-top: 14px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(145deg, var(--navy), var(--navy-2));
  box-shadow: 0 -10px 24px rgba(7, 29, 51, .16);
}

.nav-btn {
  display: grid;
  gap: 3px;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 780;
}

.nav-btn span {
  font-size: 22px;
}

.nav-btn.active {
  color: var(--orange);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 40;
  width: min(calc(100% - 28px), 480px);
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 14px;
  border-radius: 14px;
  background: #101827;
  color: white;
  box-shadow: 0 16px 38px rgba(0,0,0,.24);
  font-size: 14px;
  font-weight: 750;
  transition: .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 380px) {
  main {
    padding: 14px;
  }

  .product-card,
  .cart-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .thumb {
    width: 48px;
    height: 48px;
  }
}


/* Small mobile polish */
@media (max-width: 430px) {
  .search-box {
    padding: 0 10px;
    gap: 8px;
  }

  .search-box input {
    font-size: 16px;
  }

  .search-box button {
    width: 32px;
    flex-shrink: 0;
  }

  .topbar {
    padding: calc(12px + env(safe-area-inset-top)) 18px 14px;
  }
}


/* ─────────────────────────────────────────────
   V2 Design-Fix 01
   - mehr Abstand unter Header
   - kompaktere Produktkarten
   - Scanner-Vorschau erst nach Klick
   - Setup-Status in Orange statt Rot
   ───────────────────────────────────────────── */

main {
  padding-top: 28px;
}

.hero-panel {
  margin-top: 6px;
}

.topbar p.setup i {
  background: var(--orange);
}

.topbar p.setup {
  color: rgba(255,255,255,.92);
}

.product-card,
.cart-card {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding: 10px;
  gap: 10px;
}

.thumb {
  width: 52px;
  height: 52px;
  font-size: 23px;
}

.item-title {
  font-size: 14.5px;
  margin-bottom: 4px;
}

.item-meta span {
  height: 21px;
  padding: 0 7px;
  font-size: 10.5px;
}

.add-btn,
.delete-btn {
  width: 36px;
  height: 36px;
}

.scanner-preview {
  display: none;
}

.scanner-preview.open {
  display: block;
  animation: viewIn .18s ease both;
}

.scanner-preview {
  margin-top: 16px;
}

.scanner-frame {
  height: 132px;
}

@media (max-width: 430px) {
  main {
    padding-top: 24px;
  }

  .hero-panel {
    margin-top: 2px;
  }

  .product-card,
  .cart-card {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    padding: 10px;
    border-radius: 16px;
  }

  .thumb {
    width: 50px;
    height: 50px;
  }

  .item-title {
    font-size: 14px;
  }

  .item-meta {
    gap: 4px;
  }

  .item-meta span {
    max-width: 100%;
  }
}


/* ─────────────────────────────────────────────
   Palette View 01
   ───────────────────────────────────────────── */

.palette-panel {
  margin: 0 0 18px;
}

.palette-toggle {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card), var(--navy) 3%);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.palette-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(242, 140, 0, .1);
  color: var(--orange);
  font-size: 26px;
  font-weight: 900;
}

.palette-toggle strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.palette-toggle small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.palette-toggle b {
  color: var(--orange);
  font-size: 18px;
  text-align: center;
  transition: transform .18s ease;
}

.palette-toggle.open b {
  transform: rotate(180deg);
}

.palette-body {
  display: none;
  padding: 14px 0 0;
}

.palette-body.open {
  display: block;
  animation: viewIn .18s ease both;
}

.palette-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 12px;
  -webkit-overflow-scrolling: touch;
}

.palette-chip {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-weight: 850;
}

.palette-chip.active {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(242, 140, 0, .08);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.palette-slot {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card), var(--navy) 6%);
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}

.palette-slot.empty {
  opacity: .34;
  cursor: not-allowed;
  background: transparent;
}

.palette-slot.in-cart {
  border-color: var(--orange);
  background: rgba(242, 140, 0, .12);
  color: var(--orange);
}

.palette-slot.in-cart::after {
  content: "✓";
  position: absolute;
  right: 7px;
  top: 6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--orange);
  color: #1f1300;
  font-size: 12px;
  font-weight: 950;
}

@media (max-width: 380px) {
  .palette-grid {
    gap: 8px;
  }

  .palette-slot {
    border-radius: 14px;
    font-size: 20px;
  }
}


/* ─────────────────────────────────────────────
   Palette Compact 01
   - kompaktere Paletten-Übersicht
   - 6 Spalten mobil
   - kleinere Filter-Chips
   - weniger vertikaler Abstand
   ───────────────────────────────────────────── */

.palette-panel {
  margin-bottom: 14px;
}

.palette-body {
  padding-top: 10px;
}

.palette-filters {
  gap: 7px;
  padding-bottom: 10px;
}

.palette-chip {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.palette-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.palette-slot {
  border-radius: 12px;
  font-size: 18px;
  min-height: 0;
  box-shadow: none;
}

.palette-slot.in-cart::after {
  right: 4px;
  top: 4px;
  width: 15px;
  height: 15px;
  font-size: 10px;
}

@media (max-width: 430px) {
  .palette-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
  }

  .palette-slot {
    border-radius: 12px;
    font-size: 17px;
  }

  .palette-chip {
    height: 32px;
    padding: 0 11px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
  }

  .palette-slot {
    font-size: 16px;
  }
}


/* ─────────────────────────────────────────────
   Palette Qty Popup 01
   - 5 Spalten
   - Stückzahl-Popup bei Paletten-Auswahl
   ───────────────────────────────────────────── */

.palette-grid {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 8px !important;
}

.palette-slot {
  border-radius: 13px;
  font-size: 18px;
}

@media (max-width: 430px) {
  .palette-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
  }

  .palette-slot {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .palette-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 7px !important;
  }

  .palette-slot {
    font-size: 16px;
  }
}

.qty-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(7, 17, 31, .54);
  backdrop-filter: blur(6px);
}

.qty-backdrop.open {
  display: block;
  animation: fadeInBg .16s ease both;
}

@keyframes fadeInBg {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qty-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 81;
  width: min(100%, 520px);
  transform: translateX(-50%) translateY(105%);
  border-radius: 26px 26px 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 -22px 55px rgba(0, 0, 0, .28);
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  transition: transform .22s cubic-bezier(.22,.68,0,1.15);
}

.qty-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.qty-handle {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  margin: 2px auto 16px;
}

.qty-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.qty-kicker {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.qty-title {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.04em;
  margin: 0;
}

.qty-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.qty-meta span {
  display: inline-flex;
  height: 24px;
  align-items: center;
  border-radius: 8px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--line), transparent 30%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qty-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.qty-row {
  display: grid;
  grid-template-columns: 62px minmax(84px, 1fr) 62px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.qty-btn {
  height: 58px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card), var(--navy) 4%);
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
}

.qty-input {
  height: 58px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  outline: 0;
}

.qty-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.qty-quick button {
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.qty-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.qty-actions button {
  min-height: 50px;
}


/* ─────────────────────────────────────────────
   Palette + Qty Polish 02
   - keine Fotos / keine Produktbilder
   - Palettenraster bleibt sauber innerhalb der Ansicht
   - Stückzahl-Sheet optisch ruhiger und kompakter
   ───────────────────────────────────────────── */

/* Palettenbereich nicht mehr optisch zu breit */
.palette-panel {
  max-width: 100%;
  overflow: hidden;
}

.palette-body {
  width: 100%;
  overflow: hidden;
}

.palette-grid {
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 7px !important;
  padding: 0 1px 4px;
}

.palette-slot {
  width: 100%;
  min-width: 0;
  padding: 0;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  font-size: 17px;
  background: #f3f6fa;
  border-color: #e2e8f0;
}

body.dark .palette-slot {
  background: color-mix(in srgb, var(--card), white 4%);
}

.palette-slot.empty {
  opacity: .28;
}

.palette-filters {
  padding-left: 1px;
  padding-right: 1px;
}

.palette-chip {
  height: 31px;
  padding: 0 11px;
  font-size: 12.5px;
}

/* Stückzahl-Popup: kompakter und hochwertiger */
.qty-sheet {
  width: min(calc(100% - 18px), 502px);
  bottom: 8px;
  border-radius: 24px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}

.qty-handle {
  width: 44px;
  height: 5px;
  margin-bottom: 14px;
  background: #dce3ec;
}

.qty-head {
  grid-template-columns: minmax(0, 1fr) 36px;
  margin-bottom: 14px;
}

.qty-kicker {
  font-size: 11px;
  letter-spacing: .10em;
  margin-bottom: 6px;
}

.qty-title {
  font-size: 24px;
  line-height: 1.05;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.qty-close {
  width: 36px;
  height: 36px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}

body.dark .qty-close {
  background: color-mix(in srgb, var(--card), white 4%);
}

.qty-meta {
  gap: 5px;
  margin-top: 10px;
}

.qty-meta span {
  height: 25px;
  font-size: 11.5px;
  border-radius: 8px;
}

/* Menge als ein zusammenhängendes Control statt 3 riesige Elemente */
.qty-row {
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f7f9fc;
  border-radius: 18px;
  margin-bottom: 12px;
}

body.dark .qty-row {
  background: color-mix(in srgb, var(--card), white 4%);
}

.qty-btn {
  height: 50px;
  border-radius: 14px;
  background: #ffffff;
  font-size: 26px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .04);
}

body.dark .qty-btn {
  background: color-mix(in srgb, var(--card), white 6%);
}

.qty-input {
  height: 50px;
  border: 0;
  background: transparent;
  font-size: 28px;
  box-shadow: none;
}

.qty-input:focus {
  outline: none;
}

.qty-quick {
  gap: 7px;
  margin-bottom: 13px;
}

.qty-quick button {
  height: 35px;
  font-size: 14px;
  background: #ffffff;
}

body.dark .qty-quick button {
  background: color-mix(in srgb, var(--card), white 4%);
}

.qty-actions {
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
}

.qty-actions button {
  min-height: 48px;
  border-radius: 15px;
}

@media (max-width: 390px) {
  .palette-grid {
    gap: 6px !important;
  }

  .palette-slot {
    font-size: 16px;
    border-radius: 11px;
  }

  .qty-sheet {
    width: min(calc(100% - 12px), 502px);
    padding-left: 13px;
    padding-right: 13px;
  }

  .qty-title {
    font-size: 22px;
  }

  .qty-row {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
  }
}


/* ─────────────────────────────────────────────
   Qty Button + Keyboard Fix 03
   - Minus rot
   - Plus grün
   - Popup öffnet ohne automatische Tastatur
   ───────────────────────────────────────────── */

#qtyMinusBtn {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), white 92%);
  border-color: color-mix(in srgb, var(--danger), white 72%);
}

#qtyPlusBtn {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok), white 91%);
  border-color: color-mix(in srgb, var(--ok), white 70%);
}

body.dark #qtyMinusBtn {
  background: color-mix(in srgb, var(--danger), transparent 86%);
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
}

body.dark #qtyPlusBtn {
  background: color-mix(in srgb, var(--ok), transparent 86%);
  border-color: color-mix(in srgb, var(--ok), transparent 58%);
}


/* ─────────────────────────────────────────────
   Cart Polish 01
   - klarere Druckliste
   - Löschen dezenter
   - Menge rot/grün
   - Druckbutton dynamisch
   ───────────────────────────────────────────── */

.cart-card {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  position: relative;
  padding: 13px;
  gap: 11px;
}

.cart-card .cart-main {
  min-width: 0;
  padding-right: 42px;
}

.cart-card .item-title {
  font-size: 15px;
  line-height: 1.15;
  margin-bottom: 7px;
}

.cart-card .item-meta span:first-child::before {
  content: "Nr. ";
}

.cart-card .cart-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cart-card .cart-controls::before {
  content: "Menge";
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.cart-card .delete-btn {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 18px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), white 94%);
  border-color: color-mix(in srgb, var(--danger), white 76%);
}

body.dark .cart-card .delete-btn {
  background: color-mix(in srgb, var(--danger), transparent 87%);
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
}

.cart-card .qty-control {
  grid-template-columns: 38px 42px 38px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card), var(--navy) 3%);
}

.cart-card .qty-control button {
  height: 38px;
  font-size: 20px;
  font-weight: 950;
}

.cart-card .qty-control button:first-child {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), white 94%);
}

.cart-card .qty-control button:last-child {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok), white 92%);
}

body.dark .cart-card .qty-control button:first-child {
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

body.dark .cart-card .qty-control button:last-child {
  background: color-mix(in srgb, var(--ok), transparent 88%);
}

.cart-card .qty-control strong {
  font-size: 16px;
  font-weight: 950;
}

.print-footer {
  margin-top: 12px;
}

.print-btn {
  min-height: 52px;
  font-size: 16px;
}

@media (max-width: 390px) {
  .cart-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 12px;
  }

  .cart-card .cart-main {
    padding-right: 38px;
  }

  .cart-card .delete-btn {
    width: 32px;
    height: 32px;
  }

  .cart-card .qty-control {
    grid-template-columns: 36px 40px 36px;
  }
}


/* ─────────────────────────────────────────────
   Admin V1
   ───────────────────────────────────────────── */

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
}

.admin-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.05em;
}

.admin-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
}

.admin-new-btn {
  min-height: 40px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 900;
}

.admin-search-panel {
  margin-bottom: 14px;
}

.admin-search-box {
  height: 50px;
}

.admin-hint {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-result-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card), var(--navy) 2%);
  color: var(--text);
  text-align: left;
}

.admin-result-letter {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(242, 140, 0, .1);
  color: var(--orange);
  font-weight: 950;
  font-size: 20px;
}

.admin-result-text {
  min-width: 0;
}

.admin-result-text strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.admin-result-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-result-card b {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.admin-editor-panel {
  margin-bottom: 14px;
}

.admin-editor-title {
  margin-bottom: 4px;
}

.admin-form-actions {
  grid-template-columns: 1fr 1fr 1.25fr;
}

.danger-outline {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), white 72%);
  background: color-mix(in srgb, var(--danger), white 94%);
}

.danger-outline:disabled {
  opacity: .42;
  cursor: not-allowed;
}

body.dark .danger-outline {
  background: color-mix(in srgb, var(--danger), transparent 88%);
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
}

.admin-empty {
  padding: 18px 12px;
}

@media (max-width: 390px) {
  .admin-head h2 {
    font-size: 25px;
  }

  .admin-form-actions {
    grid-template-columns: 1fr;
  }

  .admin-result-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .admin-result-card b {
    display: none;
  }
}


/* ─────────────────────────────────────────────
   Admin Auth 01
   ───────────────────────────────────────────── */

.admin-login-panel {
  margin-bottom: 14px;
  border-color: color-mix(in srgb, var(--orange), white 68%);
  background:
    radial-gradient(circle at 92% 0%, rgba(242, 140, 0, .12), transparent 35%),
    var(--card);
}

.admin-login-panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -.04em;
}

.admin-login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.admin-login-form label {
  margin: 0;
}

.admin-login-form input {
  height: 48px;
}

.admin-login-form button {
  min-height: 48px;
  white-space: nowrap;
}

.admin-locked-content.locked {
  position: relative;
  opacity: .42;
  pointer-events: none;
  filter: grayscale(.2);
}

.settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-title-row h2 {
  margin: 0;
}

.admin-logout-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 390px) {
  .admin-login-form {
    grid-template-columns: 1fr;
  }
}


/* ─────────────────────────────────────────────
   MUNBYN HTTP Print 01
   ───────────────────────────────────────────── */

.printer-url-label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 850;
}

.printer-url-label input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  outline: 0;
  font-size: 13px;
}

.printer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.printer-actions button {
  min-height: 44px;
}

@media (max-width: 390px) {
  .printer-actions {
    grid-template-columns: 1fr;
  }
}
