/* Layout and components. All colors and sizes come from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }

html, body { background: var(--color-bg); }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-m);
  line-height: 1.35;
  color: var(--color-text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.app {
  max-width: var(--column-max);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--tap-min) + 2 * var(--space-3) + 16px + env(safe-area-inset-bottom));
}
main:focus { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
/* Stays white in every theme so the black logo is always legible. */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--space-2) 0 var(--space-4);
  background: #ffffff;
  border-bottom: 1px solid var(--color-line);
}
.logo { display: inline-flex; align-items: center; min-height: var(--tap-min); }
.logo img { height: 34px; width: auto; }
.cart-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap-min); height: var(--tap-min); border-radius: var(--radius-pill);
  color: var(--brand-ink); text-decoration: none;
}
.badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill);
  background: var(--color-accent); color: #ffffff;
  border: 2px solid #ffffff; box-sizing: content-box;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.topbar-actions { display: flex; align-items: center; gap: var(--space-1); }
/* Language switch: RU / KZ */
.lang { display: flex; padding: 3px; border-radius: var(--radius-pill); background: #f1f3f5; }
.lang button {
  min-width: 36px; height: 30px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: #6d6b6b; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.04em; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--brand-ink); color: #ffffff; }
.badge.bump { animation: bump 0.3s ease; }
@keyframes bump { 50% { transform: scale(1.25); } }

/* ---------- Catalog ---------- */
.hero { padding: var(--space-4) var(--space-4) 0; }
.hero-title { font-size: var(--fs-xxl); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.hero-title span { color: var(--color-accent); }

.search { position: relative; margin: var(--space-4) var(--space-4) 0; }
.search .field-label { margin-bottom: var(--space-2); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.search-box .input { padding-left: 42px; border-radius: var(--radius-pill); }

.benefits {
  display: flex; gap: var(--space-2); overflow-x: auto;
  margin: var(--space-4) 0 0; padding: 0 var(--space-4); list-style: none;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-4); scrollbar-width: none;
}
.benefits::-webkit-scrollbar { display: none; }
.benefit {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--space-3);
  min-width: 210px; padding: var(--space-3) var(--space-4);
  background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-m);
  scroll-snap-align: start;
}
.benefit-icon {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-pill); background: var(--color-tint); color: var(--brand-ink);
}
.benefit-icon svg { color: var(--color-accent); }
.benefit-title { font-size: var(--fs-s); font-weight: 600; }
.benefit-text { font-size: var(--fs-xs); color: var(--color-muted); }

.chips {
  display: flex; gap: var(--space-2); overflow-x: auto;
  margin-top: var(--space-5); padding: 0 var(--space-4);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 var(--space-4);
  border: 1px solid var(--color-line); border-radius: var(--radius-pill);
  background: var(--color-card); cursor: pointer; font-size: var(--fs-s); font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.chip-count { margin-left: 6px; opacity: 0.55; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: var(--space-5) var(--space-4) var(--space-3);
}
.section-title { font-size: var(--fs-l); font-weight: 700; }
.section-meta { font-size: var(--fs-s); color: var(--color-muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); padding: 0 var(--space-4); }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-l);
  overflow: hidden;
}
.card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: var(--space-3) var(--space-3) 0; }
.code { font-size: var(--fs-xs); color: var(--color-muted); letter-spacing: 0.01em; }
.card-name {
  margin-top: var(--space-1); font-size: 14px; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3); margin-top: auto; }
.price { font-size: 16px; font-weight: 700; color: var(--color-text); white-space: nowrap; }
.unit { font-size: var(--fs-xs); font-weight: 400; color: var(--color-muted); }
.old-price { font-size: var(--fs-xs); color: var(--color-muted); text-decoration: line-through; }
.empty-note { grid-column: 1 / -1; padding: var(--space-6) 0; text-align: center; color: var(--color-muted); }

