/*
 * 7Code admin shell — plain CSS (no build step), loaded after the Tailwind bundle by components/layouts/app.blade.php.
 * Everything sits in the "components" layer: it restyles the shared component classes (.card, .btn-*, .input …)
 * while Tailwind utilities on a page (px-2, text-sm …) still win, exactly as before.
 * Tenant colours arrive as custom properties from the layout: --brand, --on-brand, --brand-ink, --brand-deep,
 * --brand-soft, --brand-tint (App\Core\Support\BrandPalette: --brand-ink always reads 4.5:1 on white).
 */
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/cairo-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/cairo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@layer components {
:root {
    --sea: #0c2230;          /* sidebar: the Red Sea after sunset */
    --sea-2: #133243;
    --sea-3: #1d4356;
    --sea-text: #d3dee3;
    --sea-muted: #93aab5;
    --paper: #f2f4f3;
    --surface: #ffffff;
    --line: #dfe5e2;
    --line-2: #c9d2ce;
    --ink: #13212b;
    --ink-2: #44545d;
    --ink-3: #5f6f77;
    --ok: #16794a;   --ok-bg: #e5f4ec;
    --warn: #9a4a00; --warn-bg: #fdf0dc;
    --bad: #b4232b;  --bad-bg: #fbe7e7;
    --info: #1d57b8; --info-bg: #e6eefb;
    --radius: 14px;
    --radius-sm: 10px;
    --side-w: 272px;
    --top-h: 60px;
    --tabs-h: 64px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

html { -webkit-text-size-adjust: 100%; color-scheme: light; scroll-padding-top: calc(var(--top-h) + 12px); }
.shell button, .shell a, .shell summary, .shell label { touch-action: manipulation; }
body.shell { background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.6; }
.shell :focus-visible { outline: 3px solid var(--brand-ink, #0f766e); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: 0 6px 24px rgba(12, 34, 48, .18); font-weight: 600; }
.skip-link:focus { top: 12px; }
.ico { flex: none; display: block; }

/* ---------- layout frame ---------- */
.sh { display: flex; min-height: 100vh; }
.sh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sh-content { flex: 1; width: 100%; max-width: 1280px; margin-inline: auto; padding: 24px 28px 48px; }

/* ---------- sidebar ---------- */
.sh-side { position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none; display: flex; flex-direction: column; background: var(--sea); color: var(--sea-text); z-index: 40; }
.sh-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sh-logo { width: 48px; height: 48px; flex: none; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 0 0 4px var(--brand); }
.sh-logo img { width: 100%; height: 100%; object-fit: contain; }
.sh-logo--mono { background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 22px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
.sh-brand-text { min-width: 0; }
.sh-brand-name { display: block; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-brand-product { display: block; color: var(--sea-muted); font-size: 12.5px; line-height: 1.4; }

.sh-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 10px 16px; scrollbar-width: thin; scrollbar-color: var(--sea-3) transparent; }
.sh-link, .sh-sec > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--sea-text); text-decoration: none; font-size: 14.5px; font-weight: 500; cursor: pointer; position: relative; }
.sh-link:hover, .sh-sec > summary:hover { background: var(--sea-2); color: #fff; }
.sh-link .ico, .sh-sec > summary .ico { color: var(--sea-muted); }
.sh-link[aria-current="page"] { background: var(--sea-3); color: #fff; font-weight: 700; }
.sh-link[aria-current="page"] .ico { color: #fff; }
.sh-link[aria-current="page"]::before { content: ''; position: absolute; inset-inline-start: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
[dir="rtl"] .sh-link[aria-current="page"]::before { border-radius: 4px 0 0 4px; }
.sh-sec { margin-top: 2px; }
.sh-sec > summary { list-style: none; user-select: none; }
.sh-sec > summary::-webkit-details-marker { display: none; }
.sh-sec > summary .sh-chev { margin-inline-start: auto; transition: transform .18s var(--ease); }
[dir="rtl"] .sh-sec > summary .sh-chev { transform: scaleX(-1); }
.sh-sec[open] > summary .sh-chev { transform: rotate(90deg); }
.sh-sec.is-current > summary { color: #fff; }
.sh-sec.is-current > summary .ico:first-child { color: var(--brand); filter: brightness(1.25); }
.sh-sub { padding: 2px 0 6px; margin-inline-start: 22px; border-inline-start: 1px solid rgba(255, 255, 255, .1); }
.sh-sub .sh-link { min-height: 40px; padding-inline-start: 18px; font-size: 14px; color: var(--sea-muted); }
.sh-sub .sh-link:hover { color: #fff; }
.sh-sub .sh-link[aria-current="page"] { color: #fff; background: var(--sea-2); }
.sh-sub .sh-link[aria-current="page"]::before { inset-inline-start: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; }
.sh-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: var(--sea-muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sh-foot a { color: var(--sea-text); text-decoration: none; font-weight: 600; }
.sh-foot a:hover { text-decoration: underline; }
.sh-iconbtn.sh-close, .sh-iconbtn.sh-burger { display: none; }

/* ---------- top bar ---------- */
.sh-top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(242, 244, 243, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.sh-top-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.sh-top-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-top-mobile-brand { display: none; }
.sh-iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.sh-iconbtn:hover { border-color: var(--line-2); }
.sh-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.sh-pill:hover { color: var(--ink); border-color: var(--line-2); }
.sh-user { position: relative; }
.sh-user > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 999px; min-height: 44px; }
.sh-user > summary::-webkit-details-marker { display: none; }
.sh-user > summary:hover { background: rgba(12, 34, 48, .05); }
.sh-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-deep); font-weight: 800; font-size: 15px; }
.sh-user-meta { line-height: 1.25; text-align: start; }
.sh-user-name { display: block; font-weight: 700; font-size: 14px; }
.sh-user-role { display: block; color: var(--ink-3); font-size: 12px; }
.sh-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(12, 34, 48, .16); padding: 6px; z-index: 50; }
.sh-menu a, .sh-menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: start; }
.sh-menu a:hover, .sh-menu button:hover { background: var(--paper); }
.sh-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- phone: drawer + bottom tabs ---------- */
.sh-tabs { display: none; }
.sh-scrim { display: none; }
@media (max-width: 1023px) {
    .sh-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 320px); transform: translateX(-104%); visibility: hidden; transition: transform .24s var(--ease), visibility 0s linear .24s; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
    [dir="rtl"] .sh-side { transform: translateX(104%); }
    .sh.is-open .sh-side { transform: none; visibility: visible; transition: transform .24s var(--ease); }
    .sh-scrim { display: block; position: fixed; inset: 0; background: rgba(6, 18, 26, .5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sh.is-open .sh-scrim { opacity: 1; pointer-events: auto; }
    .sh-iconbtn.sh-burger { display: inline-grid; }
    .sh-iconbtn.sh-close { display: inline-grid; margin-inline-start: auto; background: transparent; border-color: rgba(255, 255, 255, .15); color: #fff; }
    .sh-top { padding: 0 16px; }
    .sh-top-mobile-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .sh-top-mobile-brand .sh-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 2px var(--brand); }
    .sh-top-mobile-brand .sh-logo--mono { font-size: 17px; box-shadow: none; }
    .sh-top-title .sh-top-name { display: none; }
    .sh-user-meta, .sh-hide-phone { display: none; }
    .sh-content { padding: 16px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
    html { scroll-padding-bottom: calc(var(--tabs-h) + 12px); }
    .sh-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(12, 34, 48, .06); }
    .sh-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; color: var(--ink-3); text-decoration: none; font-size: 12px; font-weight: 600; background: none; border: 0; cursor: pointer; position: relative; }
    .sh-tab[aria-current="page"] { color: var(--brand-ink); }
    .sh-tab[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
    .sh-tab .ico { width: 24px; height: 24px; }
}
@media print { .sh-side, .sh-top, .sh-tabs, .sh-scrim { display: none !important; } .sh-content { padding: 0; max-width: none; } }

/* ---------- restyled shared components (every product page) ---------- */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: 0 1px 2px rgba(12, 34, 48, .04); }
.card-body { padding: 20px; }
.btn-primary, .btn-secondary, .btn-danger { border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary { background: var(--brand-ink); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary { border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { background: var(--paper); border-color: var(--ink-3); }
.btn-link { color: var(--brand-ink); font-weight: 600; }
.input, .input-sm { border-color: var(--line-2); border-radius: var(--radius-sm); box-shadow: none; }
.input:focus, .input-sm:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-tint); outline: none; }
.label { color: var(--ink); font-weight: 600; }
.hint { color: var(--ink-3); }
.table th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-2); background: #f7f9f8; }
h1.text-2xl { font-weight: 800; letter-spacing: -.01em; }
@media (pointer: coarse) {
    .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; }
    .input { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
}

/* ======================================================================== Today (restaurant home) */
@layer components {
.td { display: flex; flex-direction: column; gap: 22px; }
.td-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.td-date { margin: 0; color: var(--ink-3); font-size: 14px; font-weight: 600; }
.td-title { margin: 2px 0 0; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -.015em; }
.td-head-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-open { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 13.5px; }
.td-open-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(22, 121, 74, .15); }
.td-open.is-closed { background: #eceeed; color: var(--ink-2); }
.td-open.is-closed .td-open-dot { box-shadow: none; }
.td-h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.td-h2 .ico { color: var(--ink-3); }

/* setup progress */
.td-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid var(--brand-tint); }
.td-setup-ring { --p: 0; width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand-ink) calc(var(--p) * 1%), #fff 0); }
.td-setup-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--brand-deep); }
.td-setup-text { flex: 1; min-width: 200px; }
.td-setup-text h2 { margin: 0; font-size: 17px; font-weight: 800; }
.td-setup-text p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.td-setup-actions { display: flex; align-items: center; gap: 6px; }
.td-quiet { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* the order rail: tickets hanging from the pass */
.td-rail-wrap { position: relative; }
.td-rail { position: relative; display: flex; gap: 12px; padding: 16px 4px 6px; scroll-padding-inline: 16px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.td-rail::-webkit-scrollbar { display: none; }
.td-rail::before { content: ''; position: absolute; inset-inline: 0; top: 4px; height: 6px; border-radius: 3px; background: linear-gradient(#c8d0cd, #9faba6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.td-ticket { --st: var(--ink-3); position: relative; flex: 1 0 128px; max-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 24px; background: var(--surface); color: var(--ink); text-decoration: none; border-top: 4px solid var(--st); scroll-snap-align: start; transition: transform .18s var(--ease);
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; }
a.td-ticket:hover { transform: translateY(2px); }
.td-ticket-n { font-size: 34px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--st); }
.td-ticket-l { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.td-ticket-s { font-size: 12px; color: var(--ink-3); }
.td-ticket.is-zero .td-ticket-n { color: var(--ink-3); font-weight: 600; }
.td-ticket--new { --st: #b45309; }
.td-ticket--accepted { --st: #1d57b8; }
.td-ticket--preparing { --st: #7c3aed; }
.td-ticket--ready { --st: #16794a; }
.td-ticket--delivering { --st: #0f7490; }
.td-ticket--calls { --st: #b4232b; }
.td-ticket--scheduled { --st: #44545d; }
.td-ticket.is-hot { background: #fff8ee; }
.td-ticket--calls.is-hot { background: #fff4f4; }
.td-ticket.is-hot .td-ticket-l::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-inline-start: 6px; border-radius: 50%; background: var(--st); vertical-align: middle; animation: td-pulse 1.6s ease-in-out infinite; }
@keyframes td-pulse { 50% { opacity: .25; } }

/* quick actions */
.td-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.td-action { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.td-action .ico { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }
.td-action:hover { border-color: var(--brand-ink); }

/* sales + side column */
.td-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.td-side { display: flex; flex-direction: column; gap: 16px; }
.td-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.td-sales-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; }
.td-big { margin: 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.td-cur { font-size: 16px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }
.td-delta { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.td-delta.is-up { color: var(--ok); }
.td-delta.is-down { color: var(--bad); }
.td-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; margin: 0; align-self: flex-start; }
.td-facts dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.td-facts dd { margin: 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.td-chart { margin: 18px 0 0; }
.td-chart svg { display: block; width: 100%; height: 170px; overflow: visible; }
.td-hours { display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.td-bar { fill: var(--brand-ink); opacity: .78; }
.td-bar.is-now { opacity: 1; fill: var(--brand-deep); }
.td-line { fill: none; stroke: #7d8a85; stroke-width: 2; stroke-dasharray: 5 5; stroke-linejoin: round; }
.td-chart-grid { stroke: var(--line); stroke-width: 1; }
.td-chart-base { stroke: var(--line-2); stroke-width: 1.5; }
.td-chart-label { fill: var(--ink-3); font-size: 12px; font-weight: 600; font-family: inherit; }
.td-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.td-legend span { display: inline-flex; align-items: center; gap: 8px; }
.td-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.td-key--bar { background: var(--brand-ink); }
.td-key--line { height: 0; border-top: 2px dashed #7d8a85; border-radius: 0; }
.td-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.td-h2 + .td-row { border-top: 0; }
a.td-row:hover .td-row-main { text-decoration: underline; }
.td-row-time { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 46px; }
.td-row-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-row-amt { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.td-chip { min-height: 36px; padding: 2px 12px; border-radius: 999px; border: 1px solid #9fd1b6; background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.td-chip:hover { border-color: var(--ok); }
.td-empty { margin: 0; color: var(--ink-3); font-size: 14px; }
.td-alert { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border-radius: var(--radius); background: var(--bad-bg); color: var(--bad); font-weight: 700; text-decoration: none; font-size: 14.5px; }
.td-alert span { flex: 1; }
[dir="rtl"] .td-flip { transform: scaleX(-1); }
@media (max-width: 1023px) {
    .td { gap: 18px; }
    .td-grid { grid-template-columns: minmax(0, 1fr); }   /* minmax: wide content (money, chart) never pushes the page sideways on a phone */
    .td-actions { grid-template-columns: 1fr 1fr; }
    .td-rail { margin-inline: -16px; padding-inline: 16px; }
    .td-rail::before { inset-inline: 16px; }
    .td-ticket { flex: 0 0 132px; }
    .td-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
}
@media (pointer: coarse) { .td-chip { min-height: 44px; } }
}

/* ======================================================================== menu editor */
@layer components {
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.me-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.me-empty .ico { color: var(--ink-3); }
.me-empty p { max-width: 46ch; margin: 0; }
.me-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 8px; }
.me-search { position: relative; display: flex; align-items: center; flex: 0 1 280px; min-width: 200px; }
.me-search svg { position: absolute; inset-inline-start: 12px; color: var(--ink-3); pointer-events: none; }
.me-search input { width: 100%; min-height: 44px; padding-block: 8px; padding-inline: 38px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: inherit; font-size: 14.5px; color: var(--ink); }
.me-search input:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-tint); }
.me-jump { flex: 1 1 300px; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.me-jump::-webkit-scrollbar { display: none; }
.me-jump a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.me-jump a span { color: var(--ink-3); font-weight: 700; font-size: 12px; }
.me-jump a:hover { border-color: var(--brand-ink); color: var(--ink); }
.me-hint { margin: 0 0 14px; color: var(--ink-3); font-size: 13px; }
.me-cats { display: flex; flex-direction: column; gap: 16px; }
.me-cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 80px; }
.me-cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfa; border-radius: var(--radius) var(--radius) 0 0; }
.me-cat-title { flex: 1; min-width: 160px; }
.me-cat-title h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 800; }
.me-cat-title p { margin: 0; color: var(--ink-3); font-size: 13px; }
.me-cat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.me-none { margin: 0; padding: 14px 16px; color: var(--ink-3); font-size: 14px; }
.me-items { list-style: none; margin: 0; padding: 0; }
.me-items:empty { min-height: 8px; }
.me-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.me-item:first-child { border-top: 0; }
.me-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.me-item.is-out .me-thumb { filter: grayscale(1); opacity: .6; }
.me-item.is-out .me-name a, .me-item.is-out .me-name { color: var(--ink-2); }
.me-item.is-hidden { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f7f8f8 10px, #f7f8f8 20px); }
.is-dragging { position: relative; z-index: 5; box-shadow: 0 16px 40px rgba(12, 34, 48, .18), 0 0 0 2px var(--brand-ink); border-radius: 12px; cursor: grabbing; }
.is-sorting { user-select: none; -webkit-user-select: none; }
.me-move { display: flex; align-items: center; gap: 2px; flex: none; }
.me-handle { display: grid; place-items: center; width: 32px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: grab; touch-action: none; }
.me-handle:hover { background: var(--paper); color: var(--ink); }
.me-arrows { display: flex; flex-direction: column; gap: 2px; }
.me-arrows button { display: grid; place-items: center; width: 28px; height: 21px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.me-arrows button:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.me-arrows button:disabled { opacity: .35; cursor: default; }
.is-filtered .me-handle, .is-filtered .me-arrows { visibility: hidden; }
.me-thumb { width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: var(--paper); }
.me-thumb--none { display: grid; place-items: center; color: #a5b0ac; border: 1px dashed var(--line-2); }
.me-main { flex: 1; min-width: 0; }
.me-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.me-name a { color: var(--ink); text-decoration: none; }
.me-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.me-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ink-3); font-size: 13px; }
.me-price { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }
.me-price input { width: 104px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; color: var(--ink); }
.me-price input:hover { border-color: var(--ink-3); }
.me-price input:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-tint); }
.me-price input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.me-cur { color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.me-status { position: absolute; top: 100%; inset-inline-end: 0; margin-top: 2px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.me-status.is-ok { color: var(--ok); }
.me-status.is-busy { color: var(--ink-3); }
.me-status.is-error { color: var(--bad); white-space: normal; width: 220px; background: var(--surface); padding: 4px 8px; border: 1px solid #f3c2c4; border-radius: 8px; z-index: 3; }
.me-avail { flex: none; }
.me-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.me-switch:hover { background: var(--paper); }
.me-switch-track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: #c3ccc8; transition: background .15s; }
.me-switch-track span { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s var(--ease); }
.me-switch[aria-checked="true"] .me-switch-track { background: var(--ok); }
.me-switch[aria-checked="true"] .me-switch-track span { transform: translateX(18px); }
[dir="rtl"] .me-switch[aria-checked="true"] .me-switch-track span { transform: translateX(-18px); }
.me-switch[aria-checked="false"] { color: var(--bad); }
.me-switch-text { min-width: 7.5em; text-align: start; }
.me-photos-link { white-space: nowrap; }
@media (pointer: coarse) { .me-arrows { display: none; } .me-handle { width: 40px; } }
@media (max-width: 760px) {
    .me-item { flex-wrap: wrap; padding: 10px 12px; gap: 8px 10px; }
    .me-main { flex-basis: calc(100% - 120px); }
    .me-price { margin-inline-start: auto; }
    .me-item .me-move + .me-thumb, .me-item > .me-thumb:first-child { order: 0; }
    .me-avail { order: 5; }
    .me-price { order: 6; }
    .me-switch-text { min-width: 0; }
    .me-cat-head { padding: 12px; }
    .me-search { flex: 1 1 100%; }
    .me-photos-link { display: none; }
}
}

/* page header actions: one swipeable row on phones instead of a tall stack of buttons */
@layer components {
@media (max-width: 760px) {
    .ph-actions { flex-wrap: nowrap; width: calc(100% + 32px); margin-inline: -16px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
    .ph-actions::-webkit-scrollbar { display: none; }
    .ph-actions > * { flex: none; }
    .ph-actions .btn-primary, .ph-actions .btn-secondary { white-space: nowrap; }
    .ph-actions .hint { display: none; }
    .ph-actions .btn-primary { order: -1; }
}
}

/* ======================================================================== setup guide (wizard) */
@layer components {
.wz { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 1120px; }
.wz-rail { position: sticky; top: calc(var(--top-h) + 20px); }
.wz-kicker { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.wz-meter { height: 8px; border-radius: 99px; background: #dde3e0; overflow: hidden; }
.wz-meter span { display: block; height: 100%; border-radius: 99px; background: var(--brand-ink); transition: width .3s var(--ease); }
.wz-meter-text { margin: 6px 0 16px; font-size: 13px; color: var(--ink-3); }
.wz-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.wz-steps::before { content: ''; position: absolute; top: 26px; bottom: 26px; inset-inline-start: 27px; width: 2px; background: var(--line-2); }
.wz-step { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 11px; border-radius: 12px; color: var(--ink-2); text-decoration: none; }
.wz-step:hover { background: rgba(12, 34, 48, .04); color: var(--ink); }
.wz-step[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(12, 34, 48, .06); }
.wz-num { position: relative; z-index: 1; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-2); font-weight: 800; font-size: 14px; color: var(--ink-2); }
.wz-step.is-done .wz-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.wz-step[aria-current="step"] .wz-num { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.wz-step-text { display: flex; flex-direction: column; line-height: 1.3; }
.wz-step-title { font-weight: 700; font-size: 15px; }
.wz-step-state { font-size: 12.5px; color: var(--ink-3); }
.wz-step.is-done .wz-step-state { color: var(--ok); }
.wz-note { margin: 18px 0 0; font-size: 13px; color: var(--ink-3); }
.wz-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 32px 24px; min-width: 0; }
.wz-count { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--brand-ink); }
.wz-title { margin: 2px 0 4px; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.wz-lead { margin: 0 0 22px; color: var(--ink-2); max-width: 62ch; }
.wz-errors { margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.wz-errors ul { margin: 0; padding-inline-start: 18px; }
.wz-form { min-width: 0; }
.wz-field { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
.wz-field > legend { padding: 0; margin-bottom: 10px; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.wz-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.wz-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.wz-field:has(.wz-file-input:focus-visible) .wz-file, .wz-field:has(#cover:focus-visible) .wz-cover-btn { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.wz-file { cursor: pointer; }
.wz-logo-row { display: flex; align-items: center; gap: 16px; }
.wz-logo { width: 72px; height: 72px; flex: none; border-radius: 18px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.wz-logo--mono { display: grid; place-items: center; background: var(--brand-c, var(--brand)); background: var(--pv-brand, var(--brand)); color: #fff; font-size: 32px; font-weight: 800; border: 0; }
.wz-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-swatch { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.wz-swatch input[type="radio"] { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.wz-swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.wz-swatch:has(input:focus-visible) { outline: 3px solid var(--brand-ink); outline-offset: 4px; }
.wz-swatch--custom { overflow: hidden; background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); }
.wz-swatch--custom input[type="color"] { position: absolute; inset: -8px; width: 56px; height: 56px; border: 0; padding: 0; opacity: 0; cursor: pointer; }
.wz-swatch--custom:has(input[type="radio"]:checked) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.wz-cover { --brand-c: var(--brand); position: relative; aspect-ratio: 16 / 6; min-height: 150px; border-radius: 16px; overflow: hidden;
    background: radial-gradient(circle at 25% 30%, rgba(255, 255, 255, .22) 0 2px, transparent 2.5px) 0 0 / 22px 22px, linear-gradient(135deg, var(--brand-c), color-mix(in srgb, var(--brand-c) 45%, #071219)); }
.wz-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wz-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 60%); pointer-events: none; }
.wz-cover-id { position: absolute; z-index: 1; inset-inline-start: 18px; bottom: 16px; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 18px; }
.wz-cover-id img, .wz-cover-mono { width: 56px; height: 56px; border-radius: 16px; background: #fff; object-fit: contain; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.wz-cover-mono { display: grid; place-items: center; background: var(--brand-c); color: #fff; font-weight: 800; font-size: 26px; }
.wz-cover-btn { position: absolute; z-index: 1; top: 12px; inset-inline-end: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.wz-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wz-theme { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.wz-theme > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wz-theme:hover { border-color: var(--ink-3); }
.wz-theme:has(input:checked) { border-color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand-ink); }
.wz-theme:has(input:checked)::after { content: ''; position: absolute; top: 16px; inset-inline-end: 16px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 2px #fff; }
.wz-theme:has(input:focus-visible) { outline: 3px solid var(--brand-ink); outline-offset: 3px; }
.wz-theme-text { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.wz-theme-text strong { font-size: 15px; color: var(--ink); }
.wz-phone { position: relative; display: block; height: 210px; border-radius: 14px; overflow: hidden; background: var(--pv-bg); border: 1px solid rgba(0, 0, 0, .08); }
.wz-pv-cover { display: block; height: 64px; background: linear-gradient(135deg, var(--pv-brand), color-mix(in srgb, var(--pv-brand) 40%, #000)); background-size: cover; background-position: center; }
.wz-pv-logo { position: absolute; top: 44px; inset-inline-start: 12px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--pv-brand); color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 0 0 3px var(--pv-bg); }
.wz-pv-name { display: block; margin: 22px 12px 8px; color: var(--pv-ink); font-weight: 800; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-pv-rows { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.wz-pv-rows span { position: relative; display: block; height: 26px; border-radius: 8px; background: var(--pv-surface); box-shadow: inset 0 0 0 1px var(--pv-line); }
.wz-pv-rows span::before { content: ''; position: absolute; top: 5px; inset-inline-start: 5px; width: 16px; height: 16px; border-radius: 5px; background: var(--pv-line); }
.wz-pv-rows span::after { content: ''; position: absolute; top: 10px; inset-inline-end: 8px; width: 22px; height: 6px; border-radius: 3px; background: var(--pv-accent); }
.wz-pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 10px; }
.wz-pv-cards span { position: relative; display: block; height: 86px; border-radius: 9px; background: var(--pv-surface); box-shadow: inset 0 0 0 1px var(--pv-line); overflow: hidden; }
.wz-pv-cards span::before { content: ''; position: absolute; inset: 0 0 34px; background: linear-gradient(135deg, color-mix(in srgb, var(--pv-brand) 30%, var(--pv-surface)), var(--pv-line)); }
.wz-pv-cards span::after { content: ''; position: absolute; bottom: 12px; inset-inline-start: 7px; width: 26px; height: 6px; border-radius: 3px; background: var(--pv-accent); }
.wz-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.wz-seg label { position: relative; }
.wz-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wz-seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.wz-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 34, 48, .14); }
.wz-seg input:focus-visible + span { outline: 3px solid var(--brand-ink); outline-offset: 1px; }
.wz-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -6px 0 20px; font-weight: 600; color: var(--ink-2); }
.wz-status .ico { color: var(--ink-3); }
.wz-counts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.wz-counts span { padding: 2px 10px; border-radius: 999px; background: var(--paper); font-size: 13px; }
.wz-two { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.wz-aside { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: 16px; background: var(--brand-soft); border: 1px solid var(--brand-tint); }
.wz-aside .ico { color: var(--brand-ink); }
.wz-aside h2 { margin: 0; font-size: 16px; font-weight: 800; }
.wz-aside p { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-2); }
.wz-newcat { margin-top: 12px; }
.wz-items { display: flex; flex-direction: column; gap: 12px; }
.wz-item-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; }
.wz-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; min-height: 44px; background: none; border: 0; cursor: pointer; }
.wz-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wz-kind { position: relative; }
.wz-kind input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wz-kind span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 10px; border-radius: 14px; border: 1px solid var(--line-2); text-align: center; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.wz-kind input:checked + span { border-color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand-ink); color: var(--ink); background: var(--brand-soft); }
.wz-kind input:focus-visible + span { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.wz-range { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; align-items: start; }
.wz-example { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--paper); font-weight: 700; color: var(--ink); }
.wz-methods { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.wz-methods li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 16px; border-top: 1px solid var(--line); }
.wz-methods li:first-child { border-top: 0; }
.wz-method-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.wz-method-name .ico { color: var(--ink-3); }
.wz-chip { padding: 3px 12px; border-radius: 999px; background: #eceeed; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.wz-chip.is-on { background: var(--ok-bg); color: var(--ok); }
.wz-warn { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 600; }
.wz-toggle { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; }
.wz-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wz-toggle-ui { position: relative; width: 46px; height: 28px; flex: none; margin-top: 2px; border-radius: 99px; background: #c3ccc8; transition: background .15s; }
.wz-toggle-ui::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s var(--ease); }
.wz-toggle input:checked + .wz-toggle-ui { background: var(--ok); }
.wz-toggle input:checked + .wz-toggle-ui::after { transform: translateX(18px); }
[dir="rtl"] .wz-toggle input:checked + .wz-toggle-ui::after { transform: translateX(-18px); }
.wz-toggle input:focus-visible + .wz-toggle-ui { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.wz-qr { display: flex; gap: 20px; align-items: flex-start; }
.wz-qr-art { width: 104px; height: 104px; flex: none; display: grid; place-items: center; border-radius: 20px; background: var(--paper); color: var(--ink); border: 1px dashed var(--line-2); }
.wz-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.wz-foot-gap { flex: 1; }
.wz-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; color: var(--ink-2); font-weight: 700; text-decoration: none; }
.wz-back:hover { color: var(--ink); }
.wz-back-ico { transform: scaleX(-1); }
[dir="rtl"] .wz-back-ico { transform: none; }
.wz-skip { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.wz-next { min-height: 46px; padding-inline: 22px; font-size: 15px; }
.wz-done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 0 8px; }
.wz-done-mark { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-bg); color: var(--ok); margin-bottom: 14px; }
.wz-done .wz-lead { margin-inline: auto; }
.wz-link { width: 100%; max-width: 520px; text-align: start; }
.wz-link-row { display: flex; gap: 8px; }
.wz-link-row .input { flex: 1; }
.wz-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
@media (max-width: 1023px) {
    .wz { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .wz-rail { position: static; }
    .wz-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
    .wz-steps::before { top: 26px; bottom: auto; height: 2px; width: auto; inset-inline: 10%; }
    .wz-step { flex-direction: column; gap: 4px; padding: 8px 2px; text-align: center; min-height: 0; }
    .wz-step[aria-current="step"] { box-shadow: none; background: transparent; }
    .wz-step-title { font-size: 12px; }
    .wz-step-state, .wz-note, .wz-kicker { display: none; }
    .wz-panel { padding: 20px 16px; border-radius: 16px; }
    .wz-split, .wz-two { grid-template-columns: 1fr; }
    .wz-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wz-kinds { grid-template-columns: 1fr 1fr; }
    .wz-range { grid-template-columns: 1fr 1fr; }
    .wz-range > :first-child { grid-column: 1 / -1; }
    .wz-item-row { grid-template-columns: minmax(0, 1fr) 110px; }
    .wz-foot { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); background: var(--surface); margin-inline: -16px; padding: 12px 16px; z-index: 5; }
    .wz-next { flex: 1 1 100%; order: 3; }
    .wz-qr { flex-direction: column; }
    .wz-cover { aspect-ratio: 16 / 8; }
}
}

/* ======================================================================== menu photos (bulk upload) */
@layer components {
.ph-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px; margin-bottom: 18px; border: 2px dashed var(--line-2); border-radius: 18px; background: var(--surface); text-align: center; color: var(--ink-2); transition: border-color .15s, background .15s; }
.ph-drop .ico { color: var(--brand-ink); }
.ph-drop.is-over { border-color: var(--brand-ink); background: var(--brand-soft); }
.ph-drop-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.ph-drop .hint { max-width: 60ch; }
.ph-drop:has(.wz-file-input:focus-visible) label { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.ph-queue { margin-bottom: 22px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.ph-queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ph-queue-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.ph-list { list-style: none; margin: 0; padding: 0; }
.ph-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ph-row:first-child { border-top: 0; }
.ph-row > img { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; }
.ph-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 4px 12px; align-items: center; }
.ph-row-file { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.ph-row-note { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.ph-row.is-error .ph-row-note { color: var(--bad); }
.ph-row.is-busy { opacity: .6; }
.ph-row.is-ok > img { box-shadow: 0 0 0 3px var(--ok); }
.ph-row-remove { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; }
.ph-progress { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ph-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.ph-missing { margin: 0; font-weight: 700; }
.ph-filter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.ph-filter input { width: 18px; height: 18px; accent-color: var(--brand-ink); }
.ph-cat { margin-bottom: 22px; }
.ph-cat h2 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.ph-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ph-card.is-busy { opacity: .6; }
.ph-img { aspect-ratio: 1; background: var(--paper); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-none { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #8e9a95; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.ph-card-form { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.ph-name { font-weight: 700; font-size: 14px; line-height: 1.35; }
.ph-pick { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 700; font-size: 13.5px; color: var(--brand-ink); cursor: pointer; }
.ph-pick:hover { border-color: var(--brand-ink); }
.ph-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ph-pick:has(input:focus-visible) { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
@media (max-width: 760px) { .ph-row-main { grid-template-columns: 1fr; } .ph-grid { grid-template-columns: 1fr 1fr; } }
@media (pointer: coarse) { .ph-pick { min-height: 44px; } }
}

/* ======================================================================== item form */
@layer components {
.if-jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 16px; padding: 2px; }
.if-jump::-webkit-scrollbar { display: none; }
.if-jump a { flex: none; min-height: 36px; display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.if-jump a:hover { border-color: var(--brand-ink); color: var(--ink); }
.if-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; max-width: 1120px; }
.if-form .card { scroll-margin-top: 80px; }
.if-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); }
.if-h .ico { color: var(--brand-ink); }
.if-sub { width: 100%; margin-bottom: -10px; font-weight: 700; color: var(--ink-2); }
.if-save { position: sticky; bottom: 0; z-index: 4; padding: 12px 0; background: linear-gradient(to top, var(--paper) 70%, transparent); }
.if-preview { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 10px; }
.if-card { overflow: hidden; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(12, 34, 48, .08); }
.if-card-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), var(--brand-tint)); color: var(--brand-ink); }
.if-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.if-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.if-card-body strong { font-size: 17px; font-weight: 800; }
.if-card-body p { margin: 0; color: var(--ink-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.if-card-body p:empty { display: none; }
.if-card-price { margin-top: 4px; font-weight: 800; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) {
    .if-layout { grid-template-columns: minmax(0, 1fr); }
    .if-preview { position: static; order: -1; }
    .if-card { display: grid; grid-template-columns: 96px 1fr; box-shadow: none; }
    .if-card-img { aspect-ratio: 1; }
    .if-save { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
}

/* ---------- reviewer pass: native file pickers and touch-size pills ---------- */
.shell input[type="file"] { font: inherit; font-size: 14px; color: var(--ink-2); max-width: 100%; }
.shell input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-inline-end: 12px; padding: 7px 14px; min-height: 40px; border: 1px solid var(--line-2);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.shell input[type="file"]::file-selector-button:hover { background: var(--paper); border-color: var(--brand-ink, #0f766e); }
.shell input[type="file"].input { padding: 6px; }
@media (pointer: coarse) {
    .sh-pill { min-height: 44px; }
    .shell input[type="file"]::file-selector-button { min-height: 44px; }
}

.shell fieldset { min-width: 0; }
.wz-pv-logo--img { background: #fff; overflow: hidden; }
.wz-pv-logo--img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
}

/* ---- Connect your cashier (pos/partials/guide.blade.php) ---- */
.pg { display: grid; gap: 14px; max-width: 880px; }
.pg-step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; min-width: 0; }
.pg-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.pg-head h2 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.3; }
.pg-lead { margin: 2px 0 0; color: var(--ink-2); max-width: 60ch; }
.pg-num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-ink, #0f766e); color: #fff; font-weight: 800; }
.pg-num--plain { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-2); }
.pg-num--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pg-num--bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pg-num--warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pg-search { margin-bottom: 12px; }
.pg-search .input { width: 100%; max-width: 420px; min-height: 44px; }
.pg-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pg-tiles li[hidden] { display: none; }
.pg-tile { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.pg-tile:hover { border-color: var(--line-2); background: var(--paper); }
.pg-tile.is-picked { border-color: var(--brand-ink, #0f766e); background: var(--brand-tint, #e8f5f3); }
.pg-glyph { color: var(--brand-ink, #0f766e); }
.pg-tile-body { display: grid; gap: 4px; }
.pg-tile-body strong { font-size: 16px; line-height: 1.35; }
.pg-tile-body span { color: var(--ink-2); font-size: 14px; }
.pg-badge { display: inline-block; margin-inline-start: 6px; padding: 1px 9px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 700; vertical-align: middle; }
.pg-empty { margin: 10px 0 0; color: var(--ink-2); }
.pg-demo { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--ink-2); font-size: 14px; }
.pg-linkbtn { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--brand-ink, #0f766e); font-weight: 700; text-decoration: underline; cursor: pointer; }
.pg-linkbtn--bad { color: var(--bad); }
.pg-big { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border: 0; border-radius: 14px; background: var(--brand-ink, #0f766e); color: #fff; font-size: 17px; font-weight: 800; text-decoration: none; cursor: pointer; }
.pg-big:hover { filter: brightness(1.08); }
.pg-big[disabled] { opacity: .6; cursor: progress; }
.pg-muted { margin: 10px 0 0; color: var(--ink-3); font-size: 14px; max-width: 62ch; }
.pg-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--paper); font-weight: 600; }
.pg-note.is-ok { background: var(--ok-bg); color: var(--ok); }
.pg-note.is-bad { background: var(--bad-bg); color: var(--bad); }
.pg-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; }
.pg-row label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.pg-row .input, .pg-form .input { min-height: 44px; }
.pg-grow { flex: 1; min-width: 0; }
.pg-form { display: grid; gap: 14px; margin-top: 14px; max-width: 520px; }
.pg-form label { display: grid; gap: 4px; font-weight: 600; }
.pg-form small { color: var(--ink-3); font-weight: 400; }
.pg-share { padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px dashed var(--line-2); }
.pg-share-title { margin: 0; font-weight: 800; }
.pg-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pg-copy code { flex: 1 1 220px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.pg-keys { margin: 14px 0; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg); border: 1px solid #f0cf9d; display: grid; gap: 10px; }
.pg-keys-title { margin: 0; font-weight: 800; color: var(--warn); }
.pg-key-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pg-todo { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 6px; max-width: 60ch; }
.pg-result { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding: 18px 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.pg-mark { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; background: var(--line); color: var(--ink-3); }
.pg-result-title { margin: 0; font-size: 18px; font-weight: 800; }
.pg-result-msg { margin: 2px 0 0; color: var(--ink-2); }
.pg-result-fix { margin: 6px 0 0; font-weight: 600; }
.pg-result-fix:empty, .pg-result-msg:empty { display: none; }
.pg-result[data-state="ok"] { background: var(--ok-bg); border-color: transparent; }
.pg-result[data-state="ok"] .pg-mark { background: var(--ok); color: #fff; }
.pg-result[data-state="ok"] .pg-result-title { color: var(--ok); }
.pg-result[data-state="bad"] { background: var(--bad-bg); border-color: transparent; }
.pg-result[data-state="bad"] .pg-mark { background: var(--bad); color: #fff; }
.pg-result[data-state="bad"] .pg-result-title { color: var(--bad); }
.pg-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 14px; }
.pg-facts dt { font-size: 13px; color: var(--ink-3); }
.pg-facts dd { margin: 0; font-weight: 700; }
.pg-match { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pg-match form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pg-match-name { flex: 1 1 160px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pg-match select { flex: 1 1 180px; min-width: 0; min-height: 44px; }
.pg-problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pg-problems li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pg-problems small { display: block; color: var(--bad); }
.pg-off { margin-top: 6px; }
.pg-switch-form { margin-top: 4px; }
@media (max-width: 760px) {
    .pg-tiles { grid-template-columns: 1fr; }
    .pg-step { padding: 18px 16px; border-radius: 16px; }
    .pg-big { width: 100%; }
    .pg-result { flex-direction: column; align-items: flex-start; }
}
