/* ============================================================
   SudoPos design system — "Warm MUJI minimal"
   Warm paper neutrals · ink charcoal · terracotta accent
   ============================================================ */

:root {
    --paper: #F6F4EF;
    --surface: #FFFFFF;
    --sand: #EFEBE2;
    --sand-strong: #E6E0D2;
    --ink: #211E1A;
    --ink-2: #57514A;
    --ink-3: #8A8275;
    --line: #E6E1D5;
    --line-strong: #D5CEBE;
    --accent: #B0511E;
    --accent-strong: #9A4517;
    --accent-soft: #F3E2D4;
    --accent-ink: #8A3D12;
    --good: #39684A;
    --good-soft: #E2EEE4;
    --good-ink: #2C5239;
    --warn: #9A6B21;
    --warn-soft: #F4E8D3;
    --warn-ink: #74501A;
    --bad: #AE3E2E;
    --bad-soft: #F6E0DC;
    --bad-ink: #8C3124;
    --info: #51677F;
    --info-soft: #E3E9F0;
    --info-ink: #3F5168;
    --r-sm: 10px;
    --r: 12px;
    --r-card: 20px;
    --r-xl: 28px;
    --shadow-soft: 0 1px 2px rgba(33, 30, 26, .05), 0 4px 16px rgba(33, 30, 26, .06);
    --shadow-pop: 0 2px 6px rgba(33, 30, 26, .08), 0 16px 40px rgba(33, 30, 26, .14);
}

html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); }

.tabular { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* Scrollbars — quiet */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Focus — always visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* ------------------------------------------------------------ buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: var(--r);
    border: 1px solid transparent;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #38332C; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--sand); }
.btn-soft { background: var(--sand); color: var(--ink); }
.btn-soft:hover { background: var(--sand-strong); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #963527; }
.btn-ghost-danger { background: var(--surface); color: var(--bad); border-color: var(--line-strong); }
.btn-ghost-danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }

.btn-sm { height: 2.125rem; padding: 0 .75rem; font-size: .8125rem; border-radius: var(--r-sm); }
.btn-lg { height: 3rem; padding: 0 1.5rem; font-size: 1rem; border-radius: 14px; }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--r-sm); }

/* ------------------------------------------------------------ cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-soft);
}
.card-pad { padding: 1.25rem; }
@media (min-width: 640px) { .card-pad { padding: 1.5rem; } }

/* ------------------------------------------------------------ forms */
.label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: .375rem;
}
.input, .select, .textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    color: var(--ink);
    font-size: .9375rem;
    padding: 0 .875rem;
    height: 2.75rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.textarea { padding: .625rem .875rem; height: auto; min-height: 5.5rem; resize: vertical; }
.select { padding-right: 2.25rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357514A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--sand); opacity: .7; cursor: not-allowed; }
.hint { font-size: .75rem; color: var(--ink-3); margin-top: .375rem; }
.err { font-size: .75rem; color: var(--bad); font-weight: 600; margin-top: .375rem; }
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--bad); }

/* ------------------------------------------------------------ badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}
.badge-good { background: var(--good-soft); color: var(--good-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-info { background: var(--info-soft); color: var(--info-ink); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }

/* Sidebar nav "needs attention" count (e.g. Low stock): a persistent signal, so it reads as
   urgent without being as loud as the waiter-alert's acute ringing — same bad/terracotta hue
   and the same sonar-ring motion language (see .waiter-alert), just slower and calmer, and a
   solid fill (instead of the soft tint every other .badge-bad uses) so it stays legible once
   .nav-item.active turns the row's background to dark ink with white text. */
.nav-badge-alert {
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 .4375rem;
    font-size: .75rem;
    font-weight: 800;
    background: var(--bad);
    color: #fff;
    justify-content: center;
    animation: nav-badge-pulse 2.4s ease-out infinite;
}
@keyframes nav-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(174, 62, 46, .55); }
    50% { box-shadow: 0 0 0 5px rgba(174, 62, 46, 0); }
}
.badge-neutral { background: var(--sand); color: var(--ink-2); }

/* ------------------------------------------------------------ tables */
.tbl-wrap {
    /* The scroller must be the containing block of the table's sr-only spans (position:absolute);
       otherwise they escape it and widen the whole page on a phone. */
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl thead th {
    text-align: left;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-2);
    background: var(--sand);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.tbl tbody td { padding: .875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .15s ease; }
.tbl tbody tr:hover { background: rgba(239, 235, 226, .45); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ nav */
.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .575rem .75rem;
    border-radius: var(--r);
    font-size: .875rem;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    text-decoration: none;
}
.nav-item:hover { background: var(--sand); color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; font-weight: 600; }
.nav-item.active svg { color: #E8C5AC; }
.nav-section {
    font-size: .6563rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 .75rem;
    margin: 1.25rem 0 .375rem;
}

/* ------------------------------------------------------------ segmented control */
.seg {
    display: inline-flex;
    gap: .25rem;
    background: var(--sand);
    border-radius: var(--r);
    padding: .25rem;
}
.seg-item {
    padding: .375rem .875rem;
    border-radius: var(--r-sm);
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
    text-decoration: none;
}
.seg-item:hover { color: var(--ink); }
.seg-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }

/* ------------------------------------------------------------ modal + toast */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(33, 30, 26, .4);
    backdrop-filter: blur(2px);
    z-index: 90;
}
.modal-card {
    position: relative;
    z-index: 95; /* always above .modal-mask (z 90) inside the modal container */
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-pop);
    width: 100%;
    min-width: 0;      /* flex child of the modal container: may shrink below its content's min-content width */
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    background: var(--ink);
    color: #fff;
    border-radius: 14px;
    padding: .75rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    box-shadow: var(--shadow-pop);
    max-width: 24rem;
}
.toast-success svg { color: #9CCDAA; }
.toast-error svg { color: #F0A898; }

/* ------------------------------------------------------------ misc */
.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.divider { height: 1px; background: var(--line); border: 0; }
.kbd {
    display: inline-block;
    padding: .125rem .375rem;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--ink-2);
    background: var(--surface);
}

/* POS item tiles */
.pos-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .75rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .375rem;
    width: 100%;
}
.pos-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.pos-tile:active { transform: scale(.98); }
.pos-tile:disabled { opacity: .4; cursor: not-allowed; }

/* Kitchen ticket */
.ticket { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.ticket-head { padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px dashed var(--line-strong); }

/* Simple fade/slide for Alpine transitions */
.fade-enter { transition: opacity .2s ease, transform .2s ease; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.toast { animation: toast-in .25s ease; }

/* --------------------------------------------------- label flair pack */
.lblx {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    min-width: 0;      /* every flair chip may shrink inside its wrapper (guest menu, pickup, picker) */
    max-width: 100%;   /* so a long label never runs into the price column or the add button */
}
.lblx-badge, .lblx-glow, .lblx-shine { padding: 3px 8px; border-radius: 999px; }
/* The badge text is its own span (the dot is the first child): it shrinks and ends in an ellipsis. */
.lblx-badge > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@keyframes lblx-glow {
    0%, 100% { box-shadow: 0 0 0 0 var(--lblx-glow, rgba(176, 81, 30, .45)); }
    50% { box-shadow: 0 0 12px 2px var(--lblx-glow, rgba(176, 81, 30, .55)); }
}
.lblx-glow { animation: lblx-glow 1.8s ease-in-out infinite; }

.lblx-shine { position: relative; overflow: hidden; }
.lblx-shine::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 45%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: lblx-shine 2.6s ease-in-out infinite;
}
@keyframes lblx-shine {
    0% { left: -60%; }
    55%, 100% { left: 120%; }
}

@keyframes lblx-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.lblx-bounce-dot {
    width: 7px; height: 7px;
    border-radius: 999px;
    animation: lblx-bounce .9s ease-in-out infinite;
}

.lblx-stamp {
    padding: 3px 7px;
    border: 2px solid currentColor;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    transform: rotate(-6deg);
    margin: 0 3px;   /* rotated: the 3px inset keeps the tilted box inside the text column (label-spec H3.2) */
    background: var(--surface);   /* opaque: hides any watermark under the stamp, keeping its contrast */
    opacity: 1;
}

@keyframes lblx-swing {
    0%, 100% { transform: rotate(0); }
    30% { transform: rotate(-5deg); }
    60% { transform: rotate(4deg); }
}
.lblx-tag {
    padding: 3px 9px 3px 15px;
    border-radius: 4px 999px 999px 4px;
    position: relative;
    transform-origin: left center;
    margin: 0 3px;   /* the swing pivots on the left edge; this keeps the swung box inside the text column in every frame (label-spec H3.2) */
    animation: lblx-swing 2.4s ease-in-out infinite;
}
.lblx-tag::before {
    content: '';
    position: absolute;
    left: 5px; top: 50%;
    width: 4px; height: 4px;
    margin-top: -2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .85);
}

/* Starburst retail seal — wobbles briefly every few seconds */
/* Rotation only: a scale peak would push a wide chip past the text column (label-spec H3.2) */
@keyframes lblx-wobble {
    0%, 70%, 100% { transform: rotate(0); }
    76% { transform: rotate(-5deg); }
    82% { transform: rotate(4deg); }
    88% { transform: rotate(-2deg); }
}
.lblx-burst {
    padding: 13px 15px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    justify-content: center;
    text-align: center;
    min-width: 46px;
    margin: 0 3px;   /* the wobble's rotation swings the corners about 1.7 px outside the box (label-spec H3.2) */
    clip-path: polygon(50% 0%, 60.4% 11.4%, 75% 6.7%, 78.3% 21.7%, 93.3% 25%, 88.6% 39.6%, 100% 50%, 88.6% 60.4%, 93.3% 75%, 78.3% 78.3%, 75% 93.3%, 60.4% 88.6%, 50% 100%, 39.6% 88.6%, 25% 93.3%, 21.7% 78.3%, 6.7% 75%, 11.4% 60.4%, 0% 50%, 11.4% 39.6%, 6.7% 25%, 21.7% 21.7%, 25% 6.7%, 39.6% 11.4%);
    animation: lblx-wobble 3.6s ease-in-out infinite;
}

/* Neon sign — dark pill, glowing colored text with an occasional flicker */
@keyframes lblx-flicker {
    0%, 6%, 12%, 100% { opacity: 1; }
    8% { opacity: .55; }
    10% { opacity: .9; }
    32% { opacity: 1; }
    33% { opacity: .7; }
    34.5% { opacity: 1; }
}
.lblx-neon {
    padding: 3px 9px;
    border-radius: 999px;
    background: #1D1B18;
    border: 1px solid currentColor;
    text-shadow: 0 0 5px currentColor, 0 0 12px currentColor;
    animation: lblx-flicker 4.2s linear infinite;
}

/* Pop bounce — still most of the time, then a quick scale pop */
@keyframes lblx-pop {
    /* scaleY, not scale: a sideways scale would push a wide chip past the text column (label-spec H3.2) */
    0%, 62%, 96%, 100% { transform: scaleY(1); }
    70% { transform: scaleY(1.18); }
    78% { transform: scaleY(.94); }
    86% { transform: scaleY(1.07); }
}
.lblx-pop {
    padding: 3px 8px;
    border-radius: 999px;
    animation: lblx-pop 3s ease-in-out infinite;
}