/* Product photo: the source JPEGs are small (~110 px) and white-backed,
   so they sit centered on white at a modest size instead of being stretched. */
.photo {
  display: grid; place-items: center; aspect-ratio: 1 / 1;
  background: #ffffff;
}
.photo img { width: 72%; height: 72%; object-fit: contain; }
.card .photo { border-bottom: 1px solid var(--color-line); }
.photo-missing {
  color: var(--color-subtle); font-size: var(--fs-xs); text-align: center; gap: var(--space-2); align-content: center;
  background: linear-gradient(180deg, #ffffff, var(--color-tint));
}
.photo-missing svg { color: var(--brand-cyan); opacity: 0.8; }
.cart-row .photo-missing svg, .form-item .photo-missing svg, .sheet-item .photo-missing svg { width: 20px; height: 20px; }
.cart-row .photo-missing span, .sheet-item .photo-missing span { display: none; }

/* Discount from the site's old price */
.sale-tag {
  position: absolute; top: var(--space-2); left: var(--space-2);
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--brand-cyan); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700;
}

/* Add button / inline stepper on cards */
.add-round {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill);
  background: var(--color-add); color: var(--color-on-add); cursor: pointer;
}
.mini-stepper {
  display: inline-flex; align-items: center; height: 40px;
  border-radius: var(--radius-pill); background: var(--color-green-tint);
}
.mini-stepper button {
  width: 36px; height: 40px; border: 0; background: transparent; cursor: pointer;
  font-size: 18px; font-weight: 600; color: var(--brand-ink);
}
.mini-stepper output { min-width: 18px; text-align: center; font-weight: 700; font-size: var(--fs-s); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%; min-height: 52px; padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-m);
  background: var(--color-primary); color: var(--color-on-primary);
  font-size: var(--fs-m); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-add { background: var(--color-add); color: var(--color-on-add); }
.btn-ghost { background: var(--color-card); color: var(--color-text); border: 1px solid var(--color-line); }
.btn-sum { opacity: 0.7; font-weight: 500; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-width: var(--column-max); margin: 0 auto;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--color-card); box-shadow: var(--shadow-bar);
}

/* ---------- Panels ---------- */
.screen-head { padding: var(--space-4) var(--space-4) var(--space-3); }
.screen-title { font-size: var(--fs-xl); font-weight: 700; }
.screen-sub { margin-top: 2px; font-size: var(--fs-s); color: var(--color-muted); }
.panel {
  margin: 0 var(--space-4) var(--space-3); padding: var(--space-4);
  background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-l);
}
.panel-title { margin-bottom: var(--space-3); font-size: var(--fs-m); font-weight: 700; }

/* ---------- Product ---------- */
.product-photo {
  position: relative; margin: var(--space-4); border: 1px solid var(--color-line); border-radius: var(--radius-l); overflow: hidden;
}
.product-photo .photo { aspect-ratio: 4 / 3; }
.product-photo .photo img { width: 60%; height: 60%; }
.product-info { padding: 0 var(--space-4); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--color-card); border: 1px solid var(--color-line);
  font-size: var(--fs-xs); color: var(--color-muted);
}
.product-name { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.product-price { display: flex; align-items: baseline; gap: var(--space-2); margin-top: var(--space-3); }
.product-price .price { font-size: var(--fs-xxl); }
.stock { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2); font-size: var(--fs-s); color: var(--color-text); }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green); }
.stock-unknown { color: var(--color-muted); }
.stock-unknown::before { background: var(--brand-grey); }
.note {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--color-tint); border-radius: var(--radius-m);
  font-size: var(--fs-s);
}
.note svg { flex: none; margin-top: 1px; color: var(--color-accent); }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 0 var(--space-4); }
.qty-label { font-size: var(--fs-s); color: var(--color-muted); }

