:root {
  --paper: #eef3f9;
  --panel: #ffffff;
  --panel-muted: #f5f8fd;
  --border: #d9e2ee;
  --border-muted: #cfd9e6;
  --ink: #1b2430;
  --muted: #5a6a7d;
  --accent: #2f6df6;
  --accent-ink: #ffffff;
  --accent-border: #2459cf;
  --accent-soft: #e6efff;
  --accent-glow: rgba(47, 109, 246, 0.18);
  --accent-shadow: 0 12px 22px rgba(47, 109, 246, 0.25);
  --focus-ring: rgba(47, 109, 246, 0.35);
  --chip-bg: #eef3fb;
  --chip-ink: #2a3b55;
  --input-bg: #ffffff;
  --image-bg: #f3f6fb;
  --image-border: #d5deea;
  --positive-bg: #e4f6ec;
  --positive-border: #7ec99c;
  --positive-ink: #1e5f3a;
  --positive-ink-strong: #2f9f52;
  --positive-glow: rgba(47, 179, 90, 0.25);
  --negative-bg: #fde6e6;
  --negative-border: #e07b7b;
  --negative-ink: #7a2222;
  --warning-bg: #fff1e2;
  --warning-border: #f0d6bd;
  --warning-ink: #5a3c1d;
  --disabled-bg: #e7edf6;
  --disabled-border: #d7e0ee;
  --disabled-ink: #98a6b8;
  --control-bg: #ffffff;
  --control-border: #cfd9e6;
  --control-ink: #5a6a7d;
  --overlay: rgba(15, 22, 36, 0.45);
  --radius: 14px;
  --radius-sm: 12px;
  --shadow: 0 20px 44px rgba(18, 32, 52, 0.12);
  --shadow-soft: 0 10px 26px rgba(18, 32, 52, 0.08);
  --paper-gradient-1: #e6eef8;
  --paper-gradient-2: #f2f7fd;
  --topbar-bg: linear-gradient(180deg, #f6f9fd 0%, #eef3f9 100%);
  --footer-bg: #f4f7fb;
}

[data-theme="dark"] {
  --paper: #0f1522;
  --panel: #121b2b;
  --panel-muted: #162236;
  --border: #253046;
  --border-muted: #2b3950;
  --ink: #e6eef7;
  --muted: #a7b4c7;
  --accent: #3c7dff;
  --accent-ink: #ffffff;
  --accent-border: #2a60d8;
  --accent-soft: #1c2d4a;
  --accent-glow: rgba(60, 125, 255, 0.25);
  --accent-shadow: 0 12px 22px rgba(40, 90, 200, 0.35);
  --focus-ring: rgba(60, 125, 255, 0.5);
  --chip-bg: #1b2a44;
  --chip-ink: #c9d8ef;
  --input-bg: #101a2a;
  --image-bg: #0f1a2b;
  --image-border: #2b3950;
  --positive-bg: #10331f;
  --positive-border: #2f7a52;
  --positive-ink: #b8f0ce;
  --positive-ink-strong: #6ee69a;
  --positive-glow: rgba(110, 230, 154, 0.25);
  --negative-bg: #3b1a1a;
  --negative-border: #8a3e3e;
  --negative-ink: #f2b4b4;
  --warning-bg: #3a2a1a;
  --warning-border: #6a4a2a;
  --warning-ink: #f0d2b0;
  --disabled-bg: #1a2436;
  --disabled-border: #2a3a54;
  --disabled-ink: #6f8098;
  --control-bg: #121b2b;
  --control-border: #2b3950;
  --control-ink: #a7b4c7;
  --overlay: rgba(8, 12, 20, 0.6);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.32);
  --paper-gradient-1: #1b2435;
  --paper-gradient-2: #121a28;
  --topbar-bg: linear-gradient(180deg, #151e2f 0%, #0f1522 100%);
  --footer-bg: #111827;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 500px at 10% 0%, var(--paper-gradient-1) 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 0%, var(--paper-gradient-2) 0%, transparent 55%),
              var(--paper);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px clamp(14px, 3vw, 26px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__center {
  display: flex;
  align-items: center;
}

.topbar__search {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.topbar__search input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(47, 109, 246, 0.12);
}

.filter-button {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.brand {
  display: grid;
  gap: 2px;
}

.brand__logo {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}

.brand__title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.4px;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton-bg, #e3e8f1);
  border-radius: 10px;
}

[data-theme="dark"] .skeleton {
  background: var(--skeleton-bg, #1b2740);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.6s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.skeleton-card .card__image {
  min-height: 140px;
}

.skeleton-line {
  height: 12px;
  margin: 8px 0;
}

.skeleton-line--title {
  height: 18px;
  margin-top: 2px;
}

.skeleton-line--short {
  width: 55%;
}

.skeleton-line--medium {
  width: 75%;
}

.skeleton-chip {
  height: 22px;
  width: 90px;
  border-radius: 999px;
}

.skeleton-pill {
  height: 34px;
  width: 110px;
  border-radius: 999px;
}

.skeleton-pill--icon {
  width: 36px;
}

.skeleton-pill--small {
  width: 80px;
  height: 28px;
}

.position-item.skeleton-item {
  padding: 16px;
}

@keyframes shimmer {
  100% {
    transform: translateX(120%);
  }
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px clamp(14px, 3vw, 24px) 44px;
  align-items: start;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding: 18px clamp(18px, 3vw, 32px) 32px;
  background: var(--footer-bg);
}

.footerGrid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  align-items: start;
  font-size: 13px;
  color: var(--muted);
}

.footerText {
  font-size: 13px;
}

.brand-switcher {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.footer-toggle {
  justify-self: start;
}

.brand-switcher img {
  height: 22px;
  width: auto;
}

.impressum summary {
  cursor: pointer;
  font-weight: 600;
}

.impressum img {
  height: 20px;
  margin: 8px 0 6px;
}

.impressum p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.corner-tools {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 70;
}

.help-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-muted);
  font-weight: 700;
  color: var(--muted);
}

.debug-button {
  width: 40px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}

.debug-panel {
  position: fixed;
  right: 18px;
  bottom: 62px;
  width: min(360px, 92vw);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  z-index: 70;
}

.corner-tools button {
  position: relative;
}

.corner-tools button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.corner-tools button[data-tooltip]:hover::after,
.corner-tools button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.debug-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.debug-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.debug-panel__body {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  white-space: pre-line;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 80;
  pointer-events: none;
}

.tutorial-highlight {
  position: absolute;
  display: none;
}

.tutorial-bubble {
  position: fixed;
  max-width: 320px;
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.tutorial-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.tutorial-step {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tutorial-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.tutorial-target {
  position: relative;
  z-index: 81;
}

.tutorial-blink {
  animation: tutorialBlink 1.1s ease-in-out infinite;
}

@keyframes tutorialBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 109, 246, 0.0); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px rgba(47, 109, 246, 0.18); transform: scale(1.03); }
}


.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel__header h2 {
  margin: 0;
  font-size: 18px;
}

.results-meta {
  display: grid;
  gap: 4px;
}

.results-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.view-toggle-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.view-toggle-button.is-active {
  border-color: var(--accent-border);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

.preselect-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  margin-bottom: 12px;
}

.preselect-banner__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.preselect-banner__name {
  font-weight: 600;
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

button {
  font-family: inherit;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.accent-button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent-border);
  box-shadow: var(--accent-shadow);
}

.accent-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--border-muted);
}

