/* ==========================================================================
   QRMenu — Base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--tx);
  font-family: var(--face-ui);
  font-size: var(--t-base);
  line-height: 1.55;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video { display: block; max-width: 100%; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* Display type = guest-facing and editorial voice ------------------------- */
.display {
  font-family: var(--face-display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 22, "WONK" 1;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.06;
}

/* Machine data: order numbers, timers, money on dockets ------------------- */
.num {
  font-family: var(--face-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Focus is always visible and always brass ------------------------------- */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: var(--r-tight);
}

::selection {
  background: var(--brass);
  color: var(--ink-950);
}

/* Scrollbars ------------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--ink-600);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-round);
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--ink-500); background-clip: content-box; }

/* Layout primitives ------------------------------------------------------ */
.wrap {
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}
.wrap-narrow { width: min(880px, 100% - 40px); margin-inline: auto; }

.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.row-wrap { flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.push { margin-left: auto; }

.grid { display: grid; gap: var(--s-4); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

/* Text helpers ----------------------------------------------------------- */
.muted { color: var(--tx-mute); }
.soft { color: var(--tx-soft); }
.faint { color: var(--tx-faint); }
.brass { color: var(--brass-lit); }
.danger { color: var(--st-danger); }
.ok { color: var(--st-ready); }
.tiny { font-size: var(--t-xs); }
.small { font-size: var(--t-sm); }
.lead { font-size: var(--t-md); color: var(--tx-soft); line-height: 1.62; max-width: 62ch; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hide { display: none !important; }
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .wrap, .wrap-narrow { width: min(100% - 32px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print: dockets, invoices and QR sheets are the only things that print --- */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .app-rail, .app-topbar, .site-head, .site-foot { display: none !important; }
  .app-main, .app-body { padding: 0 !important; }
  .paper { box-shadow: none !important; border: 1px solid #ccc !important; }
}