/* ---------- Cart ---------- */
.cart-list { margin: 0 var(--space-4); padding: 0; list-style: none; }
.cart-row {
  display: grid; grid-template-columns: 72px 1fr; gap: var(--space-3);
  padding: var(--space-3); margin-bottom: var(--space-2);
  background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-l);
}
.cart-row .photo { border-radius: var(--radius-m); border: 1px solid var(--color-line); }
.cart-row .photo img { width: 80%; height: 80%; }
.cart-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.cart-unit-price { margin-top: 2px; font-size: var(--fs-xs); color: var(--color-muted); }
.cart-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); }
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-card);
}
.stepper button {
  width: var(--tap-min); height: 40px; border: 0; background: transparent;
  font-size: 18px; font-weight: 600; cursor: pointer;
}
.stepper output { min-width: 24px; text-align: center; font-weight: 600; }
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--fs-s); color: var(--color-muted); }
.summary-row.total { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--color-line); font-size: var(--fs-l); color: var(--color-text); }
.summary-row.total strong { font-weight: 700; }
.empty { display: grid; justify-items: center; gap: var(--space-3); padding: 56px var(--space-6); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--color-tint); color: var(--color-accent); }
.empty p { color: var(--color-muted); }
.empty .btn { width: auto; padding: 0 var(--space-6); }

/* ---------- Checkout ---------- */
.field-label { display: block; margin-bottom: 6px; font-size: var(--fs-s); font-weight: 500; }
.optional { color: var(--color-muted); font-weight: 400; }
.input {
  width: 100%; min-height: 48px; padding: 0 var(--space-4);
  border: 1px solid var(--color-line); border-radius: var(--radius-m);
  background: var(--color-card);
}
textarea.input { min-height: 80px; padding: var(--space-3) var(--space-4); resize: vertical; }
.input:focus { border-color: var(--color-accent); outline: none; box-shadow: 0 0 0 3px var(--color-tint); }
.input[aria-invalid="true"] { border-color: var(--color-error); }
.form-field + .form-field { margin-top: var(--space-3); }
.error { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: var(--fs-s); color: var(--color-error); }
fieldset { margin: 0; padding: 0; border: 0; }
fieldset + fieldset, fieldset + .form-field, .form-field + fieldset, fieldset + .helper + fieldset { margin-top: var(--space-4); }
legend { margin-bottom: 6px; padding: 0; font-size: var(--fs-s); font-weight: 500; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-m); background: var(--color-bg); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 40px;
  border-radius: var(--radius-s); font-size: var(--fs-s); font-weight: 500; cursor: pointer;
}
.segmented input:checked + span { background: var(--color-card); color: var(--color-text); box-shadow: 0 0 0 1px var(--color-line); font-weight: 700; }
.segmented input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.helper { margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--color-muted); }

/* ---------- Order created ---------- */
.success { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4) var(--space-4); text-align: center; }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--color-tint); color: var(--color-accent); }
.order-number { font-size: var(--fs-xl); font-weight: 700; }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: var(--radius-pill); background: var(--color-green-tint); font-size: var(--fs-s); font-weight: 500;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-green); }
.doc-card { display: flex; align-items: center; gap: var(--space-3); }
.doc-icon {
  flex: none; display: grid; place-items: center; width: 44px; height: 52px;
  border-radius: var(--radius-s); background: #fdecea; color: var(--color-error);
  font-size: 10px; font-weight: 800;
}
.doc-name { font-size: var(--fs-s); font-weight: 600; word-break: break-word; }
.doc-hint { margin-top: 2px; font-size: var(--fs-xs); color: var(--color-muted); }

