:root {
  --ink: #17211b;
  --muted: #6f7973;
  --cream: #f5f1e9;
  --paper: #fffdf8;
  --line: #dedbd2;
  --green: #146b42;
  --green-dark: #0c4f30;
  --green-soft: #dcece2;
  --orange: #ee9f3f;
  --red: #b23b36;
  --shadow: 0 18px 50px rgba(35, 46, 39, .12);
}

* { box-sizing: border-box; }

html {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select {
  font: inherit;
  touch-action: manipulation;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand, .header-actions, .section-heading, .cart-heading, .dialog-heading, .dialog-actions, .total-row {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; }
.brand > div:last-child { display: grid; gap: 2px; }
.brand span, .balance span { color: var(--muted); font-size: .78rem; }

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 800;
}

.brand-mark.small { width: 44px; height: 44px; border-radius: 13px; font-size: 1.4rem; }
.header-actions { gap: 12px; }
.session-info { display: grid; justify-items: end; gap: 1px; margin-right: 5px; }
.session-info strong { font-size: .78rem; }
.session-info .text-button { min-height: auto; padding: 2px; font-size: .68rem; }
.sync-status { font-size: .68rem; font-weight: 850; }
.sync-status.online { color: var(--green); }
.sync-status.syncing { color: var(--orange); }
.sync-status.offline { color: var(--red); }
.balance { display: grid; gap: 2px; margin-right: 10px; text-align: right; }
.balance strong { font-size: 1.12rem; }

.icon-button, .secondary, .primary, .danger, .text-button {
  border: 0;
  border-radius: 12px;
  font-weight: 750;
}

.icon-button, .secondary { padding: 11px 15px; color: var(--ink); background: #ebe8df; }
.danger-text { color: var(--red); }
.primary { padding: 12px 18px; color: #fff; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.danger { padding: 12px 18px; color: #fff; background: var(--red); margin-right: auto; }
.text-button { padding: 8px; color: var(--muted); background: transparent; }
.full { width: 100%; }

.app-shell {
  height: calc(100vh - 82px);
  height: calc(100dvh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.catalog { padding: 34px; overflow-y: auto; }
.section-heading { justify-content: space-between; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: 2rem; letter-spacing: -.04em; }
h2 { font-size: 1.45rem; letter-spacing: -.03em; }
.eyebrow { margin-bottom: 5px; color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.55; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.product-card {
  position: relative;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 5px 16px rgba(35, 46, 39, .04);
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.product-card:hover { transform: translateY(-2px); border-color: #a8b9ae; box-shadow: 0 10px 24px rgba(35, 46, 39, .09); }
.product-card strong { font-size: 1.08rem; }
.product-card .price { font-family: Georgia, serif; font-size: 1.75rem; font-weight: 800; }
.product-card.out-of-stock { opacity: .55; cursor: not-allowed; }
.stock-badge {
  position: absolute;
  right: 13px;
  bottom: 14px;
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: .7rem;
  font-weight: 850;
}
.stock-badge.empty { color: var(--red); background: #f5e5e2; }
.category-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.category-dot.getraenk { background: #3f7cac; }
.category-dot.sonstiges { background: var(--orange); }

.cart-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px rgba(35, 46, 39, .04);
}

.cart-heading { justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item-name { font-weight: 750; }
.cart-item-price { font-weight: 800; }
.quantity { display: flex; align-items: center; gap: 9px; }
.quantity button { width: 27px; height: 27px; border: 0; border-radius: 8px; background: #ece9e1; font-weight: 900; }
.unit-price { align-self: center; color: var(--muted); font-size: .8rem; text-align: right; }
.empty-cart, .empty-state { place-items: center; text-align: center; color: var(--muted); }
.empty-cart { flex: 1; display: grid; align-content: center; gap: 8px; }
.empty-cart strong { color: var(--ink); }
.empty-cart span { max-width: 220px; font-size: .9rem; line-height: 1.5; }
.bag-icon, .empty-state > span { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 1.5rem; }
.bag-icon {
  position: relative;
  color: transparent;
}
.bag-icon::before,
.bag-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  background: var(--green);
  transform: translate(-50%, -50%);
}
.bag-icon::before { width: 14px; height: 2px; }
.bag-icon::after { width: 2px; height: 14px; }
.cart-footer { padding-top: 20px; border-top: 1px solid var(--line); }
.total-row { justify-content: space-between; margin-bottom: 17px; font-size: 1.15rem; }
.total-row strong { font-family: Georgia, serif; font-size: 2rem; }
.checkout { width: 100%; padding: 16px; font-size: 1.05rem; }
.empty-state { min-height: 380px; display: grid; align-content: center; gap: 10px; }
.empty-state p { max-width: 360px; line-height: 1.5; }

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 28, 21, .87);
  backdrop-filter: blur(8px);
}

.setup-card, .dialog-card { width: min(100%, 470px); padding: 30px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.setup-card { display: grid; gap: 14px; }
.setup-card { max-height: calc(100dvh - 40px); overflow-y: auto; }
.setup-card .brand-mark { margin-bottom: 8px; }
label { margin-top: 7px; color: var(--ink); font-size: .82rem; font-weight: 800; }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; outline: 0; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.switch-row > span:first-child { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control {
  position: relative;
  width: 58px;
  height: 34px;
  border-radius: 30px;
  background: #d5d5d3;
  transition: background .2s;
}
.switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: translate .2s;
}
.switch-row input:checked + .switch-control { background: #37c85d; }
.switch-row input:checked + .switch-control::after { translate: 24px 0; }
.money-input { position: relative; }
.money-input input { padding-right: 42px; }
.money-input span { position: absolute; right: 15px; top: 50%; translate: 0 -50%; color: var(--muted); font-weight: 800; }
.money-input.large input { padding: 15px 48px 15px 15px; font-size: 1.5rem; font-weight: 800; }

dialog { max-width: calc(100vw - 32px); padding: 0; border: 0; border-radius: 24px; background: transparent; overflow: hidden; }
dialog::backdrop { background: rgba(16, 28, 21, .72); backdrop-filter: blur(5px); }
#productDialog {
  width: min(960px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  overflow: hidden;
  scrollbar-width: none;
}
#productDialog::-webkit-scrollbar { display: none; }
.product-dialog-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  overflow: hidden;
}
.product-dialog-layout:not(.keypad-open) {
  width: min(100%, 473px);
  margin: 0 auto;
}
.product-dialog-layout.keypad-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-dialog-layout > .dialog-card { width: 100%; }
.price-keypad-card { width: 100%; align-content: start; }
.price-keypad-card > strong {
  display: block;
  padding: 14px;
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-family: Georgia, serif;
  font-size: 2rem;
  text-align: right;
}
.dialog-card { display: grid; gap: 13px; }
.dialog-heading { justify-content: space-between; margin-bottom: 7px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #ece9e1; font-size: 1.4rem; }
.dialog-actions { justify-content: flex-end; gap: 9px; margin-top: 10px; }
.payment-total { display: flex; align-items: flex-end; justify-content: space-between; padding: 20px; border-radius: 16px; background: var(--green-soft); }
.payment-total strong { color: var(--green-dark); font-family: Georgia, serif; font-size: 2.2rem; }
.quick-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.quick-amounts button { padding: 9px 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 750; }
.payment-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.payment-keypad button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 0 #d8d4ca;
  font-size: 1.35rem;
  font-weight: 850;
}
.payment-keypad button:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 #d8d4ca;
}
.payment-keypad .key-clear {
  color: var(--red);
  background: #f8e9e6;
  font-size: .82rem;
}
.payment-keypad .key-backspace {
  grid-column: 1 / -1;
  min-height: 46px;
  color: var(--muted);
  background: #ebe8df;
}
.change-box { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border: 1px solid var(--line); border-radius: 13px; }
.change-box strong { font-size: 1.35rem; }
.change-box.positive { color: var(--green-dark); background: var(--green-soft); border-color: transparent; }
.error-message { color: var(--red); font-size: .82rem; font-weight: 700; }
.configured-terminal { display: grid; gap: 3px; padding: 14px; border-radius: 13px; background: var(--green-soft); }
.configured-terminal span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.configured-terminal strong { color: var(--green-dark); font-size: 1.15rem; }
.user-form { display: grid; grid-template-columns: 1.2fr .7fr 1fr auto; gap: 8px; }
.user-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.user-item span { color: var(--muted); font-size: .8rem; }
.close-card { width: min(92vw, 700px); }
.success-card { justify-items: center; text-align: center; }
.success-card > strong { margin: -5px 0 15px; color: var(--green-dark); font-family: Georgia, serif; font-size: 3.5rem; }
.success-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 1.8rem; font-weight: 900; }
.history-card { width: min(92vw, 600px); }
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-box { padding: 13px; border-radius: 12px; background: #eeebe3; }
.summary-box span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.summary-box strong { font-size: 1rem; }
.history-list { max-height: 390px; overflow-y: auto; }
.history-item { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.history-item span { color: var(--muted); font-size: .8rem; }
.history-item strong { grid-row: span 2; align-self: center; }
.history-print { grid-row: span 2; align-self: center; }
.print-receipt { display: none; }
.management-card { width: min(92vw, 650px); }
.management-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.management-actions .danger { margin-right: 0; }
.management-list { max-height: min(55vh, 600px); overflow-y: auto; }
.management-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: transform .15s, background .15s, opacity .15s;
}
.management-item.dragging { opacity: .4; }
.management-item.drag-target {
  background: var(--green-soft);
  border-radius: 12px;
}
.management-handle {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 10px;
  color: var(--muted);
  background: #ebe8df;
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 1.25rem;
  font-weight: 900;
}
.management-handle:active { cursor: grabbing; }
.management-product { display: grid; gap: 3px; }
.management-product span { color: var(--muted); font-size: .82rem; }
.management-product .management-stock { color: var(--green-dark); font-weight: 750; }
.management-edit, .management-delete {
  min-width: 48px;
  min-height: 44px;
  padding: 9px 13px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
}
.management-edit { color: var(--ink); background: #ebe8df; }
.management-delete { color: var(--red); background: #f5e5e2; }
.statistics-card { width: min(92vw, 700px); }
.statistics-list { max-height: min(55vh, 600px); overflow-y: auto; }
.statistics-day {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}
.statistics-day span { color: var(--muted); font-size: .82rem; }
.statistics-day strong { grid-row: span 2; align-self: center; font-size: 1.15rem; }
.hidden { display: none !important; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    background: #fff !important;
  }
  body > * { display: none !important; }
  #printReceipt {
    width: 72mm;
    margin: 0 auto;
    display: block !important;
    break-inside: avoid;
    page-break-inside: avoid;
    color: #000;
    background: #fff;
    font-family: "Courier New", monospace;
    font-size: 11pt;
    line-height: 1.35;
  }
  .receipt-title { margin: 5mm 0 9mm; font-size: 15pt; text-align: center; }
  .receipt-section-title { margin: 0 0 5mm; font-family: Arial, sans-serif; font-size: 16pt; text-align: center; }
  .receipt-line { margin: 2.5mm 0; }
  .receipt-items { display: grid; gap: 2mm; margin: 4mm 0; }
  .receipt-row { display: flex; justify-content: space-between; gap: 4mm; }
  .receipt-row span:first-child { overflow-wrap: anywhere; }
  .receipt-row span:last-child { flex: 0 0 auto; }
  .receipt-total { margin: 4mm 0; font-weight: 900; }
  .receipt-tear {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 3mm;
    margin: 9mm 0 13mm;
    font-family: Arial, sans-serif;
    text-align: center;
  }
  .receipt-tear::before,
  .receipt-tear::after {
    content: "";
    border-top: 1px dashed #000;
  }
}

/* iPad Pro 12.9": optimiert für Touch-Bedienung im Hoch- und Querformat. */
@media (min-width: 901px) and (max-width: 1400px) {
  button, input, select { min-height: 48px; }
  .topbar { height: 88px; padding: max(12px, env(safe-area-inset-top)) 24px 12px; }
  .brand-mark.small { width: 50px; height: 50px; }
  .brand strong { font-size: 1.08rem; }
  .brand span, .balance span { font-size: .82rem; }
  .header-actions { gap: 10px; }
  .icon-button, .secondary, .primary, .danger { padding: 13px 17px; }
  .app-shell {
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    grid-template-columns: minmax(0, 1fr) 370px;
  }
  .catalog { padding: 28px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .product-card { min-height: 168px; padding: 19px; }
  .product-card strong { font-size: 1.12rem; }
  .product-card .price { font-size: 1.8rem; }
  .cart-panel { padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .cart-item { padding: 17px 0; }
  .quantity { gap: 11px; }
  .quantity button { width: 44px; height: 44px; }
  .checkout { min-height: 58px; font-size: 1.1rem; }
  .setup-card, .dialog-card { width: min(100%, 540px); padding: 34px; }
  .setup-card { width: min(100%, 500px); }
  .dialog-card { gap: 15px; }
  .close-button { width: 48px; height: 48px; }
  .quick-amounts button { min-height: 52px; }
  .payment-keypad button { min-height: 64px; font-size: 1.55rem; }
  .payment-keypad .key-backspace { min-height: 50px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .topbar { padding-left: 18px; padding-right: 18px; }
  .app-shell { grid-template-columns: minmax(0, 1fr) 340px; }
  .catalog { padding: 26px 20px; }
  .section-heading { margin-bottom: 20px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .product-card { min-height: 155px; }
  .cart-panel { padding: 22px 20px max(22px, env(safe-area-inset-bottom)); }
  .cart-heading { padding-bottom: 16px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: calc(100vh - 70px); grid-template-columns: 1fr; }
  .topbar {
    height: auto;
    min-height: 70px;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }
  .header-actions { gap: 5px; }
  .session-info strong, .session-info .text-button { display: none; }
  .icon-button { padding: 9px; font-size: .72rem; }
  .balance { display: none; }
  .catalog {
    padding: 22px max(15px, env(safe-area-inset-right)) calc(315px + env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
  }
  .section-heading { align-items: flex-end; }
  .section-heading .secondary { padding: 10px; font-size: .77rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-card { min-height: 125px; padding: 14px; }
  .product-card .price { font-size: 1.4rem; }
  .cart-panel {
    position: fixed;
    z-index: 5;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 315px;
    padding: 15px max(15px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    border-left: 0;
    box-shadow: 0 -12px 30px rgba(35, 46, 39, .1);
  }
  .cart-heading { padding-bottom: 10px; }
  .cart-heading .eyebrow { display: none; }
  .cart-items { min-height: 0; }
  .empty-cart { display: none; }
  .cart-item { padding: 9px 0; }
  .cart-footer { padding-top: 11px; }
  .total-row { margin-bottom: 9px; }
  .total-row strong { font-size: 1.55rem; }
  .management-actions { grid-template-columns: 1fr; }
  .management-item { grid-template-columns: auto 1fr auto; }
  .management-delete { grid-column: 3; }
  dialog { max-height: calc(100dvh - 16px); }
  .dialog-card { max-height: calc(100dvh - 16px); overflow-y: auto; }
  .product-dialog-layout,
  .product-dialog-layout.keypad-open { max-height: calc(100dvh - 16px); grid-template-columns: 1fr; overflow-x: hidden; overflow-y: auto; }
  .price-keypad-card { width: min(100%, 470px); }
  .user-form { grid-template-columns: 1fr; }
}

/* Smartphone-Hochformat, z. B. iPhone 15. */
@media (max-width: 600px) {
  :root { --phone-topbar-height: calc(62px + env(safe-area-inset-top)); }
  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body {
    position: fixed;
    inset: 0;
  }
  .topbar {
    height: var(--phone-topbar-height);
    min-height: var(--phone-topbar-height);
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: 8px;
    gap: 8px;
    flex: 0 0 auto;
  }
  .app-shell {
    height: calc(100dvh - var(--phone-topbar-height));
    min-height: 0;
    overflow: hidden;
  }
  .brand { gap: 8px; min-width: 0; }
  .brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 1.15rem; }
  .brand strong { font-size: .88rem; white-space: nowrap; }
  .brand span { display: none; }
  .session-info { margin-right: 0; }
  .sync-status { font-size: .6rem; }
  .header-actions { margin-left: auto; }
  .icon-button { min-height: 40px; padding: 8px; border-radius: 10px; font-size: .68rem; }

  .catalog {
    min-height: 0;
    padding-top: 16px;
    padding-bottom: calc(290px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .section-heading { margin-bottom: 13px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.25rem; }
  .product-card { min-height: 112px; padding: 12px; border-radius: 14px; }
  .product-card strong { font-size: .92rem; }
  .product-card .price { font-size: 1.28rem; }
  .stock-badge { right: 8px; bottom: 9px; padding: 4px 6px; font-size: .6rem; }

  .cart-panel { max-height: 290px; padding-top: 11px; overscroll-behavior: contain; }
  .cart-items { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .cart-heading { padding-bottom: 7px; }
  .cart-heading h2 { font-size: 1.08rem; }
  .cart-item { gap: 5px 8px; padding: 7px 0; font-size: .86rem; }
  .quantity { gap: 6px; }
  .quantity button { width: 30px; height: 30px; }
  .cart-footer { padding-top: 8px; }
  .total-row { font-size: .9rem; }
  .total-row strong { font-size: 1.35rem; }
  .checkout { padding: 12px; }

  .overlay { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .setup-card, .dialog-card { padding: 18px; border-radius: 18px; overscroll-behavior: contain; }
  dialog, #productDialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); border-radius: 18px; }
  .dialog-heading { margin-bottom: 2px; }
  .close-button { width: 40px; height: 40px; flex: 0 0 auto; }
  .dialog-actions { flex-wrap: wrap; gap: 7px; }
  .dialog-actions > button { flex: 1 1 auto; min-height: 44px; padding: 10px; }
  .danger { margin-right: 0; }
  .payment-total { padding: 13px; }
  .payment-total strong { font-size: 1.7rem; }
  .payment-keypad { gap: 6px; }
  .payment-keypad button { min-height: 52px; }
  .payment-keypad .key-backspace { min-height: 42px; }
  .quick-amounts { grid-template-columns: repeat(2, 1fr); }
  .change-box { padding: 11px 13px; }
  .history-summary { grid-template-columns: 1fr; }
  .management-card, .statistics-card, .history-card, .close-card { width: 100%; }
  .management-item { gap: 7px; }
  .management-handle { width: 40px; min-height: 40px; }
  .management-edit, .management-delete { min-width: 42px; min-height: 40px; padding: 7px 9px; font-size: .75rem; }
  .empty-state { min-height: 260px; }
}

/* Smartphone-Querformat: Warenkorb neben dem Sortiment statt über den Produkten. */
@media (max-width: 900px) and (min-width: 650px) and (orientation: landscape) {
  body { overflow: hidden; }
  .topbar { min-height: 62px; padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: 7px; }
  .brand-mark.small { width: 40px; height: 40px; }
  .app-shell {
    height: calc(100dvh - 62px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .catalog {
    padding: 15px 14px max(15px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    overflow-y: auto;
  }
  .section-heading { margin-bottom: 12px; }
  .product-card { min-height: 108px; padding: 12px; }
  .cart-panel {
    position: static;
    max-height: none;
    padding: 13px max(13px, env(safe-area-inset-right)) max(13px, env(safe-area-inset-bottom)) 13px;
    border-top: 0;
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 30px rgba(35, 46, 39, .04);
  }
  .cart-heading { padding-bottom: 8px; }
  .cart-item { padding: 7px 0; }
  .cart-footer { padding-top: 8px; }
  .total-row { margin-bottom: 7px; }
}