.upsell-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.sort-toggle {
  min-width: 52px;
  text-align: center;
}

.category-button {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--panel-muted);
  text-align: left;
  color: var(--ink);
}

.category-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

[data-theme="dark"] .category-button {
  color: #e6eef7;
}

.results-list {
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid transparent;
  border-bottom: 1px solid var(--border-muted);
  border-radius: 0;
  padding: 12px 6px;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  background: transparent;
  position: relative;
  box-shadow: none;
}

.results-list.is-grid,
body[data-view="grid"] .results-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.results-list.is-grid .card,
body[data-view="grid"] .card {
  grid-template-columns: 1fr;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.results-list.is-grid .card__image,
body[data-view="grid"] .card__image {
  width: 100%;
  height: 180px;
}

.results-list.is-grid .card__image img,
body[data-view="grid"] .card__image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.results-list.is-grid .card__actions,
body[data-view="grid"] .card__actions {
  justify-items: start;
}

@media (max-width: 640px) {
  .results-list.is-grid,
  body[data-view="grid"] .results-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-list.is-grid .card__image,
  body[data-view="grid"] .card__image {
    height: 140px;
  }
}

.card.is-preselected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.preselect-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-ink);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
}

.preselect-clear:hover {
  color: var(--ink);
  border-color: var(--border);
}