/* Order form preview: mirrors "Бланк заказа покупателя" (Форма № 2) */
.form-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-3); margin: 0; font-size: var(--fs-s); }
.form-meta dt { color: var(--color-muted); }
.form-meta dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.form-items { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--color-line); }
.form-item { display: grid; grid-template-columns: 22px 52px 1fr; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-line); }
.form-item-no { font-size: var(--fs-s); color: var(--color-muted); text-align: center; }
.form-item .photo { border: 1px solid var(--color-line); border-radius: var(--radius-s); }
.form-item .photo img { width: 86%; height: 86%; }
.form-item .photo-missing { font-size: 8px; line-height: 1.1; padding: 2px; }
.form-item-name { font-size: var(--fs-s); font-weight: 500; line-height: 1.3; }
.form-item-calc { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: 4px; font-size: var(--fs-xs); color: var(--color-muted); }
.form-item-calc strong { color: var(--color-text); font-size: var(--fs-s); }
.form-total { display: flex; justify-content: space-between; padding-top: var(--space-3); font-weight: 700; }
.form-words { margin-top: var(--space-2); font-size: var(--fs-s); font-style: italic; }
.done-actions { display: grid; gap: var(--space-2); margin: var(--space-4); }

/* ---------- Buyer type ---------- */
.buyer-choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.buyer-choice label { position: relative; }
.buyer-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.buyer-choice span {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  min-height: 76px; padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius-m);
  background: var(--color-card); font-size: var(--fs-s); font-weight: 600; cursor: pointer;
}
.buyer-choice svg { color: var(--color-muted); }
.buyer-choice input:checked + span { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); background: var(--color-tint); }
.buyer-choice input:checked + span svg { color: var(--color-accent); }
.buyer-choice input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.buyer-fields { margin-top: var(--space-4); }

/* ---------- "Frequently bought together" sheet ---------- */
body.sheet-open { overflow: hidden; }
#sheet-root { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(11, 7, 11, 0.45); animation: fade 0.2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--column-max); max-height: 85vh; margin: 0 auto; overflow-y: auto;
  padding: var(--space-2) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--color-card); border-radius: var(--radius-l) var(--radius-l) 0 0;
  animation: rise 0.25s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop, .badge.bump { animation: none; } }