/* Die-cut sticker — thick white border, tilt, peeled corner (static) */
.lblx-sticker {
    padding: 4px 9px;
    border-radius: 8px;
    border: 2.5px solid #FFFDF8;
    box-shadow: 0 2px 5px rgba(33, 30, 26, .25);
    transform: rotate(-3deg);
    margin: 0 3px;   /* rotated: the 3px inset keeps the tilted box inside the text column (label-spec H3.2) */
    position: relative;
    overflow: hidden;
}
.lblx-sticker::after {
    content: '';
    position: absolute;
    right: 0; bottom: 0;
    width: 9px; height: 9px;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, .8) 50%);
    border-radius: 2px 0 0 0;
}

/* Animated gradient — slow light drift across the fill */
@keyframes lblx-drift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.lblx-gradient {
    padding: 3px 9px;
    border-radius: 999px;
    background-size: 220% 100%;
    animation: lblx-drift 3.5s ease-in-out infinite alternate;
}

/* Chips whose label is a bare text node: a block box, so text-overflow can clip the label inside the chip. */
.lblx-stamp, .lblx-glow, .lblx-shine, .lblx-tag, .lblx-burst, .lblx-neon, .lblx-pop, .lblx-sticker, .lblx-gradient {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Top band (label-spec B1, option A): a 22px row at the top of the tile. The tile gets
   34px of top padding (p-3 plus the band), so the band cannot reach the content row. */
.card.lbl-has-band { padding-top: 34px; }
.lblx-ribbon {
    position: absolute; top: 0; left: 0; right: 0;
    height: 22px; line-height: 22px;
    padding: 0 16px;
    text-align: center;
    font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 1px 0 rgba(33, 30, 26, .12);
    z-index: 2;
    pointer-events: none;
}

/* Watermark underlay (label-spec C): decoration only, painted behind the tile content. */
.lbl-wm { position: absolute; inset: 0; z-index: -1; pointer-events: none; user-select: none; overflow: hidden;
          color: var(--wm-c); opacity: var(--wm-a);
          font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.lbl-wm--word { inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%);
                font-size: var(--wm-fs, 36px); line-height: 1; letter-spacing: .02em; }
.lbl-wm--word.lbl-wm--45 { transform: translate(-50%, -50%) rotate(-45deg); }
.lbl-wm--repeat { padding: 8px 12px; white-space: normal;
                  font-size: 13px; line-height: 26px; letter-spacing: .06em; }
.lbl-wm--repeat.lbl-wm--45 { inset: auto; top: 50%; left: 50%; width: 480px; height: 480px;
                             margin: -240px 0 0 -240px; padding: 0; transform: rotate(-45deg);
                             font-size: 12px; line-height: 30px; letter-spacing: .08em; }

/* Photo decorations (label-spec D): the 72px photo box anchors the seal and the tape.
   No overflow hidden on the box, so both can extend past its edge. */
.lbl-photo { position: relative; flex: none; width: 72px; height: 72px; }
.lbl-seal { position: absolute; top: -8px; left: -8px; width: 46px; height: 46px; border-radius: 50%;
            display: grid; place-items: center; background: var(--surface); color: var(--seal-c);
            border: 2px solid var(--seal-c);
            box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3.5px var(--seal-c), 0 1px 2px rgba(33, 30, 26, .18);
            font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .04em; text-transform: uppercase;
            white-space: nowrap; overflow: hidden; transform: rotate(-12deg);
            z-index: 2; pointer-events: none; }
/* Washi tape (label-spec D2, owner change): a strip across the photo's top edge that carries the label
   name. Solid, so the text colour from label_on_color keeps the contrast it was chosen for. Max 88px keeps
   the strip clear of the name column; longer names end in an ellipsis. */
.lbl-tape { position: absolute; top: -4px; left: 50%; transform: translateX(-50%) rotate(-6deg);
            width: max-content; max-width: 88px; height: 17px; padding: 0 6px;
            background-color: var(--tape-c);
            font-size: 10px; font-weight: 800; line-height: 17px; letter-spacing: .04em; text-transform: uppercase;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            box-shadow: 0 1px 1.5px rgba(33, 30, 26, .18);
            z-index: 2; pointer-events: none; }

/* Coupon ticket chip (label-spec D3): a chip in the meta row with notched ends. */
.lbl-ticket { display: inline-flex; align-items: center; min-width: 0; max-width: min(9rem, 100%);
              padding: 4px 10px 4px 12px; border-radius: 4px;
              background: var(--lbl-bg); color: var(--lbl-txt);
              font-size: 10px; font-weight: 800; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase;
              white-space: nowrap;
              -webkit-mask: radial-gradient(circle 4px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                            radial-gradient(circle 4px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
                      mask: radial-gradient(circle 4px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                            radial-gradient(circle 4px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; }
.lbl-ticket > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------- waiter call alert */
@keyframes wa-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    10%, 50%, 90% { transform: translateX(-6px) rotate(-1.5deg); }
    30%, 70% { transform: translateX(6px) rotate(1.5deg); }
}
@keyframes wa-sonar {
    0% { box-shadow: 0 0 0 0 rgba(174, 62, 46, .45); }
    100% { box-shadow: 0 0 0 18px rgba(174, 62, 46, 0); }
}
@keyframes wa-bell-swing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(18deg); }
    40% { transform: rotate(-14deg); }
    60% { transform: rotate(9deg); }
    80% { transform: rotate(-5deg); }
}
.waiter-alert {
    animation: wa-sonar 1.6s ease-out infinite;
}
.waiter-alert.ringing {
    animation: wa-shake .55s ease-in-out 3, wa-sonar 1.6s ease-out infinite;
}
.waiter-alert .wa-bell {
    animation: wa-bell-swing 1.2s ease-in-out infinite;
    transform-origin: top center;
}

/* ---- Order note callout (POS) ---- */
.note-callout {
    display: flex; align-items: flex-start; gap: .625rem;
    padding: .75rem .875rem; border-radius: 14px;
    background: var(--warn-soft); color: var(--warn-ink);
    border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}
.note-callout-label { font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.note-callout-text {
    margin-top: .125rem; font-size: .9375rem; font-weight: 700; line-height: 1.4;
    color: var(--ink); white-space: pre-line; overflow-wrap: anywhere;
}
.note-add {
    display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
    padding: .625rem .875rem; border-radius: 14px; border: 1.5px dashed var(--line-strong);
    background: transparent; color: var(--ink-2); font-size: .875rem; font-weight: 700; cursor: pointer;
}
.note-add:hover { background: var(--sand); color: var(--ink); }
.note-dot {
    position: absolute; top: .25rem; right: .25rem; width: .5rem; height: .5rem;
    border-radius: 999px; background: var(--warn);
}

/* ---- Move table grid (POS) ---- */
.move-legend { display: flex; flex-wrap: wrap; gap: .5rem .875rem; }
.move-key { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.move-key::before {
    content: ''; width: .75rem; height: .75rem; border-radius: 4px;
    background: var(--good-soft); border: 1.5px solid color-mix(in srgb, var(--good) 45%, transparent);
}
.move-key-tight::before { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.move-key-busy::before { background: var(--sand); border-color: var(--line-strong); }
.move-grid { display: grid; gap: 1rem; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; padding-right: .25rem; }
.move-area { margin-bottom: .5rem; font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.move-tile {
    position: relative; display: flex; flex-direction: column; gap: .125rem; min-height: 5.25rem;
    padding: .625rem .75rem; border-radius: 14px; border: 1.5px solid var(--line);
    background: var(--surface); text-align: left; cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.move-tile:hover { border-color: var(--line-strong); }
.move-tile:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.move-tile-name { font-size: 1rem; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.move-tile-seats { font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.move-tile-tag { margin-top: auto; padding-top: .25rem; font-size: .75rem; font-weight: 700; }
.move-tile-fits { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.move-tile-fits .move-tile-tag { color: var(--good-ink); }
.move-tile-tight { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.move-tile-tight .move-tile-tag { color: var(--warn-ink); }
.move-tile-busy { background: var(--sand); border-color: var(--line); cursor: not-allowed; }
.move-tile-busy .move-tile-tag { color: var(--ink-2); }
.move-tile.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.move-warn {
    padding: .625rem .75rem; border-radius: 12px;
    background: var(--warn-soft); color: var(--warn-ink); font-size: .8125rem; font-weight: 600;
}

/* ------------------------------------------------ kitchen board (KB) */
.kb {
    --kb-bg: #141210; --kb-panel: #1C1916; --kb-card: #26221D; --kb-raised: #322D27; --kb-line: #3F3830;
    --kb-field: #8C8377; --kb-text: #F6F4EF; --kb-muted: #C2BAAB;
    --kb-new: #8FB1D6; --kb-cook: #E9B25B; --kb-done: #8CC79C; --kb-late: #E8806B; --kb-note: #F2C077;
    --kb-on-action: #141210; --kb-focus: #F2C077;
    background: var(--kb-bg); color: var(--kb-text);
}
.kb.kb-light {
    --kb-bg: #F6F4EF; --kb-panel: #EFEBE2; --kb-card: #FFFFFF; --kb-raised: #F3EFE6; --kb-line: #D9D2C3;
    --kb-field: #7B7366; --kb-text: #211E1A; --kb-muted: #57514A;
    --kb-new: #3D5A78; --kb-cook: #7A5414; --kb-done: #2F5E40; --kb-late: #A23A2B; --kb-note: #7A4A0C;
    --kb-on-action: #FFFFFF; --kb-focus: #B0511E;
}
.kb :focus-visible { outline: 3px solid var(--kb-focus); outline-offset: 2px; }
.kb-tone-new, .kb-action-new { --kb-tone: var(--kb-new); }
.kb-tone-cook, .kb-action-cook { --kb-tone: var(--kb-cook); }
.kb-tone-done, .kb-action-done { --kb-tone: var(--kb-done); }

/* Top bar: stations, live state, display options */
.kb-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
    padding: .625rem .75rem; background: var(--kb-panel); border-bottom: 1px solid var(--kb-line);
}
.kb-stations { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.kb-station {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 48px;
    padding: .375rem .375rem .375rem .9rem; border-radius: 14px;
    border: 1.5px solid var(--kb-line); background: var(--kb-card); color: var(--kb-text);
    font-size: 1rem; font-weight: 700; cursor: pointer;
}
.kb-station[aria-pressed="true"] { background: var(--kb-text); border-color: var(--kb-text); color: var(--kb-bg); }
.kb-station[aria-pressed="true"] .kb-count { background: var(--kb-bg); color: var(--kb-text); }
.kb-count {
    min-width: 1.75rem; padding: .125rem .5rem; border-radius: 999px; background: var(--kb-raised);
    color: var(--kb-text); font-size: .8125rem; font-weight: 800; text-align: center;
}
.kb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.kb-live {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: .25rem .7rem;
    border-radius: 999px; background: var(--kb-raised); color: var(--kb-muted); font-size: .8125rem; font-weight: 700;
}
.kb-live-dot { width: .5rem; height: .5rem; border-radius: 999px; background: var(--kb-done); }
.kb-live.is-reconnecting .kb-live-dot { background: var(--kb-cook); }
.kb-live.is-offline { color: var(--kb-late); }
.kb-live.is-offline .kb-live-dot { background: var(--kb-late); }
.kb-tool {
    min-height: 48px; padding: .5rem .9rem; border-radius: 14px; border: 1.5px solid var(--kb-line);
    background: transparent; color: var(--kb-text); font-size: .9375rem; font-weight: 700; cursor: pointer;
}
.kb-tool[aria-pressed="true"], .kb-tool[aria-checked="true"] { background: var(--kb-raised); border-color: var(--kb-muted); }

/* Notices */
.kb-notice {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .5rem .75rem 0;
    padding: .625rem .875rem; border-radius: 12px; border: 1px solid var(--kb-late);
    background: color-mix(in srgb, var(--kb-late) 16%, transparent); font-size: .9375rem; font-weight: 700;
}
.kb-link { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; color: var(--kb-text); }

/* Below the desktop width: one column at a time */
.kb-tabs { display: flex; gap: .5rem; padding: .625rem .75rem 0; }
.kb-tab {
    flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 52px; padding: .5rem; border-radius: 14px;
    border: 1.5px solid color-mix(in srgb, var(--kb-tone, var(--kb-line)) 30%, var(--kb-line));
    background: color-mix(in srgb, var(--kb-tone, var(--kb-card)) 10%, var(--kb-card));
    color: var(--kb-text); font-size: .9375rem; font-weight: 800; cursor: pointer;
}
.kb-tab[aria-pressed="true"] {
    border-color: var(--kb-tone); box-shadow: inset 0 -4px 0 var(--kb-tone);
    background: color-mix(in srgb, var(--kb-tone) 20%, var(--kb-card));
}
@media (min-width: 1024px) { .kb-tabs { display: none; } }

/* A small state icon that rides alongside the tone color so the state never relies on color alone
   (shared by .kb-col-title and .kb-tab — see "kitchen split" note above for why color-mix stays token-only). */
.kb-state-icon { display: inline-flex; flex: none; color: var(--kb-tone, var(--kb-muted)); }

/* Board: three column cards on desktop, one at a time below */
.kb-board { flex: 1 1 auto; min-height: 0; display: flex; gap: .75rem; padding: .75rem; }
.kb-col {
    flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border-radius: 18px; border: 1px solid color-mix(in srgb, var(--kb-tone, var(--kb-line)) 35%, var(--kb-line));
    border-top: 4px solid var(--kb-tone, var(--kb-line));
    background: color-mix(in srgb, var(--kb-tone, var(--kb-panel)) 9%, var(--kb-panel));
    overflow: hidden;
}
.kb-col-head { flex: none; padding: .75rem 1rem .625rem; border-bottom: 1px solid color-mix(in srgb, var(--kb-tone, var(--kb-line)) 25%, var(--kb-line)); }
.kb-col-title { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.kb-col-sub { margin-top: .125rem; font-size: .875rem; font-weight: 600; color: var(--kb-muted); }
.kb-col-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    display: grid; align-content: start; gap: .75rem; padding: .75rem;
    scrollbar-width: thin; scrollbar-color: var(--kb-field) transparent;
}

/* Tickets: a lighter echo of the column's tone (inherited --kb-tone from .kb-col, since .kb-ticket
   carries no tone class of its own) — distinct enough to read as "this card belongs to this column"
   without competing with the age-urgency stripe below, which is a separate, unrelated concern. */
.kb-ticket {
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--kb-tone, var(--kb-line)) 22%, var(--kb-line));
    background: color-mix(in srgb, var(--kb-tone, var(--kb-card)) 5%, var(--kb-card));
}
.kb-ticket-warn { box-shadow: inset 5px 0 0 var(--kb-cook); }
.kb-ticket-overdue { box-shadow: inset 5px 0 0 var(--kb-late); }
.kb-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .875rem 1rem .5rem; }
.kb-table { font-size: 1.625rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.kb-meta { margin-top: .25rem; font-size: .875rem; font-weight: 600; color: var(--kb-muted); }
.kb-age {
    flex: none; display: inline-flex; align-items: center; gap: .375rem; min-height: 36px; padding: .25rem .7rem;
    border-radius: 999px; background: var(--kb-raised); color: var(--kb-text); font-size: .9375rem; font-weight: 800; white-space: nowrap;
}
.kb-age-warn { color: var(--kb-cook); }
.kb-age-overdue { color: var(--kb-late); }
.kb-note {
    display: flex; align-items: flex-start; gap: .5rem; margin: 0 1rem .5rem; padding: .5rem .75rem; border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--kb-note) 45%, transparent);
    background: color-mix(in srgb, var(--kb-note) 14%, transparent);
    font-size: 1rem; font-weight: 700; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere;
}
.kb-note-label { flex: none; padding-top: .125rem; font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--kb-note); }
.kb-lines { list-style: none; margin: 0; padding: 0 .5rem; }
.kb-line { position: relative; padding: .75rem .5rem; border-top: 1px dashed var(--kb-line); }
.kb-line:first-child { border-top: 0; }
.kb-line-main { display: flex; align-items: center; gap: .75rem; }
.kb-qty {
    flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 3.25rem; min-height: 3.25rem;
    padding: 0 .5rem; border-radius: 12px; background: var(--kb-raised); font-size: 1.25rem; font-weight: 800;
}
.kb-name { font-size: 1.125rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.kb-mods { margin-top: .125rem; font-size: .9375rem; font-weight: 600; color: var(--kb-muted); }
.kb-guest {
    display: inline-block; margin-top: .25rem; padding: .125rem .55rem; border-radius: 999px;
    border: 1px solid var(--kb-field); color: var(--kb-muted); font-size: .8125rem; font-weight: 700;
}
.kb-components { margin-top: .25rem; padding-left: 1.1rem; list-style: disc; font-size: .9375rem; color: var(--kb-muted); }
.kb-line-note { margin-top: .25rem; font-size: .9375rem; font-weight: 700; color: var(--kb-note); overflow-wrap: anywhere; }
.kb-line-note-label { margin-right: .25rem; font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.kb-action {
    flex: none; min-width: 5.5rem; min-height: 56px; padding: .5rem .9rem; border: 0; border-radius: 14px;
    background: var(--kb-tone); color: var(--kb-on-action); font-size: 1.0625rem; font-weight: 800; cursor: pointer;
}
.kb-action:disabled { opacity: .5; cursor: progress; }
.kb-waiting { flex: none; font-size: .875rem; font-weight: 800; color: var(--kb-done); }

/* ---- Kitchen split by category: one station's slice of a set (group). Tokens only; dark and .kb-light both work. ---- */
/* A small fixed radius, not a capsule: a long station name wraps to several lines and a 999px radius would
   turn the box into an egg whose curve cuts through the first and last words. */
.kb-stag {
    display: inline-block; max-width: 100%; margin: .25rem .375rem 0 0; padding: .125rem .55rem; border-radius: 12px;
    border: 1px solid var(--kb-field); color: var(--kb-text); font-size: .8125rem; font-weight: 800; overflow-wrap: anywhere;
}
.kb-also { list-style: none; margin: .375rem 0 0; padding: 0; font-size: .875rem; font-weight: 700; color: var(--kb-muted); overflow-wrap: anywhere; }
.kb-also li + li { margin-top: .125rem; }
.kb-also strong { color: var(--kb-text); font-weight: 800; }
.kb-waiting.is-holding { max-width: 9rem; text-align: right; color: var(--kb-muted); }
.kb-group .kb-line-main { flex-wrap: wrap; }
@media (max-width: 80rem) {
    /* Anything narrower than a wide desktop: the "Waiting for ..." note drops below the set name instead of squeezing it
       (at 1024px the name block was only 45px wide and broke inside words). */
    .kb-group .kb-waiting.is-holding { flex: 1 1 100%; max-width: none; text-align: left; }
}
/* ---- end of kitchen split ---- */

/* Recipes (hidden until asked for) */
.kb-recipe-toggle {
    display: inline-flex; align-items: center; gap: .4rem; margin-top: .5rem; min-height: 44px; padding: .25rem .75rem;
    border-radius: 12px; border: 1px solid var(--kb-field); background: transparent; color: var(--kb-text);
    font-size: .875rem; font-weight: 700; cursor: pointer;
}
.kb-recipe { margin-top: .5rem; padding: .75rem; border-radius: 14px; background: var(--kb-raised); }
.kb-recipe-title { font-size: .8125rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--kb-muted); }
.kb-comp { margin-top: .5rem; }
.kb-comp-title { font-size: .9375rem; font-weight: 800; }
.kb-ing { list-style: none; margin: .25rem 0 0; padding: 0; }
.kb-ing-row {
    display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: .3rem 0; font-size: .9375rem;
    border-top: 1px dashed var(--kb-line);
}
.kb-short { color: var(--kb-late); font-weight: 800; }
.kb-short-tag {
    padding: 0 .4rem; border-radius: 6px; border: 1px solid var(--kb-late); color: var(--kb-late);
    font-size: .6875rem; font-weight: 800; text-transform: uppercase;
}
.kb-muted { font-size: .9375rem; color: var(--kb-muted); }

/* Cooking guide (hidden until asked for, shares .kb-recipe-wrap/.kb-recipe-toggle/.kb-recipe) */
.kb-cook-intro { margin-top: .4rem; font-size: .9375rem; }
.kb-cook-intro ul, .kb-cook-intro ol { margin: .25rem 0 0 1.1rem; }
.kb-cook-video { margin-top: .6rem; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.kb-cook-video iframe { width: 100%; height: 100%; border: 0; }
.kb-cook-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.kb-cook-steps li { display: flex; align-items: flex-start; gap: .5rem; }
.kb-cook-step-no {
    flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--kb-field);
    color: var(--kb-text); font-size: .75rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.kb-cook-step-text { text-align: left; font-size: .9375rem; color: var(--kb-text); background: none; border: 0; padding: 0; cursor: default; }
.kb-cook-step-jump { cursor: pointer; text-decoration: underline dotted; }
.kb-cook-step-jump:hover { color: var(--kb-cook); }

/* Ticket footer and empty states */
.kb-foot { padding: .5rem .75rem .75rem; border-top: 1px solid var(--kb-line); }
.kb-bulk {
    width: 100%; min-height: 52px; padding: .5rem .9rem; border-radius: 14px; border: 1.5px solid var(--kb-field);
    background: var(--kb-raised); color: var(--kb-text); font-size: .9375rem; font-weight: 800; cursor: pointer;
}
.kb-bulk:disabled { opacity: .5; cursor: progress; }
.kb-empty {
    padding: 1.25rem 1rem; text-align: center; font-size: .9375rem; font-weight: 700; color: var(--kb-muted);
    border: 1.5px dashed var(--kb-line); border-radius: 14px;
}

/* A line that just arrived: a ring that fades out (static when motion is reduced) */
.kb-fresh::after {
    content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
    box-shadow: inset 0 0 0 3px var(--kb-new); animation: kb-fresh-fade 8s ease-out forwards;
}
@keyframes kb-fresh-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* Prep station drawer */
.kb-drawer {
    position: fixed; top: 3.5rem; right: 0; bottom: 0; z-index: 40; width: min(94vw, 400px);
    display: flex; flex-direction: column; background: var(--kb-panel); border-left: 1px solid var(--kb-line);
    box-shadow: -16px 0 40px rgba(0, 0, 0, .3);
}
.kb-drawer-head {
    flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
    padding: .875rem 1rem; border-bottom: 1px solid var(--kb-line);
}
.kb-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .25rem 1rem 1rem; }
.kb-prep-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 0; border-bottom: 1px dashed var(--kb-line); }
.kb-prep-qty {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .375rem; margin-top: .125rem;
    font-size: .9375rem; font-weight: 700; color: var(--kb-muted);
}
.kb-prep-qty .tabular { font-size: 1.5rem; font-weight: 800; color: var(--kb-text); }
.kb-low {
    padding: 0 .4rem; border-radius: 6px; border: 1px solid var(--kb-late); color: var(--kb-late);
    font-size: .6875rem; font-weight: 800; text-transform: uppercase;
}
.kb-input {
    width: 6rem; min-height: 48px; padding: .5rem .6rem; border-radius: 12px; border: 1.5px solid var(--kb-field);
    background: var(--kb-card); color: var(--kb-text); font-size: 1rem; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .kb-fresh::after { animation: none; }
    .kb * { transition: none !important; }
}

/* Print pages never show app chrome */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
}

/* ------------------------------------------------ SA tenant detail (sa/tenants/show) */
/* Scoped to the super-admin tenant page: every selector starts with .tnt. Tokens only. */
.tnt-card-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    min-height: 3.5rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--line);
}
.tnt-card-title { font-size: 1rem; line-height: 1.5rem; font-weight: 700; color: var(--ink); }
.tnt-card-body { padding: 1.25rem; }
@media (min-width: 640px) {
    .tnt-card-head { padding-left: 1.5rem; padding-right: 1.5rem; }
    .tnt-card-body { padding: 1.25rem 1.5rem 1.5rem; }
}
@media (max-width: 639.98px) {
    .tnt-card-actions { width: 100%; }
    .tnt-card-actions .btn { flex: 1 1 auto; }
}

.tnt-strip {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
    background: var(--line); overflow: hidden;
}
.tnt-strip-item { background: var(--surface); padding: .875rem 1rem; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 768px) {
    .tnt-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tnt-strip-item { padding: 1rem 1.25rem; }
}

.tnt-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; }
.tnt-note { max-width: 65ch; }

/* Users: stacked rows below 768 px, a normal table from 768 px up */
@media (max-width: 767.98px) {
    .tbl.tnt-users thead { display: none; }
    .tbl.tnt-users, .tbl.tnt-users tbody { display: block; }
    .tbl.tnt-users tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) fit-content(50%); align-items: center;
        grid-template-areas: "name role" "email email" "status login" "action action";
        gap: .375rem .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
    }
    .tbl.tnt-users tbody tr:last-child { border-bottom: 0; }
    .tbl.tnt-users tbody td { display: block; padding: 0; border: 0; min-width: 0; }
    .tbl.tnt-users tbody td.tnt-u-name { grid-area: name; overflow-wrap: anywhere; }
    .tbl.tnt-users tbody td.tnt-u-email { grid-area: email; overflow-wrap: anywhere; }
    .tbl.tnt-users tbody td.tnt-u-role { grid-area: role; justify-self: end; }
    .tbl.tnt-users tbody td.tnt-u-status { grid-area: status; justify-self: start; }
    .tbl.tnt-users tbody td.tnt-u-login { grid-area: login; justify-self: end; text-align: right; white-space: normal; }
    .tbl.tnt-users tbody td.tnt-u-action { grid-area: action; }
    .tbl.tnt-users tbody td.tnt-u-action:not(:has(form)) { display: none; }
    .tnt-users .tnt-u-action form { justify-content: stretch; }
    .tnt-users .tnt-u-action .btn { width: 100%; height: 2.5rem; margin-top: .25rem; }
    .tnt-u-label { display: inline; color: var(--ink-2); }
}
@media (min-width: 640px) and (max-width: 767.98px) {
    .tbl.tnt-users tbody tr { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 768px) {
    .tnt-u-label { display: none; }
    .tbl.tnt-users th:first-child, .tbl.tnt-users td:first-child { padding-left: 1.5rem; }
    .tbl.tnt-users th:last-child, .tbl.tnt-users td:last-child { padding-right: 1.5rem; }
}

/* ---- Dashboard & reports charts ---- */
:root {
    --chart-1: #B0511E;              /* = --accent; validated set (dash-reports-spec 1.1) */
    --chart-2: #35679C;              /* --info hue at chroma 0.10 */
    --chart-3: #236E43;              /* reserved, unused in this release */
    --chart-track: var(--accent-soft);
}
.chart { position: relative; margin: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .375rem 1rem; margin: 0 0 .75rem; padding: 0; list-style: none; font-size: .75rem; color: var(--ink-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: .375rem; }
.chart-key { display: inline-block; flex: none; }
.chart-key.is-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--chart-1); }
.chart-key.is-cmp { width: 16px; height: 0; border-top: 2px dashed var(--chart-2); }
.chart-frame { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: .5rem; }
.chart-yaxis { position: relative; }
.chart-ytick, .chart-ytick-sizer { font-size: .6875rem; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-ytick { position: absolute; right: 0; transform: translateY(-50%); color: var(--ink-2); }
.chart-ytick-sizer { display: block; height: 0; overflow: hidden; visibility: hidden; }
.chart-plot { position: relative; min-width: 0; }
.chart-svg { display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart-base { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-bar { fill: var(--chart-1); transition: fill-opacity .15s ease; }
.chart-bar.is-active { fill-opacity: .78; }
.chart-cmp { fill: none; stroke: var(--chart-2); stroke-width: 2; stroke-dasharray: 4 4; stroke-linecap: round; }
.chart-dot { fill: var(--chart-2); stroke: var(--surface); stroke-width: 2; }
.chart-xlabel, .chart-xtitle { font-size: 11px; fill: var(--ink-2); }
.chart-xlabel.is-current { fill: var(--ink); font-weight: 700; }
.chart-vlabel { font-size: 11px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; }
.chart-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chart-tip { position: absolute; top: 0; z-index: 5; pointer-events: none; max-width: min(15rem, calc(100vw - 2rem));
    padding: .5rem .625rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
    box-shadow: var(--shadow-pop); font-size: .75rem; color: var(--ink-2); white-space: nowrap; }
.chart-tip.is-center { transform: translateX(-50%); }
.chart-tip.is-end { transform: translateX(-100%); }
.chart-tip-title { margin-bottom: .25rem; }
.chart-tip-row { display: flex; align-items: center; gap: .375rem; }
.chart-tip-row strong { color: var(--ink); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.chart-tip-key { flex: none; width: 12px; height: 0; border-top: 2px solid var(--chart-1); }
.chart-tip-key.is-cmp { border-top: 2px dashed var(--chart-2); }
.chart-tip-note { margin-top: .25rem; }
.chart-hbars { display: flex; flex-direction: column; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.chart-hbar-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .375rem; }
.chart-hbar { display: block; }
.chart-hbar-track { fill: var(--chart-track); }
.chart-hbar-fill { fill: var(--chart-1); }
/* Clips the sr-only table twin: a table never shrinks below its content width, so on its own it widens the page */
.chart-sr { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stat-delta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .75rem; }
/* On-hand vs. benchmark gauge, shared by the Find Stock and Low Stock pages (x-ui.stock-gauge). */
.stock-gauge { min-width: 6.5rem; }
.stock-gauge-track { position: relative; height: 6px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.stock-gauge-fill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: 999px; transition: width .2s ease; }
.stock-gauge-tick { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); opacity: .32; border-radius: 1px; }
.stock-gauge-pct { font-size: .75rem; font-weight: 700; margin-top: .3rem; white-space: nowrap; }
/* Find Stock's dominant column (location/rack is the page's whole reason to exist): a soft
   accent rail on the leading cell, distinct from every other plain column. */
.tbl-locate-primary { box-shadow: inset 3px 0 0 0 var(--accent); }
.report-presets { flex-wrap: wrap; max-width: 100%; }
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1.5rem; }

/* ---- Bundles & suggestions ---- */
/* Item form: bundle editor rows (one column under 640px) */
.bx-row { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.bx-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.bx-act { width: 2.75rem; height: 2.75rem; }
.bx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
@media (min-width: 640px) {
    .bx-grid { grid-template-columns: minmax(0, 2fr) 5.5rem minmax(0, 1fr); }
}
.bx-check { display: flex; align-items: flex-start; gap: .625rem; min-height: 44px; padding: .375rem 0; cursor: pointer; }
.bx-check input, .bx-opt input { flex: none; width: 1.125rem; height: 1.125rem; margin-top: .125rem; accent-color: var(--accent); cursor: pointer; }
.bx-choices { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.bx-summary { padding: .75rem; line-height: 1.25rem; font-size: .8125rem; font-weight: 600; color: var(--ink-2); cursor: pointer; overflow-wrap: anywhere; }
.bx-groups { display: grid; gap: .75rem; padding: 0 .75rem .75rem; }
.bx-group { min-width: 0; margin: 0; padding: .75rem 0 0; border: 0; border-top: 1px solid var(--line); }
.bx-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.bx-opt { display: flex; align-items: center; gap: .625rem; min-height: 44px; padding: .25rem .5rem; border-radius: var(--r-sm); font-size: .875rem; color: var(--ink); cursor: pointer; }
.bx-opt:hover { background: var(--sand); }
.bx-opt input { margin-top: 0; }
.bx-state { margin-top: .25rem; font-size: .75rem; color: var(--ink-2); }
.bx-price { display: grid; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* POS bundle picker: bottom sheet on mobile, body scrolls, footer stays */
.bp-card { max-height: calc(100dvh - 4rem); }
.bp-card .btn-icon { width: 2.75rem; height: 2.75rem; }
.bp-comp { min-width: 0; padding-top: .75rem; border-top: 1px solid var(--line); }
.bp-comp:first-of-type { border-top: 0; padding-top: 0; }
.bp-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.bp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin-bottom: .375rem; font-size: .8125rem; }
.bp-opt { display: flex; align-items: center; gap: .625rem; min-height: 44px; padding: .375rem .75rem; margin-top: .375rem;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: .875rem; color: var(--ink); cursor: pointer; }
.bp-opt:hover { background: var(--sand); }
.bp-opt.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.bp-opt.is-max { opacity: .55; }
.bp-opt[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.bp-opt input { flex: none; width: 1.125rem; height: 1.125rem; accent-color: var(--accent); cursor: pointer; }
.bp-alert { display: flex; gap: .5rem; padding: .625rem .75rem; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad-ink);
    font-size: .8125rem; font-weight: 600; }
.bp-alert:focus { outline: 2px solid var(--bad); outline-offset: 2px; }
/* POS "Often ordered with": fixed above the mobile summary bar, static at the bottom of the menu from 1024px */
.pos-suggest { position: fixed; left: 0; right: 0; bottom: 4.25rem; z-index: 55; padding: .375rem .75rem .5rem;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.pos-suggest .btn-icon { width: 2.75rem; height: 2.75rem; }
.pos-suggest-chips, .qr-pop { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.pos-suggest-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .375rem; min-height: 44px; max-width: 16rem; padding: 0 .875rem;
    border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .8125rem; color: var(--ink); cursor: pointer; }
.pos-suggest-chip:hover { background: var(--sand); }
@media (min-width: 1024px) {
    .pos-suggest { position: static; flex: none; z-index: auto; box-shadow: none; padding: .5rem 1rem .75rem; }
}
/* Guest menus: add-on rows and "Popular with this" tiles */
.qr-addon { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 44px; padding: .5rem .75rem;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.qr-addon.is-on { border-color: var(--accent); background: var(--accent-soft); }
.qr-addon:disabled { opacity: .55; }
.qr-addon-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem;
    border: 2px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--accent-ink); }
.qr-addon.is-on .qr-addon-box { border-color: var(--accent); }
.qr-pop { padding-bottom: .25rem; }
.qr-pop-tile { flex: 0 0 7rem; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-height: 44px; padding: .5rem;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; color: var(--ink); }
.qr-pop-tile:hover { background: var(--sand); }
.qr-pop-img { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; overflow: hidden;
    border-radius: var(--r-sm); background: var(--sand); }
.qr-pop-img img { width: 100%; height: 100%; object-fit: cover; }
.qr-pop-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8125rem; font-weight: 600; line-height: 1.2; }

/* ---- Modifier workspace: groups on the left, the chosen group's options on the right ---- */
.mw { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.mw-list { overflow: hidden; }
.mw-detail { min-width: 0; }
.mw-scroll { min-height: 0; }
@media (min-width: 1024px) {
    .mw { grid-template-columns: 20.5rem minmax(0, 1fr); }
    /* the list stays in view while the options scroll; it scrolls on its own when it outgrows the screen */
    .mw-list { position: sticky; top: 5rem; max-height: calc(100dvh - 6.5rem); }
    .mw-scroll { overflow-y: auto; overscroll-behavior: contain; }
}
.mw-row { display: flex; align-items: stretch; gap: .125rem; padding: 0 .375rem 0 .25rem; transition: background-color .15s ease; }
.mw-row:hover { background: rgba(239, 235, 226, .55); }
.mw-row.is-current { background: var(--sand); box-shadow: inset 3px 0 0 var(--accent); }
.mw-link { flex: 1 1 auto; min-width: 0; display: block; padding: .75rem .5rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.mw-link:focus-visible { outline-offset: -2px; }
.mw-chev { flex: none; align-self: center; color: var(--ink-3); }
.mw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .375rem; margin-top: .125rem; font-size: .75rem; line-height: 1.25rem; color: var(--ink-2); }
.mw-meta .is-warn { color: var(--warn-ink); font-weight: 600; }
.mw-sep { color: var(--ink-3); }

/* The right pane lays itself out by its own width (the viewport also loses 264px to the sidebar):
   narrow = price and state fold under the option name and the add form folds into a button */
.mw-detail { container: mwd / inline-size; }
.mo-grid { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; column-gap: .5rem; padding: .25rem .5rem .25rem .375rem; }
.mo-head { display: none; padding-top: .5rem; padding-bottom: .5rem; background: var(--sand); font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.mo-row.is-off .mo-name, .mo-row.is-off .mo-price { color: var(--ink-3); }
.mo-price-col, .mo-state-col { display: none; }
.mo-fold { display: flex; }
.mo-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.mo-add-name, .mo-add-go { grid-column: 1 / -1; }
.mo-add-toggle { display: none; }
@container mwd (max-width: 35.99rem) {
    .mo-add-toggle { display: inline-flex; }
    .mo-add-form.is-closed { display: none; }
}
@container mwd (min-width: 36rem) {
    .mo-grid { grid-template-columns: 2rem minmax(0, 1fr) 7rem 8.5rem 5.5rem; padding-right: .75rem; }
    .mo-head { display: grid; }
    .mo-price-col { display: block; }
    .mo-state-col { display: flex; }
    .mo-fold { display: none; }
    .mo-add { grid-template-columns: minmax(0, 1fr) 8.5rem auto auto; align-items: end; }
    .mo-add-name, .mo-add-go { grid-column: auto; }
}

/* drag handle + the row being moved */
.sort-item { position: relative; background: var(--surface); }
.sort-item + .sort-item { border-top: 1px solid var(--line); }
.sort-handle { display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: stretch; width: 2rem; min-height: 2.75rem;
    padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-3); cursor: grab; touch-action: none; }
.sort-handle:hover { color: var(--ink); background: var(--sand-strong); }
.sort-handle:focus-visible { outline-offset: -2px; }
.sort-handle[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.sort-item.is-dragging { z-index: 20; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-pop); }
.sort-item.is-dragging + .sort-item, .sort-item.is-dragging { border-top-color: transparent; }
.sort-item.is-dragging .sort-handle { color: var(--accent); cursor: grabbing; }
.sort-item.is-grabbed { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
body.is-reordering, body.is-reordering * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: reduce) {
    .sort-item { transition: none !important; }
}

/* Reorder on table pages (categories, areas, banners, promotions, locations, scan pricing,
   cartons, custom fields, SA plans). reorder.js drags <tr> rows here: .sort-item is a list-row
   look whose sibling border-top would double the .tbl td border-bottom, so table rows get their
   own dragging/grabbed look. A reorder root marked data-filtering="true" (a server-side search
   or a paginated page: the full ordered set is not on screen) keeps its handles in the layout
   but hides them; reorder.js already refuses the drag itself. */
.tbl td.sort-cell { width: 2.5rem; padding: .25rem 0 .25rem .5rem; }
.tbl tbody tr.is-dragging { position: relative; z-index: 20; background: var(--surface); box-shadow: var(--shadow-pop); }
.tbl tbody tr.is-dragging td { border-bottom-color: transparent; }
.tbl tbody tr.is-dragging .sort-handle { color: var(--accent); cursor: grabbing; }
.tbl tbody tr.is-grabbed { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
[data-filtering="true"] .sort-handle { visibility: hidden; }

/* ---- Price rules: pricing mode card, sequence list, "Try it" panel ---- */
/* mode card */
.pr-modes { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; align-items: start; margin: 1rem 0 0; padding: 0; border: 0; min-width: 0; }
@media (min-width: 720px) { .pr-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pr-mode-opt { position: relative; display: flex; align-items: flex-start; gap: .75rem; min-height: 2.75rem; padding: .875rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.pr-mode-opt:hover { background: var(--sand); }
/* one rule per selector: a browser without :has() must not drop the .is-selected rule along with the :has() one */
.pr-mode-opt.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.pr-mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pr-mode-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@supports not selector(:has(*)) { .pr-mode-opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; } }
.pr-mode-dot { flex: none; width: 1.125rem; height: 1.125rem; margin-top: .125rem; border: 2px solid var(--ink-3); border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 3px var(--surface); }
.pr-mode-opt.is-selected .pr-mode-dot { border-color: var(--accent); background: var(--accent); }
.pr-mode-opt:has(input:checked) .pr-mode-dot { border-color: var(--accent); background: var(--accent); }
.pr-mode-title { display: block; font-weight: 700; color: var(--ink); }
.pr-mode-text { display: block; margin-top: .125rem; font-size: .8125rem; line-height: 1.35; color: var(--ink-2); }
.pr-mode-state { margin: .75rem 0 0; font-size: .8125rem; color: var(--ink-2); }
.pr-mode-link { display: inline-block; margin-top: .5rem; font-size: .8125rem; font-weight: 600; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
@media (forced-colors: active) {
    /* the native radio is sr-only and box-shadow/background are dropped: keep the selected card visible with system colours */
    .pr-mode-opt { border-color: ButtonText; forced-color-adjust: none; }
    .pr-mode-opt.is-selected, .pr-mode-opt:has(input:checked) { border-color: Highlight; outline: 2px solid Highlight; outline-offset: -4px; }
    .pr-mode-dot { border-color: ButtonText; background: Canvas; box-shadow: none; }
    .pr-mode-opt.is-selected .pr-mode-dot, .pr-mode-opt:has(input:checked) .pr-mode-dot { border-color: Highlight; background: Highlight; }
}

/* sequence list: compact cards by default, a single-line grid when the LIST CARD is wide (container query: the app sidebar takes 264px) */
.pr-board { container: prb / inline-size; }
#pr-list { padding-bottom: .5rem; }
.pr-explain { margin: 0; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--sand); font-size: .8125rem; color: var(--ink-2); }
.pr-hint { font-size: .75rem; color: var(--ink-2); margin-top: .375rem; }
.pr-head { display: none; }
.pr-row { scroll-margin-top: 5rem; display: grid; grid-template-columns: 2rem 1.75rem minmax(0, 1fr) auto; grid-template-areas: "handle pos main actions" "handle pos meta meta";
    column-gap: .5rem; row-gap: .25rem; align-items: center; min-height: 2.75rem; padding: 0 .5rem 0 .25rem; }
/* The grip is a 2rem x 2.75rem target at the top of the row, NOT a strip as tall as the row: .sort-handle is touch-action:none,
   so on a phone a full-height strip would turn every swipe that starts at the left edge into a drag (and a saved reorder)
   instead of scrolling the page. A drag that has started keeps its pointer capture wherever the pointer goes. */
.pr-row:target { animation: pr-flash 1.6s ease-out; }
@keyframes pr-flash { from { background: var(--accent-soft); } to { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .pr-row:target { animation: none; } }
.pr-row > .sort-handle { grid-area: handle; align-self: start; height: 2.75rem; }
.pr-pos { grid-area: pos; text-align: center; font-weight: 700; font-size: .8125rem; color: var(--ink-2); }
.pr-main { grid-area: main; min-width: 0; margin-top: .5rem; }
.pr-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; min-width: 0; margin-bottom: .625rem; font-size: .8125rem; color: var(--ink-2); }
.pr-meta > span { min-width: 0; overflow-wrap: anywhere; }
.pr-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: .375rem; margin-top: .5rem; }
.pr-status { order: -1; }
.pr-name { display: block; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pr-deal { display: block; margin-top: .125rem; font-size: .75rem; color: var(--ink-2); }
.pr-cap { margin-top: .375rem; max-width: 100%; white-space: normal; }
.pr-row.is-off .pr-name { color: var(--ink-2); }
.pr-shadow { display: block; margin-top: .25rem; font-size: .75rem; color: var(--warn-ink); overflow-wrap: anywhere; }
@container prb (min-width: 56rem) {
    .pr-head, .pr-row { grid-template-columns: 2rem 2rem minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.9fr) 5.25rem 5.5rem; grid-template-areas: none; column-gap: .5rem; align-items: center; }
    .pr-head { display: grid; padding: .5rem .5rem .5rem .25rem; background: var(--sand); border-bottom: 1px solid var(--line); font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
    .pr-head > span:nth-child(2) { text-align: center; }
    .pr-row { padding: 0 .5rem 0 .25rem; }
    .pr-pos, .pr-main, .pr-applies, .pr-branch, .pr-when, .pr-status, .pr-actions { margin-block: .375rem; }
    .pr-meta { display: contents; }
    .pr-row > .sort-handle { grid-area: 1 / 1; align-self: center; }
    .pr-pos { grid-area: 1 / 2; }
    .pr-main { grid-area: 1 / 3; }
    .pr-applies { grid-area: 1 / 4; min-width: 0; overflow-wrap: anywhere; }
    .pr-branch { grid-area: 1 / 5; min-width: 0; overflow-wrap: anywhere; }
    .pr-when { grid-area: 1 / 6; min-width: 0; font-size: .75rem; }
    .pr-status { grid-area: 1 / 7; order: 0; }
    .pr-actions { grid-area: 1 / 8; }
}

/* try it */
#pr-try { scroll-margin-top: 5rem; }   /* the sticky top bar is 4rem: a jump to #pr-try must not hide the heading under it */
.pr-try-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: 1rem; }
@media (min-width: 720px) { .pr-try-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; align-items: start; } }
.pr-try-actions { display: flex; gap: .5rem; }
@media (min-width: 720px) { .pr-try-actions { padding-top: 1.375rem; } }
.pr-result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.pr-steps { margin: .5rem 0 0; padding: 0; list-style: none; }
.pr-step { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; overflow-wrap: anywhere; }
.pr-step > span { min-width: 0; }   /* a rule name of 100 letters without a space must wrap, not widen the page */
.pr-final { margin-top: .75rem; font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.pr-ignored { margin-top: .75rem; font-size: .8125rem; color: var(--ink-2); overflow-wrap: anywhere; }
.pr-note { color: var(--warn-ink); }
/* the hints inside the rule forms (position, cap, days...) read at the stronger contrast too */
#pr-create-form .hint, form[id^="pr-edit-form-"] .hint { color: var(--ink-2); }
#pr-create-form .hint.pr-note, form[id^="pr-edit-form-"] .hint.pr-note { color: var(--warn-ink); }

/* Day and item chips in the price rule forms. One short class pair instead of a long utility string, because the
   forms repeat them for every rule (7 days x N rules) and the item checklist repeats them for every item. */
.pr-chip-wrap { cursor: pointer; -webkit-user-select: none; user-select: none; }
.pr-chip { display: inline-flex; padding: .375rem .75rem; border: 1px solid var(--line); border-radius: 9999px; background: var(--surface); color: var(--ink-2); font-size: .875rem; line-height: 1.25rem; font-weight: 500; transition: color .15s, background-color .15s, border-color .15s; }
.pr-chip-wrap input:checked + .pr-chip { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.pr-chip-wrap input:focus-visible + .pr-chip { box-shadow: 0 0 0 2px var(--accent); }
@media (prefers-reduced-motion: reduce) { .pr-chip { transition: none; } }
@media (forced-colors: active) {
    .pr-chip { border-color: ButtonText; forced-color-adjust: none; background: Canvas; color: CanvasText; }
    .pr-chip-wrap input:checked + .pr-chip { border-color: Highlight; outline: 2px solid Highlight; outline-offset: -4px; }
    .pr-chip-wrap input:focus-visible + .pr-chip { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* ===== Queue display board (qd-) — lobby TV, see app/queue/display.blade.php =====
   Stays in the light MUJI system (x-ui.*, .badge-*), not the Kitchen board's dark kb-
   tokens — this is a guest-facing lobby screen, not an operational staff board. Voice
   announcement (speechSynthesis) is never the only signal a ticket was called: a newly
   called ticket also gets this calm pulsing ring, same "sonar" motion language as
   .waiter-alert/.nav-badge-alert but in the calmer "called" (info) tone instead of bad/red. */
@keyframes qd-sonar {
    0% { box-shadow: 0 0 0 0 rgba(90, 120, 150, .35); }
    100% { box-shadow: 0 0 0 16px rgba(90, 120, 150, 0); }
}
.qd-new {
    animation: qd-sonar 1.8s ease-out 4;
    border-color: var(--info) !important;
}
@media (prefers-reduced-motion: reduce) {
    .qd-new { animation: none; }
}
/* ===== END queue display board (qd-) ===== */

/* ===== Select dropdown beautify =====
   The closed .select control is styled above (~line 130). This block styles the OPTION LIST —
   the popup itself — via Chromium's customizable select (appearance: base-select, Chrome 135+),
   as pure progressive enhancement: Firefox/Safari ignore the whole @supports block and keep
   today's native popup. House MUJI tokens only. Each refinement that leans on a newer
   pseudo-element (::picker-icon, ::checkmark, @starting-style) sits in its OWN rule, so a
   browser that lacks one drops only that refinement, never the panel styling. */

/* Cross-browser trigger polish: a quiet hover cue on the closed control. */
.select:hover:not(:disabled) { border-color: var(--ink-3); transition-duration: 120ms; }

@supports (appearance: base-select) {
    select.select:not([multiple]):not([size]) {
        appearance: base-select;
        /* base-select renders its own ::picker-icon; the legacy inline-SVG chevron would double it */
        background-image: none;
        /* Owner feedback (2026-10-29): base-select replaces the UA's internal centering, which
           left the text high and the icon in the corner — flex re-centres both on the control's
           2.75rem line, and the 2.25rem right inset reserved for the removed background chevron
           shrinks back to the shared .875rem. */
        display: flex;
        align-items: center;
        gap: .5rem;
        padding-right: .875rem;
        overflow: hidden;
    }

    /* The popup panel */
    select.select:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: .65rem;
        box-shadow: var(--shadow-pop);
        padding: .25rem;
        max-height: 18rem;
        overscroll-behavior: contain;
    }

    /* Options */
    select.select:not([multiple]):not([size]) option {
        padding: .5rem .75rem;
        border-radius: .4rem;
        cursor: pointer;
        gap: .5rem;
    }
    select.select:not([multiple]):not([size]) option:hover,
    select.select:not([multiple]):not([size]) option:focus-visible {
        background: var(--sand);
    }
    select.select:not([multiple]):not([size]) option:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: -2px;
    }
    select.select:not([multiple]):not([size]) option:checked { font-weight: 600; }
    select.select:not([multiple]):not([size]) option::checkmark { color: var(--accent); }

    /* Group labels: small muted uppercase, like the app's other section labels */
    select.select:not([multiple]):not([size]) optgroup label {
        font-size: .6875rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--ink-3);
        padding: .5rem .75rem .25rem;
    }

    /* The chevron base-select draws: the UA triangle becomes a thin house chevron (currentColor
       through an SVG alpha mask — 'white' in the data-URI is the mask shape, never a painted
       colour), pushed to the inline end and rotated while the popup is open. Own rule on
       purpose: a browser that rejects any of it keeps a plain glyph and the panel styling
       above is untouched. */
    select.select:not([multiple]):not([size])::picker-icon {
        content: '';
        flex: none;
        margin-inline-start: auto;
        width: 1rem;
        height: 1rem;
        color: var(--ink-3);
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 1rem 1rem no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 1rem 1rem no-repeat;
        transition: rotate 150ms ease;
    }
    select.select:not([multiple]):not([size]):open::picker-icon { rotate: 180deg; }

    /* Entry animation: a 120ms fade + 4px rise. display/overlay transition with allow-discrete
       keeps the popup around while it fades in; @starting-style supplies the from-state. */
    @media (prefers-reduced-motion: no-preference) {
        select.select:not([multiple]):not([size])::picker(select) {
            opacity: 1;
            translate: 0 0;
            transition: opacity 120ms ease, translate 120ms ease,
                display 120ms allow-discrete, overlay 120ms allow-discrete;
        }
        @starting-style {
            select.select:not([multiple]):not([size]):open::picker(select) {
                opacity: 0;
                translate: 0 4px;
            }
        }
    }
}

/* ===== Arrange menu (am-): the per-category item drag-ordering page =====
   resources/views/app/items/arrange.blade.php. A category rail (vertical list on lg+,
   a horizontally scrolling chip strip below that — the strip scrolls, never the page)
   beside the draggable item list. Tokens only. This block must stay BEFORE the kitchen
   stations routing board block: StationBoardAssetsTest pins that one last in the file. */
.am-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.am-rail { display: flex; gap: .375rem; overflow-x: auto; touch-action: pan-x; -webkit-overflow-scrolling: touch; padding: .5rem; }
.am-cat { display: flex; align-items: center; gap: .625rem; flex: none; min-height: 2.75rem; max-width: 16rem; padding: .375rem .75rem;
    border-radius: var(--r-sm); font-size: .875rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
    white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.am-cat:hover { background: var(--sand); color: var(--ink); }
.am-cat:focus-visible { outline-offset: -2px; }
.am-cat[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.am-count { margin-left: auto; flex: none; padding: .0625rem .5rem; border-radius: 999px;
    font-size: .75rem; font-variant-numeric: tabular-nums; background: var(--sand); color: var(--ink-3); }
.am-cat[aria-current="page"] .am-count { background: var(--surface); color: var(--accent-ink); }
@media (min-width: 1024px) {
    .am-layout { grid-template-columns: 16.25rem minmax(0, 1fr); }
    .am-rail-card { position: sticky; top: 5rem; max-height: calc(100dvh - 6.5rem); overflow-y: auto; }
    .am-rail { display: block; overflow: visible; padding: .375rem; }
    .am-cat { white-space: normal; max-width: none; }
    .am-cat + .am-cat { margin-top: .125rem; }
    .am-cat[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
}

/* ===== Queue staff board (qs-): the host's walk-in queue page =====
   resources/views/app/queue/index.blade.php. The lobby TV board is the qd- block above;
   this is the operational side of the same queue. The whole point of the block is COLUMNS:
   at thirty parties a wrapping flex row reads as thirty ragged blobs, so every waiting row
   is the same grid with the same column order and the same height — position, ticket, name,
   party size, waited, actions — and the eye can run straight down the ticket column.
   Mobile-first (two lines below 640px, one row from 640px up), same shape as the am- block.
   Tokens only. This block must stay BEFORE the kitchen stations routing board block:
   StationBoardAssetsTest pins that one last in the file. */

/* The four facts above the line, from data the page already loaded. */
.qs-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; padding: .875rem 1rem; border-bottom: 1px solid var(--line); }
.qs-strip-label { font-size: .75rem; color: var(--ink-2); }
.qs-strip-value { font-size: .9375rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* One called party. A flat sand panel, not another white card with the same shadow — the
   zone has to read as a different surface from the white rows of the line below it. */
.qs-called { background: var(--sand); border-radius: var(--r); padding: .875rem 1rem; display: grid; gap: .625rem; }
.qs-called-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.qs-called-actions { display: flex; align-items: center; gap: .5rem; }
.qs-called-actions .btn { min-height: 2.25rem; }

/* A row of the line. */
.qs-row {
    display: grid;
    align-items: center;
    gap: .5rem .625rem;
    padding: .75rem 1rem;
    grid-template-columns: 1.75rem auto minmax(0, 1fr) auto;
    grid-template-areas:
        "pos ticket party waited"
        "name name   name   act";
}
/* The quiet position gutter. ink-2, not ink-3: ink-3 on white is 3.8:1 (see the rb- block's
   own note below), and this numeral is small real text, so the smaller size and the narrow
   right-aligned gutter do the quietening instead of a failing contrast ratio. */
.qs-pos { grid-area: pos; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.qs-ticket { grid-area: ticket; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qs-name { grid-area: name; display: flex; align-items: center; gap: .5rem; min-width: 0; }
/* the name never wraps and never pushes a column around: it gives way with an ellipsis */
.qs-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.qs-name .badge { flex: none; }
.qs-party { grid-area: party; display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Waited is toned by age: neutral, then warn from 15 minutes, then bad from 30 (hardcoded
   on purpose — deliberately NOT a tenant setting). The minutes themselves carry the
   information; the colour only reinforces what the number already says. */
.qs-waited { grid-area: waited; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qs-waited[data-age="warn"] { color: var(--warn-ink); }
.qs-waited[data-age="bad"] { color: var(--bad-ink); }
.qs-actions { grid-area: act; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.qs-actions .btn { min-height: 2.25rem; }

/* The destructive row of an overflow menu: x-ui.delete-button (which carries the confirm
   step) fills the menu's width and left-aligns with the .nav-item rows above it. Done here
   rather than with utilities so it cannot lose to .btn's own justify-content. */
.qs-menu-remove { width: 100%; justify-content: flex-start; }

/* The per-row overflow menu is position: absolute inside its own .relative wrapper, which
   has no z-index of its own, so the open panel's z-50 lands in the page's root stacking
   context and paints over the rows below. Nothing here may introduce overflow, transform,
   filter, contain or opacity on a row or on the list: any of those would make the row a
   stacking/clipping context and the menu would be cut off at the row's edge. */
.qs-list { min-width: 0; }

/* The column header: only worth showing once the row IS a single aligned line. */
.qs-head { display: none; }

@media (min-width: 640px) {
    .qs-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .qs-row, .qs-head {
        grid-template-columns: 2.25rem minmax(2.75rem, auto) minmax(0, 1fr) 4.5rem 5rem auto;
        grid-template-areas: "pos ticket name party waited act";
        gap: .75rem;
        /* every row the same height, so the ticket column reads as a column */
        min-height: 3.5rem;
        padding-top: .375rem;
        padding-bottom: .375rem;
    }
    .qs-head { display: grid; align-items: center; padding: .5rem 1rem; min-height: 0; border-bottom: 1px solid var(--line); }
    .qs-head > * { font-size: .6875rem; font-weight: 600; color: var(--ink-2); }
    .qs-head-pos { grid-area: pos; text-align: right; }
    .qs-head-ticket { grid-area: ticket; }
    .qs-head-name { grid-area: name; }
    .qs-head-party { grid-area: party; }
    .qs-head-waited { grid-area: waited; }
}

@media (forced-colors: active) {
    /* the age tone is a colour reinforcement only; in forced colours the text goes back to
       the system colour and the minutes still say everything they need to */
    .qs-waited[data-age="warn"], .qs-waited[data-age="bad"] { color: CanvasText; }
    .qs-called { border: 1px solid CanvasText; }
}

/* ===== END queue staff board (qs-) ===== */

/* ===== BEGIN till surfaces (is-till) ===== */
/* The register, the floor and the waiter board are worked standing up, at arm's length,
   usually on a tablet and usually at speed. The shared controls are sized for a mouse:
   .btn 40px, .btn-sm 34px, .btn-icon 36px, .seg-item about 29px. That already clears the
   WCAG 2.2 web minimum of 24px, so this is not an accessibility fix -- it is a product
   one. A till wants a finger-sized target, and a cashier reaching past a customer does
   not get a second attempt.

   Lifted on coarse pointers and narrow screens ONLY, so the mouse-driven admin and report
   pages keep their compact rhythm. Same device-scoped approach the kitchen stations board
   below already takes for its own controls.

   Keyed on body.is-till rather than on the layout, because layouts/pos.blade.php is also
   the TV queue display and the kitchen board: the TV has no pointer to speak of and the
   board already sizes itself. Opting in per view keeps this to the three surfaces a
   finger actually drives. */
@media (pointer: coarse), (max-width: 639px) {
    body.is-till .btn { min-height: 2.75rem; }
    body.is-till .btn-sm { min-height: 2.75rem; padding-inline: .875rem; }
    body.is-till .btn-icon { min-width: 2.75rem; min-height: 2.75rem; }
    /* .seg-item is padding-only, so it needs the box as well as the height */
    body.is-till .seg-item { display: inline-flex; align-items: center; min-height: 2.5rem; }
}

/* The item tile is the one surface a cashier reads all shift, so the money is the
   subject. The price used to be .875rem in ink-2 -- quieter than the item name directly
   above it, which is the wrong way round on a till. It is now the tile's one confident
   figure: full ink, 700, tabular so a column of prices lines up across the grid.

   16px was off the radius scale (--r-sm 10 / --r 12 / --r-card 20). 12px puts it back on
   the scale and reads more like equipment than like a web card. */
.pos-tile { border-radius: var(--r); }
.pos-tile-price { font-size: .9375rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Blocked and out-of-window items stay on the grid on purpose -- staff need to see that a
   dish exists and why it cannot be sold. The old whole-tile opacity dimmed the one thing
   that mattered, the reason itself, to around 2:1 against the surface. So the SURFACE
   carries the unavailable state and the status line keeps full contrast. */
.pos-tile.is-muted { background: var(--sand); border-color: var(--line-strong); }
.pos-tile.is-muted > :not(.pos-tile-status) { opacity: .5; }
/* A muted tile is still a live button — an out-of-window dish can be added once the
   cashier confirms it — so it keeps its hover and press feedback. Only the look of
   "not sellable right now" changes, never the affordance. */

/* "Your tap landed." Every add on the register is a network round trip, and the tiles
   gave no sign one was in flight -- only :active scale, which ends when the finger lifts.
   On a slow link the cashier taps, sees nothing change, and taps again, which adds the
   dish twice. (api()'s seq guard discards stale RESPONSES; two deliberate taps are two
   legitimate adds and both land.)

   Rides the EXISTING ui.busy, set in api() and cleared in its .finally() under
   `if (my === this.seq)`, so the newest request always owns the flag and it cannot leak.
   No new state on the money path. Absolutely positioned on the category strip's bottom
   border so it can never shift the item grid underneath it. Deliberately does NOT block
   input: a till that stops accepting taps while it talks to the server feels broken. */
.pos-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; background: var(--line); }
.pos-progress::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
    background: var(--accent); animation: pos-progress 900ms ease-in-out infinite;
}
@keyframes pos-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(350%); }
}

@media (prefers-reduced-motion: reduce) {
    .pos-tile { transition: none !important; }
    .pos-tile:active { transform: none !important; }
    /* The bar stays and stops travelling: conveying "working" is the point, the
       travel is only the decoration. */
    .pos-progress::after { animation: none; width: 100%; opacity: .55; }
}
@media (forced-colors: active) {
    .pos-tile.is-muted { background: Canvas; border-color: GrayText; }
    .pos-tile.is-muted > :not(.pos-tile-status) { opacity: 1; }
}
/* ===== END till surfaces (is-till) ===== */

/* ===== BEGIN catalogue hotspot editor (hs-) ===== */
/* Used by resources/views/app/catalogue/edit.blade.php. Tokens only.

   The markers sit on top of the venue's own artwork, which can be any colour, so every
   edge here is drawn twice: a white outer ring and an accent inner one. A single-colour
   outline disappears against whichever background happens to be behind it, and an invisible
   control on a page you are trying to lay out is worse than an ugly one. */
.hs-marker {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--accent);
    background: rgba(176, 81, 30, .16);
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95);
    color: var(--accent-ink);
    cursor: grab;
    transition: background-color .15s ease, box-shadow .15s ease;
    /* The marker is a drag handle, so the browser must never take the gesture for a
       scroll. The corner handles below already said so; the marker itself did not, and
       on a tablet that is not a cosmetic difference. The browser claimed the gesture a
       couple of frames in, stopped delivering pointermove, and fired pointercancel
       instead of pointerup -- so the marker stopped following the finger, the save in
       the pointerup handler never ran, and the listeners that handler removes stayed on
       document. Measured: the marker moved a fifth of the gesture, the new position was
       never written, and afterwards it followed the pointer around the page with
       nothing held down. */
    touch-action: none;
}

.hs-marker:hover { background: rgba(176, 81, 30, .26); }
.hs-marker:active { cursor: grabbing; }

/* A marker drawn at 4% x 3% is a few pixels to grab. The VISUAL stays true to the
   authored size — an editor that silently drew hotspots bigger than they are would
   be lying about the thing being authored — but a transparent pad brings the grab
   area up to the 24px pointer-target minimum. The guest book takes the opposite
   trade and floors the visual too, because there the target is all that matters. */
.hs-marker::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 1.5rem);
    height: max(100%, 1.5rem);
    transform: translate(-50%, -50%);
}

/* The selected marker is filled, not merely outlined: it has to be obvious which one the
   arrow keys and the side panel are about. */
.hs-marker.is-on {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95), var(--shadow-pop);
}

.hs-marker-num { font-size: 11px; font-weight: 700; line-height: 1; }
.hs-marker-ico { width: 18px; height: 18px; }
.hs-marker-img { width: 60%; height: 60%; max-width: 28px; max-height: 28px; object-fit: contain; }

/* 12px visual, 24px hit area through the pseudo-element — the same trick the guest book's
   compare button uses, and what keeps these inside the 24px pointer-target minimum
   without putting four fat squares on top of the artwork being laid out. */
.hs-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--surface);
    border: 1.5px solid var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .95);
    touch-action: none;
}

.hs-handle::after {
    content: "";
    position: absolute;
    inset: -6px;
}

.hs-handle.is-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.hs-handle.is-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.hs-handle.is-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.hs-handle.is-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }

/* Mark picker swatches. */
.hs-pick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.hs-pick:hover { border-color: var(--accent); color: var(--accent-ink); }

.hs-pick.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-ink);
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* Colour swatches. --sw is the swatch's own colour, set inline from the server's
   palette, so one rule serves all eight. */
