:root {
  --ink: #171a1a;
  --paper: #eef1ec;
  --panel: #ffffff;
  --line: #d8ded7;
  --accent: #0b6e4f;      /* till-green: the confirm / brand color */
  --accent-dim: #e1f0ea;
  --accent-ink: #06432f;
  --warn: #c97a12;        /* amber: used sparingly for editable-price / attention */
  --danger: #b3261e;
  --muted: #6b7570;
  --radius: 10px;

  --font-ui: -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
}

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("../fonts/NotoNastaliqUrdu.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

/* Urdu text runs right-to-left and needs its own line-height/size tuning —
   Nastaliq's vertical stacking style needs more room than Latin text to
   avoid clipping diacritics/loops. */
.urdu {
  font-family: var(--font-urdu);
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 2.1;
  display: block;
}
.urdu-inline {
  font-family: var(--font-urdu);
  direction: rtl;
  unicode-bidi: isolate;
}
.bi-en { display: block; }
.bi-ur { font-size: 0.92em; color: var(--muted); margin-top: 1px; }
.cat-tab-ur { display: block; font-size: 12px; opacity: 0.85; line-height: 1.8; margin-top: 1px; }
.item-name-ur { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cart-item-name-ur { font-size: 12px; color: var(--muted); line-height: 1.8; }
.receipt-item-name-ur { font-size: 0.85em; color: #555; margin-top: 1px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}

button, input, select {
  font-family: inherit;
}

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

/* Numbers throughout the app share the receipt's monospace so screen totals
   always line up visually with what actually gets printed. */
.item-price,
.cart-item-price,
.cart-summary .row span:last-child,
.ticket-number,
.report-row span:last-child {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.brand-mark {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 5px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; opacity: 0.75; font-size: 13px; margin-right: 4px; }

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(238,241,236,0.35);
  color: var(--paper);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.ghost-btn:hover { background: rgba(238,241,236,0.1); }
.ghost-btn.dark {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.ghost-btn.dark:hover { background: var(--paper); }

/* Layout */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  overflow: hidden;
}

/* Menu pane */
.menu-pane { padding: 18px; overflow-y: auto; }

.menu-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.cat-tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.item-search {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  min-width: 180px;
}
.item-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: transform 0.06s ease, box-shadow 0.06s ease, border-color 0.06s ease;
}
.item-card:active { transform: scale(0.97); }
.item-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); border-color: var(--accent); }
.item-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.item-thumb-icon { font-size: 22px; line-height: 1; }
.item-thumb-photo { width: 100%; height: 100%; object-fit: cover; }
.item-name { font-weight: 600; font-size: 15px; }
.item-price { color: var(--accent-ink); font-weight: 700; font-size: 15px; }

/* Cart pane */
.cart-pane {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0; /* critical: without this, a grid/flex item won't shrink
                    below its content size, so a long cart pushes the
                    checkout button out past the visible area instead of
                    the item list scrolling internally */
}

/* Signature element: the order header looks like the stub of a torn receipt,
   echoing the physical ticket this panel is about to produce. */
.ticket-stub {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
  position: relative;
}
.ticket-stub::after {
  content: "";
  position: absolute;
  left: -18px; right: -18px; bottom: -1px;
  height: 1px;
  background-image: radial-gradient(circle, var(--paper) 2px, transparent 2.5px);
  background-size: 10px 1px;
  background-repeat: repeat-x;
}
.ticket-stub-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ticket-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ticket-number { font-size: 22px; font-weight: 700; color: var(--accent-ink); }
.table-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.table-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cart-list { flex: 1; min-height: 0; overflow-y: auto; margin-bottom: 12px; }
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-info { display: flex; flex-direction: column; min-width: 0; }
.cart-item-price { font-size: 12px; color: var(--muted); display: block; width: 100%; }
.cart-item-name-ur { display: block; width: 100%; text-align: right; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
}
.qty-btn:hover { border-color: var(--accent); }
.editable-price {
  width: 60px;
  padding: 2px 4px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  font-family: var(--font-mono);
  color: inherit;
}
.editable-price:hover, .editable-price:focus { border-color: var(--line); background: var(--panel); }
.editable-price.price-overridden {
  border-color: var(--warn);
  background: #fdf3e3;
  font-weight: 600;
}

.cart-summary { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 12px; }
.discount-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.discount-row label { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.discount-row select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; }
.discount-row input { width: 80px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; text-align: right; }
#discountRow span:last-child { color: var(--warn); }
.cart-summary .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: var(--muted);
}
.cart-summary .row.total {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}

.checkout-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}
.checkout-btn:hover { background: var(--accent-ink); }
.checkout-btn:disabled { opacity: 0.6; cursor: default; }

.secondary-actions { display: flex; gap: 8px; }
.app-credit {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.app-credit a { color: var(--muted); text-decoration: none; }
.app-credit a:hover { text-decoration: underline; }
.clear-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}
.clear-btn:hover { border-color: var(--danger); color: var(--danger); }
.clear-btn:disabled { opacity: 0.4; cursor: default; }
.clear-btn:disabled:hover { border-color: var(--line); color: var(--muted); }