.sheet-grip { width: 40px; height: 4px; margin: 0 auto var(--space-3); border-radius: var(--radius-pill); background: var(--color-line); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.sheet-title { font-size: var(--fs-l); font-weight: 700; }
.sheet-sub {
  margin-top: 2px; font-size: var(--fs-s); color: var(--color-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.icon-btn {
  flex: none; display: grid; place-items: center; width: var(--tap-min); height: var(--tap-min); margin: -6px -10px 0 0;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-muted); cursor: pointer;
}
.sheet-list { margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.sheet-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-3); align-items: center;
  padding: var(--space-3) 0; border-top: 1px solid var(--color-line);
}
.sheet-item .photo { border: 1px solid var(--color-line); border-radius: var(--radius-s); }
.sheet-item .photo img { width: 86%; height: 86%; }
.sheet-item-name {
  font-size: var(--fs-s); font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sheet-item .price { display: block; margin-top: 2px; font-size: 15px; }
.added { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: #2f7d68; }
.sheet-actions { display: grid; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- Larger screens ----------
   Phone (< 560px): one narrow column, as designed for Telegram.
   Large phone / small tablet (560px+): 3 product columns.
   Tablet and laptop (768px+): wide container, two-column product, cart and
   checkout pages with the summary at the side; the action button sits in the
   page instead of a fixed bottom bar, and the suggestions sheet becomes a dialog.
   Laptop (1024px+): 4 columns; wide desktop (1280px+): 5 columns. */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  :root { --column-max: 1200px; }
  .app { padding: 0 var(--space-5) var(--space-6); }

  /* Header background runs edge to edge while its content stays in the column. */
  .topbar {
    margin: 0 calc(-1 * var(--space-5)); padding: 0 var(--space-5);
    box-shadow: 0 0 0 100vmax #ffffff, 0 1px 0 100vmax var(--color-line);
    clip-path: inset(0 -100vmax -1px);
  }

  .hero { padding-top: var(--space-6); }
  .hero-title { font-size: 34px; }
  .search { max-width: 560px; }
  .benefits { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .benefit { min-width: 0; }
  .chips { flex-wrap: wrap; overflow: visible; }

  .grid { gap: var(--space-4); }
  .card { transition: box-shadow 0.15s ease, transform 0.15s ease; }

  /* The bar becomes an ordinary block inside the page. */
  .bottom-bar {
    position: static; max-width: none; margin: var(--space-4) var(--space-4) 0; padding: 0;
    background: transparent; box-shadow: none;
  }

  /* Product: photo left, details right */
  .product-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6);
    align-items: start; padding-top: var(--space-5);
  }
  .product-layout .product-photo { margin: 0 0 0 var(--space-4); }
  .product-photo .photo { aspect-ratio: 1 / 1; }
  .product-main .product-info { padding-top: var(--space-2); }
  .product-name { font-size: 28px; }
  .product-main .bottom-bar .btn, .product-main .qty-row { max-width: 420px; }

  /* Cart and checkout: content left, summary and button right */
  .split {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-2);
    align-items: start;
  }
  .split > .cart-list { margin-right: 0; }
  .split > form .panel { margin-right: 0; }
  .split-side { position: sticky; top: 76px; }
  .split-side .panel { margin-left: 0; }
  .split-side .bottom-bar { margin: 0 var(--space-4) 0 0; }

  .screen-done { max-width: 680px; margin: 0 auto; }
  .screen-done .done-actions .btn { max-width: 320px; margin: 0 auto; }

  /* Suggestions: centered dialog instead of a bottom sheet */
  .sheet {
    top: 0; bottom: 0; height: fit-content; max-width: 480px; margin: auto;
    padding: var(--space-5); border-radius: var(--radius-l);
  }
  .sheet-grip { display: none; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .benefits { grid-template-columns: repeat(4, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr) 380px; }
  .product-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}

@media (hover: hover) and (min-width: 768px) {
  .card:hover { box-shadow: 0 6px 20px rgba(11, 7, 11, 0.08); transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }

/* ---------- Quick order ---------- */
.quick-entry {
  display: flex; flex-direction: column; gap: 2px;
  margin: var(--space-4) var(--space-4) 0; padding: var(--space-3) var(--space-4);
  background: var(--color-tint); border: 1px solid var(--color-line); border-radius: var(--radius-m);
  color: var(--color-text); text-decoration: none;
}
.quick-entry-title { font-weight: 600; }
.quick-entry-hint { font-size: var(--fs-xs); color: var(--color-muted); }
.quick-text { min-height: 130px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; white-space: pre; }
.quick-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.quick-actions .btn { width: auto; flex: 1 1 160px; }
.quick-upload { position: relative; cursor: pointer; }
.quick-empty { margin: var(--space-4); text-align: center; }
.quick-results { margin-bottom: var(--space-4); }
.quick-list { list-style: none; margin: 0; padding: 0 var(--space-4); display: grid; gap: var(--space-3); }
.quick-row {
  display: grid; gap: var(--space-2); padding: var(--space-3);
  background: var(--color-card); border: 1px solid var(--color-line); border-radius: var(--radius-m);
}
.quick-row.is-not_found { background: #f7f8f9; }
.quick-row.is-qty-missing { border-color: var(--color-accent); }
.quick-raw { font-size: var(--fs-s); color: var(--color-muted); word-break: break-word; }
.quick-line { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.quick-qty { display: block; }
.quick-qty .input { width: 110px; }
.quick-price { font-size: var(--fs-xs); color: var(--color-muted); }
.quick-sum { margin-left: auto; font-size: var(--fs-m); }
.quick-status { margin: 0; font-size: var(--fs-xs); color: var(--color-muted); }
.quick-remove {
  justify-self: start; min-height: var(--tap-min); padding: 0;
  border: 0; background: none; color: var(--color-muted); text-decoration: underline; cursor: pointer;
}
