:root {
  --bg0: #1a2a22;
  --bg1: #243830;
  --bg2: #2f4a3a;
  --surface: rgba(247, 242, 232, 0.94);
  --surface-solid: #f7f2e8;
  --ink: #1c241f;
  --ink-soft: #4a5a52;
  --line: rgba(28, 36, 31, 0.12);
  --accent: #c46b2d;
  --accent-hover: #a85620;
  --ok: #2f6b4f;
  --warn: #b7791f;
  --danger: #a33b2b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(10, 18, 14, 0.28);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 107, 45, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(90, 140, 110, 0.35), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.muted { color: var(--ink-soft); }
.error { color: var(--danger); margin: 0; }
.lead { margin: 0.25rem 0 0; color: var(--ink-soft); max-width: 40ch; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(1.45rem, 4.5vw, 2.1rem); }
h2 { font-size: clamp(1.1rem, 3.5vw, 1.25rem); }

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: max(0.75rem, var(--safe-top)) 0.85rem calc(1.25rem + var(--nav-h) + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: #f3eee4;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.topbar .brand { font-size: 1.25rem; }
.topbar .muted {
  color: rgba(243, 238, 228, 0.7);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  border: 1px solid rgba(243, 238, 228, 0.18);
  background: rgba(243, 238, 228, 0.08);
  color: #f3eee4;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  min-height: var(--tap);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover { background: rgba(243, 238, 228, 0.16); }
.tab.active {
  background: var(--surface-solid);
  color: var(--ink);
  border-color: transparent;
}

.main {
  background: var(--surface);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.1rem 0.95rem 1.35rem;
  animation: rise 0.35s ease;
  min-width: 0;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view[hidden] { display: none !important; }

.page-head { margin-bottom: 1rem; }
.page-head.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; margin-top: 0.75rem; }

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  min-height: var(--tap);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost {
  background: transparent;
  border-color: rgba(243, 238, 228, 0.28);
  color: #f3eee4;
}
.topbar .btn.ghost:hover { background: rgba(243, 238, 228, 0.1); }
.main .btn.ghost {
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(163, 59, 43, 0.35);
}
.btn.sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  min-height: 2.25rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

input, select, textarea {
  font: inherit;
  font-size: 16px; /* verhindert iOS-Zoom */
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

textarea { min-height: 90px; resize: vertical; }

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar > * { min-width: 0; }

.toolbar input[type="search"],
.toolbar input[type="text"]:first-child {
  flex: 1 1 160px;
}

.w-qty { width: 5rem; flex: 0 0 auto; }
.w-unit { width: 5.5rem; flex: 0 0 auto; }

.list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.item-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.item-card:hover {
  border-color: rgba(196, 107, 45, 0.35);
  box-shadow: 0 8px 24px rgba(28, 36, 31, 0.06);
}

.item-card.checked { opacity: 0.55; }

.item-card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.item-card > div:first-child { min-width: 0; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(47, 107, 79, 0.12);
  color: var(--ok);
}

.badge.warn {
  background: rgba(183, 121, 31, 0.15);
  color: var(--warn);
}

.badge.danger {
  background: rgba(163, 59, 43, 0.12);
  color: var(--danger);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  padding: 0.9rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  min-width: 0;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat span { color: var(--ink-soft); font-size: 0.85rem; }

.dash-actions {
  margin-bottom: 1rem;
}

.dash-stock-btn {
  width: 100%;
  min-height: 3.1rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@media (min-width: 720px) {
  .dash-stock-btn {
    width: auto;
    min-width: 14rem;
  }
}

.stock-move-card {
  align-items: center;
  gap: 0.75rem;
}

.stock-move-card.stock-move-card {
  align-items: center;
}

.stock-move-info {
  flex: 1;
  min-width: 0;
}

.stock-qty {
  font-weight: 600;
  color: var(--ink);
}

.stock-adjust {
  display: flex;
  gap: 0.55rem;
  flex-shrink: 0;
}

.stock-btn {
  min-width: 3.6rem;
  min-height: 3.6rem;
  padding: 0.35rem 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 0.85rem;
}

.stock-btn.stock-minus {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.stock-btn.stock-plus {
  font-size: 1.35rem;
}

.stock-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgba(47, 74, 58, 0.06);
}

.ing-stock-pick {
  width: 100%;
  min-width: 0;
}

.ing-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  min-width: 0;
}

.panel h2 { margin-bottom: 0.65rem; }

.empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.check-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-width: 0;
}

.check-row > div { min-width: 0; flex: 1; }

.check-row input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
  accent-color: var(--ok);
}

.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1rem, var(--safe-top)) 1rem max(1rem, var(--safe-bottom));
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.2rem 1.35rem;
  animation: rise 0.4s ease;
}

.login-panel .brand {
  color: var(--bg2);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.login-panel h1 { margin-bottom: 0.25rem; }
.login-panel .btn { width: 100%; }

.modal {
  position: relative;
  border: none;
  border-radius: calc(var(--radius) + 4px);
  padding: 0;
  width: min(520px, calc(100vw - 1.25rem));
  max-width: calc(100vw - 1.25rem);
  max-height: min(92dvh, 920px);
  box-shadow: var(--shadow);
  background: var(--surface-solid);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(14, 22, 18, 0.55);
  backdrop-filter: blur(2px);
}

.modal-body {
  padding: 1.15rem 1rem 1.15rem;
  padding-top: 1.35rem;
  max-width: 100%;
  max-height: min(92dvh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-body h2 {
  padding-right: 2rem;
  margin: 0;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  min-width: 0;
}

.form-row label { min-width: 0; }

.input-with-action {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
}

.input-with-action input {
  flex: 1 1 auto;
  min-width: 0;
}

.input-with-action .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ing-editor {
  min-width: 0;
  max-width: 100%;
}

.ing-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.ing-row .ing-name {
  width: 100%;
  min-width: 0;
}

.ing-row-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
}

.ing-row-meta input {
  width: 100%;
  min-width: 0;
}

.modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 20;
  width: var(--tap);
  height: var(--tap);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover,
.modal-close:focus {
  background: transparent;
  color: var(--ink);
  outline: none;
}

.panel-close-wrap { position: relative; }

.panel-close-wrap .result-close {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  z-index: 2;
}

.scan-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.reader {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
  min-height: 40px;
}

.reader video {
  border-radius: var(--radius);
  width: 100% !important;
  display: block;
}

.product-preview {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  padding-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-width: 0;
}

.product-preview img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: #f0ebe2;
  border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + var(--nav-h) + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 1.5rem);
  background: var(--ink);
  color: #f7f2e8;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: rise 0.25s ease;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.35rem 0 0.75rem;
}

.expiry-suggest-panel { margin-bottom: 0.5rem; }

.suggest-card .uses-expiring {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.suggest-card .uses-expiring .badge { margin: 0; }

/* Rezept-Verfügbarkeit – stark sichtbar */
.avail-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.avail-banner--ok {
  color: #0f3d28;
  background: #8fd9ae;
  box-shadow: 0 0 0 2px rgba(47, 107, 79, 0.25);
}

.avail-banner--miss {
  color: #5c1510;
  background: #f0a39a;
  box-shadow: 0 0 0 2px rgba(163, 59, 43, 0.28);
}

.recipe-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.recipe-card--ready {
  border-color: rgba(47, 107, 79, 0.55);
  background: linear-gradient(135deg, rgba(143, 217, 174, 0.28), rgba(255, 255, 255, 0.85));
  box-shadow: inset 4px 0 0 #2f6b4f;
}

.recipe-card--miss {
  border-color: rgba(163, 59, 43, 0.45);
  background: linear-gradient(135deg, rgba(240, 163, 154, 0.22), rgba(255, 255, 255, 0.85));
  box-shadow: inset 4px 0 0 #a33b2b;
}

.kind-tag {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kind-tag--kochen {
  background: rgba(47, 74, 107, 0.15);
  color: #243a56;
}

.kind-tag--backen {
  background: rgba(183, 121, 31, 0.18);
  color: #7a4d12;
}

.kind-filter {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.kind-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  min-height: var(--tap);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.kind-chip.active {
  background: var(--bg2);
  color: #f3eee4;
  border-color: transparent;
}

.ing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0.25rem;
}

.ing-chip {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.ing-chip--ok {
  background: rgba(47, 107, 79, 0.16);
  color: #1d5a3a;
}

.ing-chip--miss {
  background: rgba(163, 59, 43, 0.16);
  color: #8a2a1f;
}

.ing-chip--part {
  background: rgba(183, 121, 31, 0.18);
  color: #7a4d12;
}

.stock-suggest-panel {
  margin-bottom: 1rem;
}

.stock-pick-search {
  margin: 0.65rem 0 0.55rem;
}

.stock-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.stock-pick-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
  cursor: pointer;
  min-width: 0;
}

.stock-pick-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-pick-item input {
  width: auto;
  min-width: 1.1rem;
  margin: 0;
}

.stock-focus-hint {
  font-weight: 700;
  color: var(--ok);
  margin-bottom: 0.35rem;
}

.stock-focus-actions {
  margin-top: 0.85rem;
}

.stock-focus-actions .btn {
  flex: 1 1 auto;
}



.inv-toolbar {
  align-items: stretch;
}

.meta-manager .meta-name {
  width: 100%;
}

.meta-row {
  align-items: center;
}

@media (max-width: 720px) {
  .inv-toolbar {
    grid-template-columns: 1fr;
  }

  .inv-toolbar #inv-search {
    grid-column: 1 / -1;
  }
}


/* ========== Mobile ========== */
@media (max-width: 720px) {
  :root {
    --nav-h: 4.35rem;
  }

  body {
    background-attachment: scroll; /* bessere Performance auf Mobil */
  }

  .shell {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .topbar {
    margin-bottom: 0.65rem;
  }

  .topbar .brand { font-size: 1.15rem; }

  .topbar .btn-row {
    gap: 0.35rem;
  }

  .topbar .btn.ghost {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    min-height: 2.4rem;
  }

  /* Untere Navigation */
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.15rem;
    margin: 0;
    padding: 0.35rem 0.3rem calc(0.35rem + var(--safe-bottom));
    background: rgba(26, 42, 34, 0.96);
    border-top: 1px solid rgba(243, 238, 228, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: visible;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22);
  }

  .tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    border-radius: 10px;
    padding: 0.4rem 0.15rem;
    font-size: 0.68rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }

  .tab-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .main {
    border-radius: 14px;
    padding: 0.95rem 0.8rem 1.15rem;
  }

  .page-head.row {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head .btn-row {
    width: 100%;
  }

  .page-head .btn-row .btn {
    flex: 1 1 auto;
  }

  .lead {
    max-width: none;
    font-size: 0.92rem;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .toolbar input[type="search"],
  .toolbar input[type="text"]:first-child,
  #shop-quick input[name="name"],
  #barcode-manual input[name="barcode"] {
    grid-column: 1 / -1;
    width: 100%;
    flex: none;
  }

  #shop-quick .w-qty,
  #shop-quick .w-unit {
    width: 100%;
  }

  #shop-quick .btn,
  #barcode-manual .btn {
    width: 100%;
  }

  .item-card {
    grid-template-columns: 1fr;
  }

  .stock-move-card {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .stock-move-info {
    flex: 1 1 100%;
  }

  .stock-adjust {
    width: 100%;
  }

  .stock-btn {
    flex: 1 1 0;
    min-height: 3.8rem;
  }

  .item-card .btn-row {
    width: 100%;
    flex-direction: row;
  }

  .item-card .btn-row .btn {
    flex: 1 1 auto;
  }

  .item-card .btn-row[style*="column"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .modal-body {
    max-height: 100dvh;
    padding: 1.25rem 1rem calc(1.25rem + var(--safe-bottom));
    padding-top: 1.5rem;
  }

  .modal-body .btn-row.end {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--surface-solid) 70%, transparent);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
  }

  .modal-body .btn-row.end .btn {
    flex: 1;
  }

  .product-preview {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .stat {
    padding: 0.8rem;
  }

  .input-with-action {
    flex-wrap: wrap;
  }

  .input-with-action .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .tab {
    font-size: 0.62rem;
    padding: 0.35rem 0.1rem;
  }

  .topbar .btn.ghost {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Desktop: Tabs oben belassen */
@media (min-width: 721px) {
  .shell {
    padding: 1rem 1rem 5rem;
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (hover: none) {
  .btn:hover,
  .tab:hover,
  .item-card:hover {
    transform: none;
    box-shadow: none;
  }
}