.empty-note { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

/* Receipt (browser-print) — sized for on-screen preview here; the actual
   print dimensions come from the @media print block below, which targets
   an 80mm thermal roll specifically via @page. */
.receipt { width: 320px; }
.receipt-doc {
  font-family: var(--font-mono);
  color: #171a1a;
  text-align: center;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 18px 16px;
}
.receipt-header { margin-bottom: 6px; }
.receipt-logo { width: 100%; max-width: 260px; margin: 0 auto 6px; display: block; }
.receipt-name { font-family: var(--font-ui); font-weight: 700; font-size: 19px; margin-bottom: 4px; color: #0b6e4f; }
.receipt-contact { font-size: 10.5px; color: #555; line-height: 1.5; }
.receipt-flourish { color: #b08d57; font-size: 13px; margin: 10px 0; letter-spacing: 6px; }
.receipt-order-meta { text-align: left; margin: 8px 0; }
.receipt-order-meta .receipt-row { font-size: 11.5px; color: #444; padding: 1px 0; }
.receipt-order-number { font-weight: 700; color: #171a1a; }
.receipt-divider { border-top: 1px dashed #bbb; margin: 10px 0; }
.receipt-items-header {
  display: flex; justify-content: space-between;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: #999; margin-bottom: 4px; text-align: left;
}
.receipt-items { text-align: left; }
.receipt-row {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 12px; padding: 3px 0; text-align: left;
}
.receipt-item-row { padding: 6px 0; border-bottom: 1px dotted #eee; }
.receipt-item-name { flex: 1 1 auto; text-align: left; }
.receipt-item-index { font-weight: 700; margin-right: 4px; color: #555; }
.receipt-item-qty { flex: 0 0 auto; color: #777; font-size: 11px; }
.receipt-item-amt { flex: 0 0 auto; min-width: 60px; text-align: right; font-weight: 600; }
.receipt-total-box {
  background: #f4f8f6;
  border: 1px solid #d8ede4;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
}
.receipt-total { font-weight: 700; font-size: 16px; color: #0b6e4f; }
.receipt-discount span:last-child { color: #b02a2a; }
.receipt-thankyou {
  margin-top: 4px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  color: #171a1a;
}
.receipt-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #bbb;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.5;
  color: #444;
  white-space: pre-line;
}
.receipt-qr { width: 70px; height: 70px; margin: 12px auto 4px; display: block; }
.receipt-credit { margin-top: 4px; font-family: var(--font-ui); font-size: 9.5px; color: #999; }
.receipt-credit a { color: #999; text-decoration: none; }
.hidden { display: none !important; }

@media print {
  /* Fallback only — pos.js always injects an explicit width+height
     @page rule (#mpos-print-page-size) right before window.print(),
     measured from the receipt's actual rendered height, because "auto"
     isn't honoured reliably by every browser/thermal-printer driver and
     can otherwise print the receipt at the top of a much longer, mostly
     blank page. This rule only applies if that script ever fails to run. */
  @page {
    size: 80mm auto;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 80mm;
    height: auto !important;   /* the app shell sets 100vh for on-screen layout — that must not leak into the printed page's height calculation */
    min-height: 0 !important;
  }

  /* Hard catch-all: nothing on the page prints except the receipt itself,
     no matter what else exists in the markup. On a continuous thermal
     roll, any leftover on-screen element that isn't fully display:none
     doesn't just look wrong — it becomes extra blank paper the printer
     has to feed through before it can cut, which is what "printer keeps
     going after the receipt is done" almost always is. */
  body > *:not(#receipt) { display: none !important; }
  #receipt {
    display: block !important;
    width: 76mm !important;   /* ~2mm breathing room each side within the 80mm roll */
    margin: 0 auto !important;
    height: auto !important;
  }

  /* Thermal printers are pure black-on-white — screen-only touches like
     the brand-green accent color and thin/light font weights just come
     out faint and grey. Everything below forces solid black + heavier
     weights + bigger sizes so the printed copy is bold and legible, not
     just a smaller version of the on-screen preview.

     line-height is reset to a tight, fixed value on every text element
     rather than left to inherit — the default browser line-height (~1.5)
     is meant for comfortable on-screen reading, and on a narrow
     continuous roll it turns into noticeably loose, uneven gaps between
     lines and directly adds to how much blank paper gets fed. */
  .receipt-doc {
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 3mm 1mm !important;
    color: #000 !important;
    font-family: Arial, "Helvetica Neue", var(--font-ui), sans-serif !important;
    line-height: 1.25 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .receipt-doc * { line-height: 1.25 !important; }

  .receipt-header { margin-bottom: 4px !important; }
  .receipt-logo { max-width: 42mm !important; margin: 0 auto 4px !important; filter: grayscale(1) contrast(1.4) !important; }
  .receipt-name {
    color: #000 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px;
    margin-bottom: 2px !important;
  }
  .receipt-contact { color: #000 !important; font-size: 12px !important; font-weight: 600 !important; }

  .receipt-flourish { display: none !important; } /* the ornamental diamond glyph prints as a faint smudge on thermal paper */

  .receipt-order-meta { margin: 5px 0 !important; }
  .receipt-order-meta .receipt-row { font-size: 13px !important; font-weight: 700 !important; color: #000 !important; padding: 1px 0 !important; }
  .receipt-order-number { font-size: 15px !important; font-weight: 800 !important; }

  .receipt-divider { border-top: 2px solid #000 !important; margin: 6px 0 !important; }

  .receipt-items-header {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #000 !important;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #000 !important;
    padding-bottom: 3px !important;
    margin-bottom: 3px !important;
  }

  .receipt-item-row { border-bottom: 1px dashed #000 !important; padding: 4px 0 !important; break-inside: avoid; }
  .receipt-item-name { font-size: 14px !important; font-weight: 700 !important; color: #000 !important; }
  .receipt-item-index { color: #000 !important; font-weight: 800 !important; }
  .receipt-item-name-ur { color: #000 !important; font-weight: 600 !important; margin-top: 0 !important; }
  .receipt-item-qty { font-size: 12px !important; font-weight: 600 !important; color: #000 !important; }
  .receipt-item-amt { font-size: 14px !important; font-weight: 800 !important; color: #000 !important; }

  .receipt-row { font-size: 13.5px !important; font-weight: 700 !important; color: #000 !important; padding: 2px 0 !important; }
  .receipt-discount span:last-child { color: #000 !important; }

  /* Bold bordered block for the total — a border (not a filled background)
     so it always prints even if the browser's print dialog has "print
     background graphics" turned off. */
  .receipt-total-box {
    background: transparent !important;
    border: 3px solid #000 !important;
    border-radius: 0 !important;
    padding: 6px 10px !important;
    margin: 6px 0 !important;
  }
  .receipt-total {
    color: #000 !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px;
  }

  .receipt-thankyou { color: #000 !important; font-size: 14px !important; font-weight: 700 !important; margin-top: 2px !important; }
  .receipt-note { color: #000 !important; border-top: 1px dashed #000 !important; }
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(23,26,26,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  width: 380px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal-card h2 { margin-top: 0; }
.report-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.report-subhead { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 16px 0 4px; }

/* Settings modal */
.settings-card { width: 460px; }
.settings-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.settings-section label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}
.label-optional { font-weight: 400; color: var(--muted); font-size: 11px; }
.settings-section input[type="text"],
.settings-section input[type="number"],
.settings-section select,
.settings-section textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  font-family: inherit;
  resize: vertical;
}

.logo-upload-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; margin-bottom: 10px; }
.logo-preview-box {
  width: 56px; height: 56px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--paper);
}
.logo-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-upload-actions .ghost-btn { padding: 7px 12px; font-size: 13px; }
.logo-upload-status { font-size: 12px; color: var(--muted); }
.logo-upload-status.error { color: #b02a2a; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checkbox-row { display: flex !important; align-items: center; gap: 8px; }
.checkbox-row input { margin: 0; width: auto; }
.checkbox-row span { font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -4px 0 12px; }
.hint code { background: var(--paper); padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); }
.thermal-options.disabled { opacity: 0.45; pointer-events: none; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .checkout-btn { flex: 1; margin-bottom: 0; }
.modal-actions .ghost-btn { flex: 1; }
.export-actions { display: flex; gap: 10px; margin: 14px 0; }
.export-actions .ghost-btn { flex: 1; }

/* Menu Manager */
.menu-manager-card { width: 640px; max-width: 92vw; }
.menu-manager-hint { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.menu-manager-list { max-height: 55vh; overflow-y: auto; margin-bottom: 14px; }
.mm-category {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  background: var(--paper);
}
.mm-category-header { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mm-cat-name { flex: 1 1 160px; font-weight: 700; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); }
.mm-cat-name-ur { flex: 1 1 140px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); }
.mm-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.mm-actions button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 13px;
}
.mm-actions button:hover { border-color: var(--accent); }
.mm-danger { color: var(--danger); }
.mm-danger:hover { border-color: var(--danger) !important; }
.mm-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.mm-item {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.mm-item-name { flex: 1 1 180px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; }
.mm-item-name-ur { flex: 1 1 140px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; }
.mm-item-price { width: 90px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; text-align: right; }
.mm-item-editable { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mm-add-item { width: 100%; margin-top: 4px; }
.full-width { width: 100%; }

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  max-width: 340px;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 4px solid var(--accent); }
.toast-error { border-left: 4px solid var(--danger); }

/* Responsive: narrower tablets / portrait */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cart-pane { border-left: none; border-top: 1px solid var(--line); max-height: 52vh; }
}