.hs-swatch {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 2px solid var(--surface);
    background: var(--sw, var(--accent));
    box-shadow: 0 0 0 1px var(--line-strong);
    transition: box-shadow .15s ease, transform .15s ease;
}

.hs-swatch:hover { transform: scale(1.06); }

/* The selected swatch is ringed in ink rather than tinted, because a tint would
   compete with the colour the swatch exists to show. */
.hs-swatch.is-on {
    box-shadow: 0 0 0 2px var(--ink);
}

/* Animation picker: each option performs its own animation, because the motion is
   the content here. The one place a looping animation is right. */
.hs-demo-dot {
    width: .875rem;
    height: .875rem;
    border-radius: 999px;
    background: currentColor;
}

.hs-demo-pulse .hs-demo-dot { animation: hs-attn-pulse 1s cubic-bezier(.4, 0, .2, 1) infinite; }
.hs-demo-glow .hs-demo-dot { animation: hs-attn-glow 1.3s ease-in-out infinite; }
.hs-demo-ring .hs-demo-dot { animation: hs-attn-ring 1.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.hs-demo-bounce .hs-demo-dot { animation: hs-attn-bounce .75s cubic-bezier(.3, 1.4, .5, 1) infinite; }
.hs-demo-wiggle .hs-demo-dot { animation: hs-attn-wiggle .5s ease-in-out infinite; }

/* The same bursts on the canvas marker, played once when the choice is made so the
   venue sees it where it will actually appear. Three cycles, matching the guest
   book exactly -- these keyframes and guest.css's catbook-attn-* are the same
   motion described for two different markers. */
.hs-attn-pulse { animation: hs-attn-pulse 1s cubic-bezier(.4, 0, .2, 1) 3; }
.hs-attn-glow { animation: hs-attn-glow 1.3s ease-in-out 3; }
.hs-attn-ring { animation: hs-attn-ring 1.4s cubic-bezier(.2, .6, .3, 1) 3; }
.hs-attn-bounce { animation: hs-attn-bounce .75s cubic-bezier(.3, 1.4, .5, 1) 3; }
.hs-attn-wiggle { animation: hs-attn-wiggle .5s ease-in-out 3; }

@keyframes hs-attn-pulse {
    0%, 100% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95); }
    50% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95), 0 0 0 6px color-mix(in srgb, var(--hs-mark, var(--accent)) 30%, transparent); }
}