.card.is-selected {
  border-color: var(--positive-border);
  box-shadow: 0 0 0 2px var(--positive-glow);
}

.card__image {
  width: 100%;
  height: 96px;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: none;
  padding: 0;
}

.card__image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.card__body h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.card__body p {
  margin: 0 0 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.card__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

.price {
  font-weight: 600;
  font-size: 15px;
}

.availability {
  font-size: 12px;
  color: var(--muted);
}

.preselect-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.card__actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.results-list > .card:last-child {
  border-bottom-color: transparent;
}

.icon-button {
  border: none;
  background: transparent;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
}

.inline-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.icon-text {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 16px;
  line-height: 1;
}

.inline-qty {
  min-width: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  color: var(--ink);
}

.card__actions button {
  white-space: nowrap;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  justify-content: center;
  align-items: center;
}

.pagination button {
  border-radius: 8px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 20px;
}

.pagination button.is-active {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  justify-content: flex-start;
}

.pagination-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
}

.page-size label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.range-panel {
  margin-top: 20px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.production-day {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.production-days input {
  text-align: center;
}

.calendar-wrap {
  display: grid;
  gap: 0;
}

.range-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 16px;
}

.calendar-controls {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.calendar-label {
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .calendar-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-controls {
    width: 100%;
  }

  .production-day {
    grid-template-columns: 1fr;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
}

.calendar-cell {
  height: 32px;
  border-radius: 2px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  background: transparent;
}

.calendar-cell--label {
  background: transparent;
  font-weight: 600;
  color: var(--muted);
  border: none;
}

.calendar-cell--empty {
  background: transparent;
  border: none;
}

.calendar-cell--day {
  cursor: pointer;
}

[data-theme="dark"] .calendar-cell {
  color: #e6eef7;
}

[data-theme="dark"] .calendar-cell--label {
  color: #b8c5d9;
}

.calendar-cell--day.is-disabled {
  cursor: not-allowed;
  color: var(--disabled-ink);
  background: transparent;
  border-color: var(--border-muted);
}

.calendar-cell--day:hover {
  border-color: var(--accent);
}

.calendar-cell--day.is-range {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.calendar-cell--day.is-active-range {
  background: var(--positive-bg);
  border-color: var(--positive-border);
  color: var(--positive-ink);
}

.calendar-cell--day.is-offday {
  background: var(--negative-bg);
  border-color: var(--negative-border);
  color: var(--negative-ink);
  font-weight: 700;
}

.calendar-legend {
  display: flex;
  gap: 12px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.legend-swatch--green {
  background: var(--positive-bg);
  border-color: var(--positive-border);
}

.legend-swatch--red {
  background: var(--negative-bg);
  border-color: var(--negative-border);
}

.calendar-cell--day.is-start,
.calendar-cell--day.is-end {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-border);
  font-weight: 700;
}

.calendar-selection {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.calendar-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.icon-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

.positions-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.position-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: grid;
  gap: 8px;
  background: var(--panel-muted);
}

.position-item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.position-name {
  font-weight: 600;
  font-size: 14px;
}

.position-meta {
  margin-top: 4px;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.position-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stepper {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.stepper button {
  border: none;
  background: var(--panel);
  padding: 4px 10px;
  font-weight: 600;
}

.stepper span {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
}

.remove-button {
  background: transparent;
  border: none;
  padding: 2px;
  color: var(--negative-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.remove-button svg {
  width: 18px;
  height: 18px;
}

.positions-flags {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  color: var(--ink);
}

.customer-fields {
  display: grid;
  gap: 10px;
}

.note-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-muted);
  background: var(--panel-muted);
}

.positions-actions {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.price-summary {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-muted);
  background: var(--panel-muted);
  display: grid;
  gap: 12px;
}

.price-summary__header h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.price-summary__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.small-button {
  padding: 6px 12px;
  font-size: 12px;
}

.price-summary__list {
  display: grid;
  gap: 8px;
}

.price-summary__compact {
  font-size: 12px;
  color: var(--muted);
}

.price-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.price-row__name {
  font-weight: 600;
}

.price-row__unit,
.price-row__total {
  text-align: right;
}

.price-summary__totals {
  display: grid;
  gap: 6px;
}

.price-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.price-total-row.is-grand {
  font-size: 15px;
  font-weight: 700;
}

.discount {
  color: var(--positive-ink-strong);
  font-weight: 600;
}

.upsell {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-muted);
}

.upsell h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.upsell-list {
  display: grid;
  gap: 8px;
}

.upsell-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
  border: 1px solid var(--border);
}

.notice {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 30;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
  z-index: 60;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 40;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
}

.modal__content {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 40px);
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal__content--wide {
  max-width: 640px;
  text-align: left;
}

.upsell-modal__main-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-muted);
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}

.upsell-modal__title {
  font-weight: 700;
  font-size: 16px;
}

.upsell-modal__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
}

.upsell-modal__image {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px dashed var(--image-border);
  background: var(--image-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.upsell-modal__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.upsell-modal__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upsell-flag {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.upsell-modal__list {
  display: grid;
  gap: 8px;
}

.modal__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--ink);
}

.drawer-open {
  overflow: hidden;
}

[data-drawer] {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar__actions {
    justify-content: space-between;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .footerGrid {
    text-align: center;
  }

  .brand-switcher {
    justify-content: center;
  }

  .footer-toggle {
    justify-self: center;
  }

  [data-drawer] {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(360px, 86vw);
    max-height: none;
    transform: translateX(-120%);
    transition: transform 0.2s ease;
    z-index: 50;
    background: var(--panel);
  }

  [data-drawer="right"] {
    right: 0;
    left: auto;
    transform: translateX(120%);
  }

  [data-drawer].is-open {
    transform: translateX(0);
  }

  .close-button {
    display: inline-flex;
  }

  .categories,
  .positions {
    box-shadow: var(--shadow);
  }
}

@media (min-width: 1101px) {
  #openCategories,
  .close-button {
    display: none;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px clamp(18px, 3vw, 32px);
  }

  .topbar__search {
    justify-content: center;
  }

  .topbar__search input {
    max-width: 360px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .layout {
    grid-template-columns: minmax(200px, 0.9fr) minmax(0, 2.4fr) minmax(260px, 1.1fr);
    gap: 18px;
    padding: 20px clamp(18px, 3vw, 32px) 60px;
  }

  .footerGrid {
    grid-template-columns: 1fr auto auto 1fr;
  }

  .footer-toggle {
    justify-self: center;
  }
}

@media (max-width: 700px) {
  .card {
    grid-template-columns: 1fr;
  }

  .card__actions {
    justify-items: start;
  }

  body[data-view="list"] .card__image {
    width: 100px;
    height: 100%;
    border-radius: 0;
    background: transparent;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: none;
    padding: 0;
  }

  .panel {
    padding: 12px;
  }

  .topbar__left .brand__subtitle {
    display: none;
  }

  .results-controls {
    gap: 6px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  padding: 12px 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}

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