@keyframes hs-attn-glow {
    0%, 100% { background: rgba(176, 81, 30, .16); }
    50% { background: color-mix(in srgb, var(--hs-mark, var(--accent)) 45%, transparent); }
}

@keyframes hs-attn-ring {
    0% { outline: 2px solid var(--hs-mark, var(--accent)); outline-offset: 0; opacity: 1; }
    100% { outline: 2px solid var(--hs-mark, var(--accent)); outline-offset: 10px; opacity: .25; }
}

@keyframes hs-attn-bounce {
    0%, 100% { transform: translateY(0); }
    35% { transform: translateY(-5px); }
    70% { transform: translateY(-2px); }
}

@keyframes hs-attn-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-9deg); }
    75% { transform: rotate(9deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hs-marker, .hs-pick, .hs-swatch { transition: none; }

    /* The picker loses its demo motion, so the label it already carries becomes the
       whole answer — which is why each option has a title and an aria-label rather
       than relying on the animation to explain itself. */
    .hs-demo .hs-demo-dot,
    .hs-attn-pulse, .hs-attn-glow, .hs-attn-ring, .hs-attn-bounce, .hs-attn-wiggle {
        animation: none;
    }
}

@media (forced-colors: active) {
    /* The tinted fills and the white ring both vanish in forced colours, so selection has
       to be carried by something the mode keeps: a thicker border and the system's own
       highlight pair. */
    .hs-marker { border: 2px solid ButtonBorder; background: Canvas; color: ButtonText; }
    .hs-marker.is-on { border-color: Highlight; background: Highlight; color: HighlightText; }
    .hs-handle { background: ButtonFace; border-color: ButtonBorder; }
    .hs-pick.is-on { border-color: Highlight; box-shadow: inset 0 0 0 2px Highlight; }
}
/* ===== END catalogue hotspot editor (hs-) ===== */

/* ===== BEGIN kitchen stations routing board (rb-) ===== */
/* Used by resources/views/app/kitchen-stations/index.blade.php and public/js/route-board.js. Tokens only.
   Text is ink or ink-2 (ink-3 on white is 3.8:1, on sand 3.2:1: below 4.5:1, so it is never used for text here). */
.rb { min-width: 0; }
.rb-wrap { min-width: 0; overflow-wrap: anywhere; }
/* an unbroken name (a station name may be 60 characters, a printer name 100) wraps anywhere in the cards, the notices, the notes and the Move dialog: no sideways scrolling */
.rb-col, .rb-notice, .rb-notes, .rb-pick-list { overflow-wrap: anywhere; }

/* notices above the board */
.rb-notice { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem .625rem; margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--line-strong);
    border-radius: var(--r); background: var(--surface); font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.rb-notice p { flex: 1 1 14rem; min-width: 0; }
.rb-notice.is-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn-ink); }
.rb-notice.is-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info-ink); }
.rb-notice a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* search (only above 12 categories) */
.rb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; margin: 0 0 1rem; }
.rb-search { position: relative; flex: 1 1 14rem; max-width: 22rem; }
.rb-search .input { padding-left: 2.5rem; }
.rb-search .input::placeholder, .rb-form .input::placeholder { color: var(--ink-2); }   /* the global placeholder is ink-3 (3.8:1) */
/* the global .input:focus rule (specificity 0,2,0) removes the outline and shows only a border and a faint halo; give these inputs the page's real focus ring (0,3,0 wins) */
.rb-search .input:focus-visible, .rb-form .input:focus-visible, .rb-form .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rb-status { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* the board: columns wrap, the page never scrolls sideways (auto-fill, not auto-fit: a lone column keeps its width); the cards of a row are as tall as the tallest */
.rb-board { display: grid; gap: 1rem; align-items: stretch; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }  /* stretch: the whole lane of a short column is a drop target (X21) */
.rb-col { position: relative; min-width: 0; }          /* overflow stays visible: a dragged chip floats over its neighbours */
.rb-col.is-default { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent), var(--shadow-soft); }
.rb-col.is-off { border-style: dashed; border-color: var(--line-strong); background: var(--sand); box-shadow: none; }
.rb.is-dragging-chip .rb-col:not(.is-target) { outline: 2px dashed var(--line-strong); outline-offset: 2px; }
.rb-col.is-target { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.rb-target-label { display: none; position: absolute; top: -.75rem; left: 1rem; z-index: 2; padding: .1875rem .625rem; border: 1px solid var(--accent);
    border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .75rem; font-weight: 700; line-height: 1.2; }
.rb-col.is-target .rb-target-label { display: inline-flex; }

/* column header */
.rb-head { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--line); }
.rb-title { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; }
.rb-title h2 { min-width: 0; font-size: 1rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.rb-count { margin-top: .25rem; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rb-printer { margin-top: .5rem; font-size: .8125rem; color: var(--ink-2); }
.rb-printer-warn { display: flex; align-items: flex-start; gap: .375rem; margin-top: .5rem; padding: .5rem .625rem; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink-2); }
.rb-note { margin-top: .5rem; font-size: .75rem; line-height: 1.4; color: var(--ink-2); }
.rb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-top: .75rem; }
.rb-actions .btn { flex: none; }
/* skip link (one per column except the last; each chip is two tab stops): hidden until it has focus */
.rb-skip:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rb-skip:focus { display: inline-block; margin-top: .5rem; font-size: .8125rem; font-weight: 700; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* chips */
.rb-chips { display: grid; gap: .5rem; margin: 0; padding: .75rem; list-style: none; }
.rb-chip { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: .25rem;
    min-height: 3rem; padding: .25rem .375rem .25rem .125rem; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.rb-chip[hidden] { display: none; }
.rb-chip[data-auto="1"] { border-style: dashed; background: var(--paper); }
/* the grip is a 44 px tall target at the top-left of the chip, NOT a strip as tall as a chip that wraps to many lines
   (.sort-handle is touch-action:none: a full-height strip would turn every swipe that starts at the left edge into a drag) */
.rb-chip .sort-handle { width: 2rem; height: 2.75rem; align-self: start; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.rb-chip-body { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; column-gap: .25rem; min-width: 0; }
/* the name keeps at least 6rem: a row too narrow for name + Move to... (large text, a small phone) wraps the button under the name instead of squeezing the name to a few letters.
   6rem, not more: a normal board column (16rem and up) must keep the button beside the name */
.rb-chip-text { flex: 1 1 6rem; min-width: 0; padding: .375rem .25rem; }
.rb-chip-name { display: block; font-weight: 600; line-height: 1.3; color: var(--ink); }
.rb-chip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .5rem; margin-top: .125rem; font-size: .75rem; color: var(--ink-2); }
.rb-tag { display: inline-flex; align-items: center; padding: .0625rem .4rem; border-radius: 999px; background: var(--sand); color: var(--ink-2); font-size: .6875rem; font-weight: 700; line-height: 1.4; }
.rb-tag-auto, .rb-tag-saving { display: none; }
.rb-chip[data-auto="1"] .rb-tag-auto { display: inline-flex; }
.rb-col[data-key="pool"] .rb-tag-auto { display: none; }
.rb-chip.is-saving .rb-tag-saving { display: inline-flex; }
.rb-chip.is-saving, .rb-chip.is-saving .rb-moveto { cursor: progress; }
.rb-moveto { flex: none; align-self: flex-start; min-height: 2.75rem; padding: 0 .625rem; }
.rb-chip.is-dragging { z-index: 25; border-style: solid; border-color: var(--accent); background: var(--surface); box-shadow: var(--shadow-pop); cursor: grabbing; }
.rb-chip.is-dragging .sort-handle { color: var(--accent); cursor: grabbing; }
.rb-chip.is-grabbed { border-style: solid; background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.rb-chip.is-landed { outline: 2px solid var(--accent); outline-offset: -2px; }   /* 1.5 s cue after a dialog move; not motion */
/* the layout's top bar is sticky and 64 px tall: scrollIntoView() and Tab-focus scrolling ignore it unless the target has a scroll margin (WCAG 2.4.11) */
.rb-chip, .rb-chip button, .rb-actions > *, .rb-search, .rb-title h2, .rb-skip { scroll-margin-top: 5rem; scroll-margin-bottom: 1.5rem; }

/* empty column + search captions */
.rb-empty { display: none; margin: .75rem; padding: 1.25rem .75rem; border: 2px dashed var(--line-strong); border-radius: var(--r); text-align: center;
    font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.rb-col.is-empty .rb-empty { display: block; }
.rb-col.is-empty .rb-chips { display: none; }
.rb-col.is-target .rb-empty { border-color: var(--accent); color: var(--accent-ink); }
.rb-nomatch { display: none; margin: 0 .75rem .75rem; font-size: .8125rem; color: var(--ink-2); }
.rb-col.is-filtered-out .rb-nomatch { display: block; }

/* notes under the board */
.rb-notes { display: grid; gap: .5rem; margin-top: 1.25rem; font-size: .8125rem; line-height: 1.5; color: var(--ink-2); max-width: 52rem; }

/* Move dialog */
.rb-pick-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.rb-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; width: 100%; min-height: 3.5rem; padding: .625rem .875rem;
    border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; touch-action: manipulation; }
.rb-pick:hover { background: var(--sand); }
.rb-pick[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.rb-pick-text { flex: 1 1 8rem; min-width: 0; }   /* the Current badge wraps under the name when the dialog is narrow or the text large */
.rb-pick-name { display: block; font-weight: 700; }
.rb-pick-sub { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--ink-2); }

/* the station dialogs: hints and toggle hints read at the stronger ink (the components use the muted token) */
.rb-form .hint, .rb-form .text-ink-3 { color: var(--ink-2); }

/* a finger: 44 px targets on touch screens and on phones */
@media (pointer: coarse), (max-width: 639px) {
    .rb-chip .sort-handle { width: 44px; }   /* px, not rem: a larger text size must not double the grip and squeeze the name */
    .rb-actions .btn { min-height: 2.75rem; }
    .rb-actions .btn-icon { min-width: 2.75rem; }
    .rb-notice .btn { min-height: 2.75rem; }
    .rb-new { min-height: 2.75rem; }           /* "New station" in the page header and "Add a station" in the empty state (the shared .btn is 40 px, .btn-sm 34 px) */
    .rb-form .btn { min-height: 2.75rem; }     /* Cancel and the submit button of the New / Edit station dialogs */
    .rb-form label:has(input[type="checkbox"]) { min-height: 2.75rem; }   /* the Default / Active switch rows: the whole row is the target (18 px tall without a hint) */
    .rb-cancel { min-height: 2.75rem; }        /* the Move dialog's Cancel; the shared X is 36 px and not editable */
}
/* The delete confirmation is the layout's shared dialog (layouts/partials/overlays.blade.php), outside .rb. The :has() scope keeps this block
   from changing the dialog on any other page; a browser without :has() ignores this rule and keeps the shared 40 px buttons. Own rule on purpose. */
@media (pointer: coarse), (max-width: 639px) {
    body:has(.rb) [role="dialog"][aria-label="Confirm action"] .btn { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
    .rb-chip, .rb-col, .rb-pick { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
    .rb-chip { border-color: ButtonText; }
    .rb-col.is-target, .rb-chip.is-grabbed, .rb-chip.is-dragging, .rb-pick[aria-current="true"] { outline: 3px solid Highlight; outline-offset: 2px; }
}
/* ===== END kitchen stations routing board (rb-) ===== */
