/* =====================================================================
   TableOrder design system
   Brand colours come from variables; each café's /theme/{id}.css overrides
   the --brand-* values, and everything else is derived from them, so light
   and dark café palettes both work.
   ===================================================================== */

:root {
    /* Brand (overridden per café) */
    --brand-primary: #4a3428; --brand-on-primary: #ffffff; --brand-primary-hover: #5c4639;
    --brand-accent: #c8a27a; --brand-on-accent: #111111;
    --brand-bg: #faf7f2; --brand-text: #111111;
    --brand-surface: #ffffff; --brand-surface-text: #111111;
    --brand-link: #4a3428; --brand-muted: #6b6966; --brand-border: #e1e1e1;

    /* Derived */
    --ink: var(--brand-surface-text);
    --ink-soft: color-mix(in srgb, var(--brand-surface-text) 62%, var(--brand-surface));
    --ink-faint: color-mix(in srgb, var(--brand-surface-text) 40%, var(--brand-surface));
    --line: color-mix(in srgb, var(--brand-surface-text) 11%, var(--brand-surface));
    --line-strong: color-mix(in srgb, var(--brand-surface-text) 20%, var(--brand-surface));
    --wash: color-mix(in srgb, var(--brand-surface-text) 4%, var(--brand-surface));
    --tint: color-mix(in srgb, var(--brand-primary) 10%, var(--brand-surface));
    --tint-strong: color-mix(in srgb, var(--brand-primary) 18%, var(--brand-surface));
    --page-line: color-mix(in srgb, var(--brand-text) 10%, var(--brand-bg));
    --page-wash: color-mix(in srgb, var(--brand-text) 4%, var(--brand-bg));
    --focus: color-mix(in srgb, var(--brand-primary) 45%, transparent);

    /* Status colours (mixed with the surface so they adapt to dark palettes) */
    --c-new: #d97706; --c-prep: #2563eb; --c-ready: #16a34a; --c-danger: #dc2626; --c-off: #64748b;

    /* Shape & depth */
    --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
    --shadow-xs: 0 1px 2px rgb(15 23 42 / .06);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / .05), 0 2px 6px rgb(15 23 42 / .05);
    --shadow-md: 0 2px 4px rgb(15 23 42 / .04), 0 10px 24px -6px rgb(15 23 42 / .12);
    --shadow-lg: 0 24px 48px -16px rgb(15 23 42 / .28);

    /* Type */
    --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

    --side-w: 256px;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
    --bs-body-font-family: var(--font-sans);
    --bs-body-bg: var(--brand-bg);
    --bs-body-color: var(--brand-text);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--ink-soft);
    --bs-emphasis-color: var(--brand-text);
    --bs-link-color-rgb: initial;
    font-family: var(--font-sans);
    background: var(--brand-bg);
    color: var(--brand-text);
    font-size: .9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01", "tnum" 0;
    min-height: 100vh;
}
a { color: var(--brand-link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-link); text-decoration-thickness: 2px; }
h1, h2, h3, h4, h5, h6 { color: inherit; letter-spacing: -.015em; font-weight: 650; }
code { color: inherit; background: var(--wash); border: 1px solid var(--line); padding: .1em .4em; border-radius: var(--r-xs); font-family: var(--font-mono); font-size: .85em; }
.text-muted { color: var(--brand-muted) !important; }
.small, small { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--brand-primary) 25%, transparent); }

.icon { flex-shrink: 0; vertical-align: -.2em; }

.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--brand-primary); color: var(--brand-on-primary); padding: .5rem 1rem; border-radius: var(--r-sm); }
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--r-sm);
    --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem;
    --bs-btn-focus-box-shadow: 0 0 0 3px var(--focus);
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    letter-spacing: -.005em;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .8125rem; --bs-btn-border-radius: 8px; gap: .35rem; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { --bs-btn-padding-y: .8rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: var(--r); }

/* Primary = café brand colour */
.btn-dark, .btn-brand {
    --bs-btn-bg: var(--brand-primary); --bs-btn-border-color: var(--brand-primary); --bs-btn-color: var(--brand-on-primary);
    --bs-btn-hover-bg: var(--brand-primary-hover); --bs-btn-hover-border-color: var(--brand-primary-hover); --bs-btn-hover-color: var(--brand-on-primary);
    --bs-btn-active-bg: var(--brand-primary-hover); --bs-btn-active-border-color: var(--brand-primary-hover); --bs-btn-active-color: var(--brand-on-primary);
    --bs-btn-disabled-bg: var(--brand-primary); --bs-btn-disabled-border-color: var(--brand-primary); --bs-btn-disabled-color: var(--brand-on-primary);
    box-shadow: 0 1px 2px rgb(15 23 42 / .12), inset 0 1px 0 rgb(255 255 255 / .12);
}
/* Secondary = quiet surface button */
.btn-outline-dark, .btn-outline-secondary, .btn-ghost {
    --bs-btn-bg: var(--brand-surface); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--wash); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-bg: var(--tint); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line-strong);
    --bs-btn-disabled-color: var(--ink-faint); --bs-btn-disabled-bg: var(--brand-surface); --bs-btn-disabled-border-color: var(--line);
    box-shadow: var(--shadow-xs);
}
.btn-ghost { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; box-shadow: none; }
.btn-outline-danger {
    --bs-btn-bg: var(--brand-surface); --bs-btn-color: color-mix(in srgb, var(--c-danger) 85%, var(--ink)); --bs-btn-border-color: color-mix(in srgb, var(--c-danger) 30%, var(--brand-surface));
    --bs-btn-hover-bg: var(--c-danger); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--c-danger);
    --bs-btn-active-bg: #b91c1c; --bs-btn-active-border-color: #b91c1c; --bs-btn-active-color: #fff;
}
.btn-outline-success {
    --bs-btn-bg: var(--brand-surface); --bs-btn-color: color-mix(in srgb, var(--c-ready) 85%, var(--ink)); --bs-btn-border-color: color-mix(in srgb, var(--c-ready) 35%, var(--brand-surface));
    --bs-btn-hover-bg: var(--c-ready); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--c-ready);
}
.btn-outline-warning {
    --bs-btn-bg: var(--brand-surface); --bs-btn-color: color-mix(in srgb, var(--c-new) 85%, var(--ink)); --bs-btn-border-color: color-mix(in srgb, var(--c-new) 35%, var(--brand-surface));
    --bs-btn-hover-bg: var(--c-new); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--c-new);
}
.btn-icon { --bs-btn-padding-x: .5rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .8125rem; color: var(--ink); margin-bottom: .35rem; }
.form-label.small { font-size: .78rem; }
.form-hint { font-size: .78rem; color: var(--ink-soft); margin-top: .3rem; }
.form-control, .form-select, .input-group-text {
    background-color: var(--brand-surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    padding: .6rem .8rem; font-size: .9375rem;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s;
}
.form-control-sm { padding: .4rem .65rem; font-size: .8125rem; border-radius: 8px; }
.form-control::placeholder { color: var(--ink-faint); }
.form-control:focus, .form-select:focus {
    background-color: var(--brand-surface); color: var(--ink);
    border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--focus);
}
.input-group-text { background: var(--wash); color: var(--ink-soft); font-size: .78rem; font-weight: 600; box-shadow: none; }
.input-group-sm > .input-group-text { padding: .4rem .55rem; font-size: .72rem; }
.input-group > .form-control { box-shadow: none; }
.form-control[type=file] { padding: .35rem .4rem; font-size: .8125rem; color: var(--ink-soft); }
.form-control[type=file]::file-selector-button {
    margin: -.1rem .6rem -.1rem 0; padding: .3rem .7rem; border: 0; border-radius: 7px;
    background: var(--tint); color: var(--ink); font-weight: 600; font-size: .78rem;
}
.form-control[type=file]:hover:not(:disabled):not([readonly])::file-selector-button { background: var(--tint-strong); }
.form-control-color { height: 2.75rem; padding: .3rem; cursor: pointer; }
.form-control-color::-webkit-color-swatch { border-radius: 7px; border: 0; }
.form-control-color::-moz-color-swatch { border-radius: 7px; border: 0; }

/* ---------- Alerts (flash messages) ---------- */
.alert {
    --tone: var(--brand-primary);
    border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--brand-surface));
    background: color-mix(in srgb, var(--tone) 9%, var(--brand-surface));
    color: var(--ink);
    border-radius: var(--r);
    padding: .8rem 1rem .8rem 2.6rem;
    position: relative;
    font-size: .875rem;
    box-shadow: var(--shadow-xs);
}
.alert::before { /* status dot, purely decorative */
    content: ""; position: absolute; left: 1rem; top: 1.05rem; width: .7rem; height: .7rem; border-radius: 50%;
    background: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 20%, transparent);
}
.alert-success { --tone: var(--c-ready); }
.alert-warning { --tone: var(--c-new); }
.alert-danger { --tone: var(--c-danger); }
.alert-info { --tone: var(--c-prep); }
.alert-secondary { --tone: var(--c-off); }
.alert.small { font-size: .8125rem; padding-top: .6rem; padding-bottom: .6rem; }
.alert.small::before { top: .85rem; }

/* ---------- Badges & pills ---------- */
.pill {
    --tone: var(--c-off);
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .18rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 650; letter-spacing: .01em; white-space: nowrap;
    background: color-mix(in srgb, var(--tone) 13%, var(--brand-surface));
    color: color-mix(in srgb, var(--tone) 72%, var(--ink));
    border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--brand-surface));
}
.pill-dot::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--tone); }
.pill-New, .pill-new { --tone: var(--c-new); }
.pill-counter { --tone: #0891b2; }
.pill-link { text-decoration: none; }
.pill-link:hover { text-decoration: none; filter: brightness(.97); }
.pill-Done, .pill-on { --tone: var(--c-ready); }
.pill-Cancelled { --tone: var(--c-danger); }
.pill-locked { --tone: var(--c-danger); }
.pill-locked svg { width: .8rem; height: .8rem; }
.pill-PendingPayment, .pill-off { --tone: var(--c-off); }
.pill-sim { --tone: #a855f7; }
.pill-brand { --tone: var(--brand-primary); }
.badge.bg-dark { background: var(--brand-accent) !important; color: var(--brand-on-accent); }

/* ---------- Surfaces ---------- */
.panel, .order-card {
    background: var(--brand-surface); color: var(--brand-surface-text);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}
.order-card .text-muted, .panel .text-muted { color: var(--ink-soft) !important; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-title { display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 650; margin: 0; }
.panel-title .icon { color: var(--brand-primary); }
.panel-sub { font-size: .8125rem; color: var(--ink-soft); margin: .25rem 0 0; }
.panel-icon {
    display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px;
    background: var(--tint); color: var(--brand-primary); flex-shrink: 0;
}
.divider { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; opacity: 1; }

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line);
    --bs-table-striped-bg: var(--wash); --bs-table-hover-bg: var(--wash); --bs-table-hover-color: var(--ink);
    margin: 0;
}
.table > :not(caption) > * > * { padding: .75rem 1rem; }
.table thead th {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-soft); background: var(--wash); border-bottom-color: var(--line); white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.panel.table-panel, .order-card.cat-card { padding: 0; overflow: hidden; }
.table-panel .table-responsive { margin: 0; }
.table-secondary { --bs-table-bg: var(--wash); --bs-table-color: var(--ink-soft); }
.bg-white { background: var(--brand-surface) !important; }

/* =====================================================================
   App shell (café admin + platform console)
   ===================================================================== */
.app { min-height: 100vh; }
.app-side {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
    display: flex; flex-direction: column; gap: 1.25rem;
    padding: 1.25rem .9rem;
    background: var(--brand-surface); color: var(--ink);
    border-right: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem; min-width: 0; }
.brand-mark {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 2.4rem; height: 2.4rem; border-radius: 12px;
    background: linear-gradient(140deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 55%, var(--brand-accent)));
    color: var(--brand-on-primary); font-weight: 750; font-size: 1.05rem; letter-spacing: -.02em;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand-primary) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / .18);
}
.side-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.app-side .navbar-brand { color: var(--ink); font-weight: 700; font-size: 1rem; padding: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-sub { font-size: .72rem; color: var(--ink-soft); font-weight: 500; }

.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .75rem; border-radius: var(--r-sm);
    color: var(--ink-soft); font-weight: 550; text-decoration: none;
    transition: background-color .15s, color .15s;
}
.side-nav a:hover { background: var(--wash); color: var(--ink); }
.side-nav a[aria-current=page] { background: var(--tint); color: var(--ink); }
.side-nav a[aria-current=page] .icon { color: var(--brand-primary); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem; min-width: 0; }
.side-avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--wash); color: var(--ink-soft); flex-shrink: 0; border: 1px solid var(--line); }
.side-avatar .icon { width: 16px; height: 16px; }
.side-user-name { font-size: .8125rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-signout { justify-content: flex-start; width: 100%; color: var(--ink-soft); --bs-btn-padding-x: .75rem; }

.app-main { margin-left: var(--side-w); min-height: 100vh; }
.app-content { max-width: 1240px; margin: 0 auto; padding: 2rem 2.25rem 4rem; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-muted); margin: 0 0 .3rem; display: flex; align-items: center; gap: .4rem; }
.page-title { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 720; letter-spacing: -.025em; margin: 0; line-height: 1.15; }
.page-sub { color: var(--brand-muted); margin: .4rem 0 0; font-size: .9rem; max-width: 60ch; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.live-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--c-ready); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-ready) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-ready) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.kpi { background: var(--brand-surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.kpi-label .icon { width: 16px; height: 16px; color: var(--kpi-tone, var(--brand-primary)); }
.kpi-value { font-size: 1.65rem; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-new { --kpi-tone: var(--c-new); } .kpi-counter { --kpi-tone: #0891b2; } .kpi-ready { --kpi-tone: var(--c-ready); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 1.05rem; font-weight: 680; margin: 2.25rem 0 .9rem; }
.section-title .count { font-size: .78rem; font-weight: 600; color: var(--brand-muted); }

/* Empty states */
.empty { text-align: center; padding: 2.75rem 1.5rem; }
.empty-icon { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 16px; background: var(--tint); color: var(--brand-primary); margin-bottom: .9rem; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-title { font-weight: 650; font-size: 1rem; color: var(--ink); margin: 0; }
.empty-sub { color: var(--ink-soft); font-size: .875rem; margin: .3rem auto 0; max-width: 42ch; }

/* =====================================================================
   Kitchen board
   ===================================================================== */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1rem; align-items: start; }

.ticket { --tone: var(--c-new); padding: 1rem; border-radius: var(--r); position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.ticket::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.ticket-table { font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; }
.ticket-badges { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.ticket-meta { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--ink-soft); margin-top: .15rem; }
.ticket-meta .icon { width: 14px; height: 14px; }
.ticket-items { list-style: none; padding: 0; margin: .85rem 0; display: flex; flex-direction: column; gap: .4rem; }
.ticket-items li { font-weight: 550; } /* not flex: keeps "2 × Flat white" as one line of text */
.ticket-qty { display: inline-block; text-align: center; line-height: 1.4rem; min-width: 1.75rem; height: 1.5rem; padding: 0 .35rem; margin-right: .2rem; border-radius: 7px; background: var(--wash); border: 1px solid var(--line); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.ticket-note { font-size: .8125rem; background: color-mix(in srgb, var(--c-new) 9%, var(--brand-surface)); border: 1px dashed color-mix(in srgb, var(--c-new) 40%, var(--brand-surface)); border-radius: var(--r-sm); padding: .45rem .65rem; margin-bottom: .85rem; font-style: italic; }
.ticket-total { display: flex; justify-content: space-between; font-weight: 700; font-variant-numeric: tabular-nums; padding: .6rem 0 .85rem; border-top: 1px dashed var(--line-strong); }
.ticket-actions { display: flex; gap: .5rem; }
.ticket-actions form:first-child { flex: 1; }
.ticket-actions form:first-child .btn { width: 100%; }

/* =====================================================================
   Menu editor
   ===================================================================== */
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: var(--brand-surface); border: 1px solid var(--line); font-size: .8125rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-xs); }
.chip .icon { width: 15px; height: 15px; color: var(--brand-primary); }
.chip b { font-variant-numeric: tabular-nums; }

.inline-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form > div { min-width: 0; }
.grow { flex: 1 1 14rem; }
.qty-input { width: 5.5rem; }
.price-input { width: 7rem; }

.cat-card { padding: 0; overflow: hidden; margin-bottom: 1.5rem; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--wash); }
.cat-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cat-meta { font-size: .75rem; font-weight: 600; color: var(--ink-soft); }

.items-table { width: 100%; border-collapse: collapse; }
.items-table td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items-table tr:last-child td { border-bottom: 0; }
.items-table .c-thumb { width: 96px; padding-right: 0; }
.items-table .c-actions { width: 1%; white-space: nowrap; text-align: right; }
.items-table .c-actions .btn-row { display: flex; gap: .4rem; justify-content: flex-end; }
.item-row.is-soldout .menu-thumb { filter: grayscale(1); opacity: .55; }
.item-row.is-soldout .item-edit input[name=name] { text-decoration: line-through; color: var(--ink-soft); }
.item-edit { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.item-edit input[name=name] { flex: 1 1 12rem; min-width: 0; font-weight: 600; }
.item-edit .item-allergens { flex: 1 1 100%; order: 3; }
.price-group { width: 9rem; flex: 0 0 auto; }
.item-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.item-tools form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.item-tools input[type=file] { max-width: 15rem; }
.item-desc { font-size: .78rem; color: var(--ink-soft); margin-top: .35rem; }

.menu-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex-shrink: 0; display: block; background: var(--wash); }
.menu-thumb-empty { display: grid; place-items: center; text-align: center; font-size: .65rem; font-weight: 600; color: var(--ink-faint); border: 1px dashed var(--line-strong); background: var(--wash); line-height: 1.2; }
.menu-thumb-empty .icon { width: 20px; height: 20px; display: block; margin: 0 auto .15rem; }

.add-item { display: grid; grid-template-columns: 1.2fr 1.6fr 8rem 1.3fr auto; gap: .5rem; align-items: center; padding: 1rem 1.25rem; background: var(--wash); border-top: 1px dashed var(--line-strong); }
/* Café settings → the café's own Stripe account (Connect) */
.stripe-connect { margin-top: 1.25rem; padding: 1rem; border-radius: var(--r-sm); background: var(--wash); border: 1px solid var(--line); }
.stripe-connect ul { padding-left: 1.1rem; }
.stripe-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin-top: .5rem; }
.stripe-option { padding: .85rem; border-radius: var(--r-sm); background: var(--brand-surface); border: 1px solid var(--line); }
.stripe-option b { display: block; margin-bottom: .2rem; }

/* Platform → Stripe setup guide */
.guide-progress { margin-bottom: 1rem; }
.guide-bar { height: 8px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); margin-top: .75rem; overflow: hidden; }
.guide-bar > span { display: block; height: 100%; width: 0; background: var(--c-ready); transition: width .25s; }
.guide-step { margin-bottom: 1rem; border-left: 4px solid var(--line-strong); }
.guide-step.is-done { border-left-color: var(--c-ready); }
.guide-step-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.guide-step-head .grow { flex: 1; min-width: 12rem; }
.guide-step-head .panel-title { margin: 0; }
.guide-num { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--wash); border: 1px solid var(--line-strong); font-weight: 700; }
.guide-step.is-done .guide-num { background: var(--c-ready); border-color: var(--c-ready); color: #fff; }
.guide-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.guide-list { padding-left: 1.2rem; margin-bottom: 0; }
.guide-list li + li { margin-top: .4rem; }
.guide-sub { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .25rem; }
.guide-later { margin-bottom: 1rem; }
.cmd { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .25rem; padding: .5rem .5rem .5rem .75rem; border-radius: var(--r-sm); background: #1f2430; color: #e6e9ef; }
.cmd code { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: #e6e9ef; font-size: .8rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.cmd .btn.btn-outline-dark { flex: none; background: transparent; color: #fff; border-color: rgb(255 255 255 / .45); }
.cmd .btn.btn-outline-dark:hover, .cmd .btn.btn-outline-dark:focus-visible { background: rgb(255 255 255 / .14); color: #fff; }
.guide-tests code { font-size: .85rem; }
@media (max-width: 640px) {
    /* Each test as a small card instead of a squeezed table. */
    .guide-tests thead { display: none; }
    .guide-tests, .guide-tests tbody, .guide-tests tr, .guide-tests td { display: block; width: 100%; }
    .guide-tests tr { position: relative; padding: .75rem 2.5rem .75rem 0; border-bottom: 1px solid var(--line); }
    .guide-tests td { border: 0; padding: .1rem 0; text-align: left !important; }
    .guide-tests td:last-child { position: absolute; top: .75rem; right: 0; width: auto; }
}

.file-with-hint { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.file-with-hint input[type=file] { min-width: 0; }

/* Picture-size tips next to file uploads (CSS only: hover, keyboard focus or tap). */
.info-tip {
    position: relative; flex: none; display: inline-grid; place-items: center;
    width: 1.75rem; height: 1.75rem; border-radius: 50%; cursor: help;
    color: var(--brand-muted); background: var(--brand-surface); border: 1px solid var(--line-strong);
}
.info-tip > .icon { width: 16px; height: 16px; }
.info-tip:hover, .info-tip:focus-visible { color: var(--brand-primary); border-color: var(--brand-primary); }
.info-tip-text {
    /* Fixed, so cards and scrolling tables can't clip it; site.js places it next to the icon, inside the screen. */
    position: fixed; z-index: 1080;
    width: min(18rem, calc(100vw - 2rem)); padding: .65rem .8rem; border-radius: var(--r-sm);
    background: #1f2430; color: #fff; box-shadow: var(--shadow-lg);
    font-size: .78rem; font-weight: 450; line-height: 1.45; text-align: left; white-space: normal;
    opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
    pointer-events: none;
}
.info-tip-text b { display: block; margin-bottom: .2rem; }
.info-tip-text span + span { margin-top: .2rem; }
.info-tip:hover .info-tip-text, .info-tip:focus .info-tip-text { opacity: 1; visibility: visible; transform: none; }
.add-item-label { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: .35rem; }
.add-item-label .icon { width: 14px; height: 14px; }

/* =====================================================================
   Tables & QR
   ===================================================================== */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.qr-card {
    background: var(--brand-surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
    padding: 1.1rem; text-align: center; display: flex; flex-direction: column; gap: .6rem;
    page-break-inside: avoid; break-inside: avoid; transition: box-shadow .2s, transform .2s;
}
.qr-card:hover { box-shadow: var(--shadow-md); }
.qr-card.is-off { opacity: .6; }
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: left; }
.qr-title { font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; }
.qr-frame { background: #fff; border-radius: var(--r); padding: .6rem; border: 1px solid var(--line); align-self: center; }
.qr-img { width: 184px; height: 184px; display: block; image-rendering: pixelated; }
.qr-caption { font-size: .8125rem; color: var(--ink-soft); font-weight: 550; }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .25rem; text-align: left; }
.qr-actions .btn { width: 100%; }
.qr-link { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .8125rem; font-weight: 600; padding: .45rem; border-radius: 8px; background: var(--tint); color: var(--ink); text-decoration: none; }
.qr-link:hover { background: var(--tint-strong); color: var(--ink); }
.qr-link .icon { width: 15px; height: 15px; }
.qr-actions form:last-child { grid-column: 1 / -1; }
.print-only { display: none; }

/* =====================================================================
   Settings
   ===================================================================== */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 1.25rem; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.preset-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: .45rem;
    padding: .6rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
    background: var(--brand-surface); color: var(--ink); font-weight: 600; font-size: .8125rem; text-align: left;
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.preset-btn:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-sm); }
.preset-btn:active { transform: translateY(1px); }
.swatches { display: flex; }
.swatch { display: inline-block; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid var(--brand-surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatches .swatch + .swatch { margin-left: -.3rem; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.cover-preview { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: var(--r); display: block; border: 1px solid var(--line); }
.cover-empty { width: 100%; aspect-ratio: 16 / 6; border-radius: var(--r); border: 1px dashed var(--line-strong); background: var(--wash); display: grid; place-items: center; color: var(--ink-faint); font-size: .8125rem; font-weight: 600; text-align: center; }
.cover-empty .icon { width: 26px; height: 26px; display: block; margin: 0 auto .3rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .9rem; border-radius: var(--r-sm); background: var(--wash); border: 1px solid var(--line); font-size: .875rem; }
.kv-list { display: flex; flex-direction: column; gap: .5rem; }
.kv-list .kv > span:first-child { flex: none; width: 10rem; color: var(--brand-muted); }
.kv-list .kv > span:last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: right; }
@media (max-width: 600px) { .kv-list .kv { flex-direction: column; align-items: flex-start; gap: .2rem; } .kv-list .kv > span:last-child { text-align: left; } }

/* =====================================================================
   Platform console
   ===================================================================== */
.cafe-cell { display: flex; align-items: center; gap: .75rem; min-width: 11rem; }
.owner-cell { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cafe-avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--tint); color: var(--brand-primary); font-weight: 750; flex-shrink: 0; }
.cafe-cell strong { display: block; line-height: 1.25; }
.usage { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.usage span { display: inline-flex; align-items: center; gap: .35rem; }
.usage .icon { width: 13px; height: 13px; }
.usage b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stripe-form { display: flex; gap: .35rem; min-width: 12rem; }
.row-actions { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.credentials { background: var(--brand-surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .75rem .9rem; margin-top: .6rem; font-size: .875rem; line-height: 1.7; }

/* =====================================================================
   Public site: landing + sign-in
   ===================================================================== */
.site-bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--brand-bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--page-line); }
.site-bar-inner { max-width: 1120px; margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.site-logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--brand-text); }
.site-logo:hover { color: var(--brand-text); }
.site-logo .brand-mark { width: 2.1rem; height: 2.1rem; border-radius: 10px; font-size: .95rem; }
.site-bar .navbar-brand { color: var(--brand-text); font-weight: 700; font-size: 1.02rem; padding: 0; margin: 0; }
.site-main { max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Landing */
.landing { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; padding: 2.5rem 0 1rem; }
.landing-kicker { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; background: var(--brand-surface); border: 1px solid var(--page-line); font-size: .78rem; font-weight: 650; color: var(--brand-text); box-shadow: var(--shadow-xs); }
.landing-kicker .icon { width: 15px; height: 15px; color: var(--brand-primary); }
.landing h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4rem); line-height: 1.02; letter-spacing: -.035em; margin: 1rem 0 1rem; }
.landing .lead { font-size: 1.15rem; color: var(--brand-muted); max-width: 34ch; margin-bottom: 1.75rem; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 2rem; max-width: 34rem; }
.step-card { background: var(--brand-surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem; box-shadow: var(--shadow-xs); }
.step-card .icon { color: var(--brand-primary); margin-bottom: .4rem; }
.step-card b { display: block; font-size: .875rem; }
.step-card span { font-size: .75rem; color: var(--ink-soft); }
.landing-links { display: flex; align-items: center; gap: 1rem; font-size: .875rem; color: var(--brand-muted); }
.landing-links a { font-weight: 650; display: inline-flex; align-items: center; gap: .35rem; }

/* Phone mock-up on the landing page (decorative) */
.phone { justify-self: center; width: min(300px, 100%); aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px; background: #0f0f12; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a2a30; position: relative; }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; border-radius: 12px; background: #0f0f12; z-index: 2; }
.phone-screen { height: 100%; border-radius: 34px; overflow: hidden; background: var(--brand-bg); display: flex; flex-direction: column; }
.phone-hero { height: 38%; padding: 3.25rem 1rem 1rem; background: linear-gradient(160deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 50%, var(--brand-accent))); color: var(--brand-on-primary); display: flex; flex-direction: column; justify-content: flex-end; }
.phone-hero b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.phone-hero span { font-size: .7rem; opacity: .85; }
.phone-list { padding: .75rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.phone-item { background: var(--brand-surface); border-radius: 14px; padding: .6rem; display: flex; align-items: center; gap: .6rem; box-shadow: var(--shadow-xs); color: var(--ink); }
.phone-thumb { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 50%, var(--brand-primary))); flex-shrink: 0; }
.phone-item div { flex: 1; min-width: 0; }
.phone-line { height: 7px; border-radius: 4px; background: var(--line-strong); margin: 3px 0; }
.phone-line.short { width: 45%; background: var(--line); }
.phone-plus { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-primary); color: var(--brand-on-primary); display: grid; place-items: center; font-size: .9rem; font-weight: 700; line-height: 1; }
.phone-bar { margin: .75rem; padding: .7rem .9rem; border-radius: 16px; background: var(--brand-primary); color: var(--brand-on-primary); display: flex; justify-content: space-between; font-size: .75rem; font-weight: 700; }

/* Sign-in */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 10rem); border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--page-line); box-shadow: var(--shadow-md); background: var(--brand-surface); }
.auth-aside { position: relative; padding: 2.75rem; color: var(--brand-on-primary); background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--brand-accent) 55%, transparent), transparent 60%),
    linear-gradient(160deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 70%, #000)); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.auth-aside.is-platform { background: radial-gradient(120% 80% at 100% 0%, rgb(99 102 241 / .55), transparent 60%), linear-gradient(160deg, #111827, #1e1b4b); color: #fff; }
.auth-aside h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.3rem); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.auth-aside p { opacity: .85; margin: .75rem 0 0; max-width: 34ch; }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .9rem; }
.auth-features li { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; }
.auth-features .icon { width: 2rem; height: 2rem; padding: .45rem; border-radius: 10px; background: rgb(255 255 255 / .14); flex-shrink: 0; }
.auth-features b { display: block; }
.auth-features span { opacity: .8; }
.auth-main { display: grid; place-items: center; padding: 2.5rem 1.5rem; color: var(--ink); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card-wide { max-width: 480px; }
.register-contact { border: 0; margin: 0; padding: 0; display: grid; gap: .6rem; }
/* Your plan: trial steps and the two plans */
.sheet.sheet-wide { max-width: 44rem; }
/* Terms & privacy (/terms): long text that stays easy to read */
.legal { line-height: 1.6; margin-bottom: 2rem; }
.legal-head h1 { font-size: 1.6rem; font-weight: 720; letter-spacing: -.025em; margin: 0 0 .25rem; }
.legal-head { margin-bottom: 1rem; }
.legal-lead { font-size: 1.02rem; padding: .9rem 1rem; border-radius: var(--r-lg); background: var(--tint); }
.legal-toc { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 .5rem; }
.legal-toc a { padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; text-decoration: none; color: inherit; }
.legal section { scroll-margin-top: 1rem; border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem; }
.legal h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .75rem; }
.legal h3 { font-size: 1rem; font-weight: 650; margin: 1.1rem 0 .4rem; }
.legal ul { padding-left: 1.2rem; margin-bottom: .75rem; }
.legal li { margin-bottom: .35rem; }
.guest-foot a.legal-link { display: block; width: max-content; margin: .6rem auto 0; padding: 0; border: 0; font-weight: 400; font-size: .8rem; text-decoration: underline !important; }
.site-foot { text-align: center; font-size: .8rem; padding: 1.5rem 1rem 2rem; color: var(--ink-soft); }
.site-foot a { color: inherit; }
.plan-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.plan-steps li { counter-increment: step; position: relative; padding: .1rem 0 .1rem 2.2rem; font-size: .9rem; }
.plan-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 1px solid var(--line); color: var(--ink-soft); }
.plan-steps li.done::before { content: "✓"; background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary, #fff); }
.plan-steps li.current::before { border: 2px solid var(--brand-primary); color: var(--brand-primary); }
.plan-steps li.todo { color: var(--ink-soft); }
.plan-steps b { display: block; }
.plan-steps span { color: var(--ink-soft); font-size: .82rem; }
.stripe-option.is-chosen { border: 2px solid var(--brand-primary); }
.online-signup { padding: .85rem; border-radius: var(--r-sm); border: 1px dashed var(--line); }
.guest-foot a { color: inherit; white-space: nowrap; }
/* An input the server refused (Razor's validation class), like Bootstrap's .is-invalid */
.form-control.input-validation-error { border-color: var(--bs-danger, #dc3545); }
.form-control.input-validation-error:focus { box-shadow: 0 0 0 .25rem rgb(220 53 69 / .25); }
/* Modal: confirmations and notices (site.js) and warnings after an action (Shared/_Flash). Uses the café's theme. */
.app-modal { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(26rem, calc(100vw - 2rem));
    background: var(--brand-surface); color: var(--ink); box-shadow: var(--shadow-lg); font-family: var(--font-sans); }
.app-modal[open] { animation: app-modal-in .16s ease-out; }
.app-modal::backdrop { background: color-mix(in srgb, var(--brand-text) 45%, transparent); backdrop-filter: blur(2px); }
.app-modal-body { padding: 1.5rem 1.5rem 1.25rem; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: start; }
.app-modal-icon { grid-row: span 2; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
    font-weight: 800; font-size: 1.25rem; background: var(--tint); color: var(--brand-primary); }
.app-modal-warning .app-modal-icon { background: color-mix(in srgb, var(--c-new) 16%, var(--brand-surface)); color: var(--c-new); }
.app-modal-danger .app-modal-icon { background: color-mix(in srgb, var(--c-danger) 14%, var(--brand-surface)); color: var(--c-danger); }
.app-modal-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; margin: .3rem 0 0; }
.app-modal-text { margin: 0; color: var(--ink-soft); line-height: 1.5; white-space: pre-line; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.5rem; background: var(--wash);
    border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); margin: 0; }
.app-modal-danger .app-modal-confirm { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
@keyframes app-modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-modal[open] { animation: none; } }
@media (max-width: 480px) { .app-modal-actions { flex-direction: column-reverse; } .app-modal-actions .btn { width: 100%; } }
.register-contact .form-hint { margin: -.35rem 0 0; }
/* Bot trap: off-screen, never visible or focusable for people */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.free-note { border-left: 3px solid var(--accent, #6c5ce7); padding: .5rem .75rem; background: var(--wash, rgba(0,0,0,.03)); border-radius: 6px; }
.auth-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 14px; background: var(--tint); color: var(--brand-primary); margin-bottom: 1.1rem; }
.auth-icon .icon { width: 22px; height: 22px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 720; letter-spacing: -.025em; margin: 0; }
.auth-sub { color: var(--ink-soft); margin: .35rem 0 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.login-alert-detail { display: block; margin-top: .25rem; font-size: .875rem; }
.login-alert-detail b { font-variant-numeric: tabular-nums; }
.auth-foot { font-size: .8125rem; color: var(--ink-soft); margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* Simple centred message pages (no access, error) */
.message-page { max-width: 30rem; margin: 3rem auto; text-align: center; }

/* =====================================================================
   Guest experience (menu, checkout, order status) — mobile first
   ===================================================================== */
.site-guest { max-width: 760px; padding: 0 0 2rem; }
.guest-foot { text-align: center; font-size: .9rem; line-height: 1.5; color: var(--brand-muted); padding: 1.25rem 1rem 7rem; max-width: 34rem; margin: 0 auto; }
.guest-foot strong { color: var(--brand-ink, inherit); font-size: 1rem; }
.guest-foot a { display: inline-block; margin-top: .5rem; padding: .4rem 1rem; border-radius: 999px; border: 1px solid currentColor; font-weight: 600; text-decoration: none !important; }
.guest-body { padding: 0 1rem; }

.cafe-hero {
    position: relative; overflow: hidden; min-height: 220px;
    display: flex; align-items: flex-end;
    background:
        radial-gradient(110% 90% at 100% 0%, color-mix(in srgb, var(--brand-accent) 60%, transparent), transparent 62%),
        linear-gradient(160deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 72%, #000));
    color: #fff; margin-bottom: 1.25rem;
}
.cafe-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cafe-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .05) 20%, rgb(0 0 0 / .68)); pointer-events: none; }
.cafe-hero-plain::after { background: linear-gradient(180deg, transparent 40%, rgb(0 0 0 / .25)); }
.cafe-hero-text { position: relative; z-index: 1; padding: 1.5rem 1.25rem 1.35rem; width: 100%; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: rgb(255 255 255 / .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgb(255 255 255 / .28); font-size: .78rem; font-weight: 650; }
.hero-chip .icon { width: 14px; height: 14px; }
.hero-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 2.4vw, 2.8rem); letter-spacing: -.03em; line-height: 1.05; margin: .6rem 0 .25rem; text-shadow: 0 2px 16px rgb(0 0 0 / .25); }
.hero-sub { margin: 0; font-size: .9rem; opacity: .9; }

/* Category tabs */
.cat-nav { position: sticky; top: 0; z-index: 15; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: .7rem 1rem; margin: 0 -1rem 1rem; background: color-mix(in srgb, var(--brand-bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--page-line); }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { flex-shrink: 0; padding: .45rem .9rem; border-radius: 999px; font-size: .8125rem; font-weight: 650; text-decoration: none; color: var(--brand-text); background: var(--brand-surface); border: 1px solid var(--page-line); white-space: nowrap; transition: background-color .15s, color .15s; }
.cat-nav a:hover, .cat-nav a.is-active { background: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }

.menu-section { scroll-margin-top: 4.5rem; margin-bottom: 1.75rem; }
.menu-section-title { display: flex; align-items: baseline; gap: .5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; letter-spacing: -.02em; margin: 0 0 .75rem; }
.menu-section-title .count { font-family: var(--font-sans); font-size: .75rem; font-weight: 600; color: var(--brand-muted); letter-spacing: 0; }
.menu-list { display: flex; flex-direction: column; gap: .7rem; }
.menu-item {
    display: flex; gap: 1rem; align-items: stretch; justify-content: space-between;
    background: var(--brand-surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem;
    box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.menu-item.is-picked { border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--brand-surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 14%, transparent); }
.mi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-name { font-weight: 680; font-size: 1rem; letter-spacing: -.01em; }
.mi-allergens { font-size: .75rem; color: var(--ink-soft); margin-top: .2rem; line-height: 1.4; }
.mi-desc { font-size: .8125rem; color: var(--ink-soft); margin-top: .2rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mi-price { margin-top: auto; padding-top: .55rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mi-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: .6rem; flex-shrink: 0; }
.menu-item .menu-thumb { width: 92px; height: 92px; border-radius: 14px; }

.stepper { display: inline-flex; align-items: center; background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.stepper .step { width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--brand-surface); color: var(--ink); font-size: 1.1rem; font-weight: 600; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-xs); cursor: pointer; transition: background-color .15s, color .15s; }
.stepper .step:hover { background: var(--tint); }
.stepper .step-plus { background: var(--brand-primary); color: var(--brand-on-primary); }
.stepper .step-plus:hover { background: var(--brand-primary-hover); }
.stepper .qty-input { width: 2.4rem; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper .qty-input:focus { box-shadow: none; }
.stepper .qty-input::-webkit-outer-spin-button, .stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.note-card { padding: 1rem; border-radius: var(--r-lg); }

/* Sticky order bar */
.order-bar { position: sticky; bottom: 0; z-index: 20; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); margin-top: 1.25rem; background: linear-gradient(180deg, transparent, var(--brand-bg) 30%); }
.order-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .6rem .6rem 1.1rem; border-radius: 20px; background: var(--brand-surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.order-bar-total { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.order-bar-label { font-size: .75rem; color: var(--ink-soft); font-weight: 600; }
.order-bar-total strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.order-bar .btn { border-radius: 14px; }

/* Checkout + status */
.sheet { max-width: 30rem; margin: 1.25rem auto 0; padding: 0 1rem; }
.sheet-card { padding: 1.5rem; border-radius: var(--r-xl); }
.sheet-head { text-align: center; margin-bottom: 1.25rem; }
.sheet-icon { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 16px; background: var(--tint); color: var(--brand-primary); margin-bottom: .75rem; }
.sheet-icon .icon { width: 24px; height: 24px; }
.sheet-head h1 { font-size: 1.4rem; font-weight: 720; letter-spacing: -.025em; margin: 0; }
.sheet-head p { color: var(--ink-soft); margin: .25rem 0 0; font-size: .875rem; }
.receipt { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.receipt li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.receipt li span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 750; font-size: 1.1rem; letter-spacing: -.01em; padding-top: 1rem; margin-top: 1rem; border-top: 1px dashed var(--line-strong); font-variant-numeric: tabular-nums; }
.receipt-note { font-size: .8125rem; color: var(--ink-soft); margin-top: .75rem; padding: .5rem .7rem; background: var(--wash); border-radius: var(--r-sm); }
.test-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: color-mix(in srgb, var(--c-new) 14%, var(--brand-surface)); color: color-mix(in srgb, var(--c-new) 75%, var(--ink)); margin-bottom: .6rem; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .75rem; color: var(--ink-soft); margin-top: 1rem; }
.secure-note .icon { width: 14px; height: 14px; }

/* Guest order confirmation */
.confirm-hero { text-align: center; padding: 1.5rem 0 1.25rem; }
.confirm-orb { --tone: var(--c-ready); display: inline-grid; place-items: center; width: 4.75rem; height: 4.75rem; border-radius: 50%; color: #fff; background: var(--tone); box-shadow: 0 0 0 9px color-mix(in srgb, var(--tone) 16%, transparent), 0 16px 34px -12px var(--tone); margin-bottom: 1.15rem; animation: orb-pop .5s cubic-bezier(.2, .9, .3, 1.3); }
.confirm-orb .icon { width: 32px; height: 32px; }
.confirm-orb.is-waiting { --tone: var(--c-off); animation: none; }
.confirm-orb.is-waiting .icon { animation: spin 2.4s linear infinite; }
.confirm-orb.is-cancelled { --tone: var(--c-off); }
.confirm-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-muted); margin: 0 0 .35rem; }
.confirm-title { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.7rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.2; margin: 0 auto; max-width: 20ch; color: var(--brand-text); }
.confirm-lead { color: var(--brand-muted); font-size: .975rem; line-height: 1.5; margin: .6rem auto 0; max-width: 34ch; }
.confirm-note { --tone: var(--c-ready); display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; margin-bottom: 1rem; border-radius: var(--r); background: color-mix(in srgb, var(--tone) 10%, var(--brand-surface)); border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--brand-surface)); color: var(--brand-surface-text); }
.confirm-note b { display: block; font-weight: 700; }
.confirm-note span { font-size: .875rem; color: var(--ink-soft); }
.confirm-note-icon { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--tone); color: #fff; flex-shrink: 0; }
.confirm-note-icon .icon { width: 18px; height: 18px; }
.receipt-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.receipt-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.receipt-head span { font-size: .8125rem; color: var(--ink-soft); }
.receipt-qty { font-weight: 700; color: var(--brand-primary); margin-right: .15rem; }
.confirm-help { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--r); border: 1px dashed var(--page-line); color: var(--brand-text); }
.confirm-help p { margin: 0; font-size: .875rem; line-height: 1.5; }
.confirm-help-icon { color: var(--brand-primary); }
.confirm-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.confirm-actions .btn { flex: 1; }

/* Guest: "Your orders" banner on the menu + list page */
.my-orders-banner { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: var(--r); background: var(--brand-surface); color: var(--brand-surface-text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; }
.my-orders-banner:hover { text-decoration: none; border-color: var(--brand-primary); }
.my-orders-icon { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--brand-primary); color: var(--brand-on-primary); flex-shrink: 0; }
.my-orders-text { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.my-orders-text span { font-size: .8125rem; color: var(--ink-soft); }
.my-orders-go { font-size: .875rem; font-weight: 650; color: var(--brand-primary); white-space: nowrap; }
.my-orders { display: flex; flex-direction: column; gap: .75rem; }
.my-order { display: block; text-decoration: none; color: var(--brand-surface-text); padding: 1rem 1.15rem; }
.my-order:hover { text-decoration: none; border-color: var(--brand-primary); }
.my-order-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.my-order-meta { font-size: .8125rem; color: var(--ink-soft); margin-top: .15rem; }
.my-order-items { font-size: .875rem; margin: .5rem 0 .6rem; }
.my-order-foot { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: .6rem; border-top: 1px dashed var(--line-strong); }
.my-orders-help { text-align: center; font-size: .8125rem; color: var(--brand-muted); margin: 1rem 0 0; }
.my-order-go { font-size: .8125rem; font-weight: 650; color: var(--brand-primary); }

/* ---------- Tipping (guest) ---------- */

.tip-link { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; padding: .8rem 1rem; border-radius: var(--r); background: color-mix(in srgb, var(--brand-accent) 10%, var(--brand-surface)); color: var(--brand-surface-text); border: 1px solid color-mix(in srgb, var(--brand-accent) 30%, var(--line)); text-decoration: none; }
.tip-link:hover { text-decoration: none; border-color: var(--brand-accent); }
.tip-link-icon { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--brand-accent); color: var(--brand-on-accent, #fff); flex-shrink: 0; }
.tip-link-text { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.tip-link-text span { font-size: .8125rem; color: var(--ink-soft); }
.tip-link-go { font-size: .875rem; font-weight: 650; color: var(--brand-primary); white-space: nowrap; }

.sheet-icon.tip-icon { background: var(--brand-accent); color: var(--brand-on-accent, #fff); }
.tip-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tip-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.tip-amount { position: relative; margin: 0; cursor: pointer; }
.tip-amount input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tip-amounts[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.tip-amounts[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tip-pct { display: block; font-size: .75rem; font-weight: 650; opacity: .75; line-height: 1.1; }
.tip-amount span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 3.5rem; border-radius: var(--r); border: 2px solid var(--line-strong); font-size: 1.15rem; font-weight: 720; font-variant-numeric: tabular-nums; background: var(--brand-surface); transition: border-color .15s, background .15s; }
.tip-amount input:checked + span { border-color: var(--brand-primary); background: var(--brand-primary); color: var(--brand-on-primary); }
.tip-amount input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand-primary) 45%, transparent); outline-offset: 2px; }
.tip-form .btn .icon { width: 18px; height: 18px; margin-right: .4rem; vertical-align: -3px; }
.confirm-orb.is-tip { --tone: var(--brand-accent); }
.receipt.receipt-extra { margin-top: .35rem; padding-top: .5rem; border-top: 1px solid var(--line); }
/* Same 1rem rhythm as the other blocks at the end of the menu (note card, pay hint); the order bar adds its own space below. */
.tip-checkout { border: 1px solid var(--line); margin: 1rem 0 0; min-width: 0; }
.tip-checkout legend { float: left; width: 100%; display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; font-size: inherit; }
.tip-checkout legend .icon { width: 16px; height: 16px; color: var(--brand-accent); }
.tip-checkout legend + * { clear: both; }
.tip-amounts-checkout { grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); }
.tip-amounts-checkout .tip-amount span { min-height: 3rem; font-size: 1rem; }

/* ---------- Tips (café admin) ---------- */
.tip-settings { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.tip-mode { display: grid; gap: .5rem; margin-bottom: .85rem; }
.tip-mode-option { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; margin: 0; }
.tip-mode-option:has(input:checked) { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 6%, var(--brand-surface)); }
.tip-mode-option input { margin-top: .3rem; accent-color: var(--brand-primary); }
.tip-mode-option span { display: flex; flex-direction: column; line-height: 1.3; }
.tip-mode-option small { color: var(--ink-soft); font-size: .8125rem; }
.tip-inputs { display: flex; flex-direction: column; gap: .35rem; }
.tip-input-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.toast-card.is-tip { --tone: #db2777; }
.toast-quote { font-size: .8125rem; font-style: italic; color: var(--ink); margin: .3rem 0 0 1.15rem; }
.tips-table td { white-space: nowrap; }
.tips-table .c-msg { white-space: normal; min-width: 12rem; color: var(--ink-soft); }
@keyframes orb-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Café: all orders + order details ---------- */
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--brand-surface); color: var(--ink-soft); font-size: .8125rem; font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s; }
.chip:hover { color: var(--ink); background: var(--wash); text-decoration: none; }
.chip.is-active { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--brand-on-accent); }
.chip-count { font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: var(--wash); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chip.is-active .chip-count { background: rgb(255 255 255 / .2); color: inherit; }
.filters { display: grid; grid-template-columns: minmax(11rem, 1.6fr) repeat(4, minmax(9rem, 1fr)) auto; gap: .75rem; align-items: end; padding: 1rem; margin-bottom: 1rem; }
.filter .form-label { margin-bottom: .3rem; color: var(--ink-soft); font-weight: 600; }
.filter-actions { display: flex; gap: .5rem; }
.results-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8125rem; color: var(--brand-muted); margin: 0 .25rem .6rem; }
.results-bar strong { color: var(--brand-text); font-variant-numeric: tabular-nums; }
.row-link { font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.orders-table td { white-space: nowrap; }
.orders-table td.c-items { white-space: normal; }
.items-summary { display: block; max-width: 15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); font-size: .875rem; }
.orders-table tbody tr:hover > * { background: var(--wash); }
.orders-table tbody tr { position: relative; cursor: pointer; }
.orders-table .row-link::after { content: ""; position: absolute; inset: 0; } /* whole row opens the order */
@media (min-width: 768px) { .orders-table .c-open { display: none; } }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; font-size: .875rem; color: var(--brand-muted); }
.back-link { display: inline-block; font-size: .875rem; font-weight: 600; text-decoration: none; margin-bottom: .75rem; color: var(--brand-muted); }
.back-link:hover { color: var(--brand-text); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 1.25rem; }
.detail-head { padding: 1rem 1.25rem 0; align-items: center; }
.detail-head .count { font-size: .8125rem; color: var(--ink-soft); }
.detail-total > td { font-weight: 750; font-size: 1.05rem; border-bottom: 0; border-top: 1px dashed var(--line-strong); }
.detail-note { margin: 0 1.25rem 1.25rem; padding: .7rem .9rem; border-radius: var(--r-sm); font-style: italic; background: color-mix(in srgb, var(--c-new) 9%, var(--brand-surface)); border: 1px dashed color-mix(in srgb, var(--c-new) 40%, var(--brand-surface)); }
.detail-note b { display: block; font-style: normal; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: .2rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .65rem 1rem; margin: 0; font-size: .875rem; }
.facts dt { color: var(--ink-soft); font-weight: 600; }
.facts dd { margin: 0; min-width: 0; }
.facts a { text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.ref { display: block; font-size: .78rem; padding: .3rem .5rem; border-radius: var(--r-sm); background: var(--wash); color: var(--ink); word-break: break-all; }
.ref-link { margin-top: .35rem; font-size: .8125rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; position: relative; display: flex; flex-direction: column; gap: 1rem; }
.timeline::before { content: ""; position: absolute; left: .4rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--line); }
.timeline li { position: relative; display: flex; flex-direction: column; font-size: .875rem; }
.timeline li::before { content: ""; position: absolute; left: -1.4rem; top: .2rem; width: .85rem; height: .85rem; border-radius: 50%; background: var(--brand-surface); border: 2px solid var(--line-strong); }
.timeline li.is-done::before { background: var(--c-ready); border-color: var(--c-ready); }
.timeline li.is-cancelled::before { background: var(--c-danger); border-color: var(--c-danger); }
.timeline span { color: var(--ink-soft); font-size: .8125rem; }

/* ---------- Payment setting + pay-at-counter hint ---------- */
.switch-row { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--wash); cursor: pointer; }
.switch-row b { font-weight: 650; }
.form-switch .form-check-input { width: 2.6rem; height: 1.45rem; margin: .05rem 0 0; cursor: pointer; background-color: var(--line-strong); border-color: var(--line-strong);
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px var(--focus); border-color: var(--brand-primary); }
.pay-hint { display: flex; align-items: center; gap: .5rem; justify-content: center; font-size: .8125rem; color: var(--brand-muted); margin: 1rem 0 0; }
.pay-hint .icon { width: 16px; height: 16px; }
.side-signout.is-muted .icon { opacity: .45; }

/* ---------- Live order toasts ---------- */
.toasts { position: fixed; right: 1.25rem; top: 1.25rem; z-index: 60; display: flex; flex-direction: column; gap: .6rem; width: min(360px, calc(100vw - 2rem)); pointer-events: none; }
.toast-card {
    --tone: var(--c-ready);
    pointer-events: auto; position: relative; overflow: hidden;
    background: var(--brand-surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
    padding: .85rem 1rem .85rem 1.15rem;
    animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast-card.is-counter { --tone: #0891b2; }
.toast-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.toast-card.is-leaving { opacity: 0; transform: translateX(16px); transition: opacity .25s, transform .25s; }
.toast-head { display: flex; align-items: center; gap: .55rem; }
.toast-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 22%, transparent); flex-shrink: 0; }
.toast-title { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.toast-close { border: 0; background: transparent; color: var(--ink-soft); font-size: 1.3rem; line-height: 1; padding: 0 .2rem; cursor: pointer; border-radius: 6px; }
.toast-close:hover { background: var(--wash); color: var(--ink); }
.toast-body { font-size: .8125rem; color: var(--ink-soft); margin: .2rem 0 0 1.15rem; }
.toast-hint { font-size: .75rem; color: color-mix(in srgb, var(--c-new) 75%, var(--ink)); margin: .35rem 0 0 1.15rem; }
.toast-link { display: inline-block; font-size: .8125rem; font-weight: 650; margin: .45rem 0 0 1.15rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1199.98px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .add-item { grid-template-columns: 1fr 1fr; }
    .add-item > .btn { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
    /* Admin shell: top bar + bottom tab bar */
    .app-side {
        position: sticky; top: 0; inset: auto; width: auto; height: auto;
        flex-direction: row; align-items: center; gap: .75rem;
        padding: .6rem 1rem; border-right: 0; border-bottom: 1px solid var(--line);
        background: var(--brand-surface); /* no backdrop-filter here: it would trap the fixed tab bar inside */
    }
    .side-brand { padding: 0; flex: 1; }
    .brand-mark { width: 2.1rem; height: 2.1rem; border-radius: 10px; font-size: .95rem; }
    .side-foot { margin: 0; padding: 0; border: 0; flex-direction: row; align-items: center; }
    .side-user { display: none; }
    .side-signout { width: auto; }
    [data-sound-toggle] [data-sound-label] { display: none; }
    .toasts { top: auto; bottom: calc(5.25rem + env(safe-area-inset-bottom)); right: 1rem; left: 1rem; width: auto; }
    .side-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        flex-direction: row; justify-content: space-around; gap: 0;
        padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--brand-surface) 94%, transparent);
        backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px -12px rgb(15 23 42 / .18);
    }
    .side-nav a { flex: 1; flex-direction: column; gap: .2rem; padding: .4rem .25rem; font-size: .68rem; font-weight: 650; text-align: center; border-radius: 12px; }
    .side-nav a .icon { width: 22px; height: 22px; }
    .side-nav a[aria-current=page] { background: transparent; color: var(--brand-primary); }
    .shell-platform .side-nav { display: none; }
    .app-main { margin-left: 0; }
    .app-content { padding: 1.25rem 1rem 6.5rem; }
    .shell-platform .app-content { padding-bottom: 3rem; }

    .settings-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-search, .filter-actions { grid-column: 1 / -1; }

    .landing { grid-template-columns: 1fr; gap: 2rem; text-align: left; }
    .phone { width: min(260px, 80%); }
    .auth { grid-template-columns: 1fr; min-height: 0; }
    .auth-aside { padding: 1.75rem; }
    .auth-features { display: none; }
}

@media (max-width: 767.98px) {
    body { font-size: .9375rem; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .kpi { padding: .85rem; border-radius: var(--r); }
    .kpi-value { font-size: 1.35rem; }
    .panel, .order-card { padding: 1rem; border-radius: var(--r); }

    /* Menu editor: table rows become cards */
    .items-table, .items-table tbody { display: block; }
    .items-table tr { display: grid; grid-template-columns: 76px 1fr; gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--line); }
    .items-table tr:last-child { border-bottom: 0; }
    .items-table td { display: block; padding: 0; border: 0; }
    .items-table .c-thumb { width: auto; }
    .items-table .menu-thumb { width: 76px; height: 76px; }
    .items-table .c-actions { grid-column: 1 / -1; width: auto; text-align: left; }
    .items-table .c-actions .btn-row { justify-content: stretch; }
    .items-table .c-actions .btn-row form { flex: 1; }
    .items-table .c-actions .btn-row .btn { width: 100%; }
    .item-edit input[name=name] { flex-basis: 100%; }
    .price-group { width: auto; flex: 1 1 7rem; }
    .item-tools input[type=file] { max-width: 100%; }
    .add-item { grid-template-columns: 1fr; }

    /* All orders: rows become cards */
    .orders-table thead { display: none; }
    .orders-table, .orders-table tbody { display: block; }
    .orders-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "id total" "table when" "items items" "pay status" "open open"; gap: .35rem .75rem; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
    .orders-table .c-id { grid-area: id; } .orders-table .c-total { grid-area: total; font-size: 1.05rem; }
    .orders-table .c-table { grid-area: table; } .orders-table .c-when { grid-area: when; text-align: right; color: var(--ink-soft); font-size: .8125rem; }
    .orders-table .c-items { grid-area: items; } .orders-table .c-pay { grid-area: pay; }
    .orders-table .c-status { grid-area: status; text-align: right; } .orders-table .c-open { grid-area: open; }
    .orders-table tr:last-child { border-bottom: 0; }
    .orders-table td { display: block; padding: 0 !important; border: 0; }
    .orders-table .c-open { text-align: left !important; margin-top: .3rem; }
    .orders-table .c-open .btn { width: 100%; }
    .items-summary { max-width: none; white-space: normal; }
    .cat-head { padding: .85rem 1rem; }
    .inline-form > div, .inline-form > .btn { flex: 1 1 100%; }
    .inline-form .qty-input { width: 100%; }

    .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { gap: .5rem; }
    .step-card { padding: .65rem; }
    .step-card span { display: none; }
    .landing { padding-top: .5rem; }

    .cafe-hero { min-height: 240px; }
    .menu-item .menu-thumb { width: 84px; height: 84px; }
}

@media (min-width: 768px) {
    .site-guest .cafe-hero { border-radius: 0 0 var(--r-xl) var(--r-xl); min-height: 280px; }
    .guest-body { padding: 0 1.5rem; }
    .cat-nav { margin: 0 -1.5rem 1.25rem; padding: .75rem 1.5rem; }
    .sheet { margin-top: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Print: QR table cards
   ===================================================================== */
@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
    body { background: #fff; color: #111; }
    .app-main { margin: 0; }
    .app-content { padding: 0; max-width: none; }
    .app-side { display: none !important; }
    [data-fee-statement], [data-invoices], [data-fee-lines] { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 1cm; }
    .qr-card { border: 1.5px dashed #999; box-shadow: none; border-radius: 12px; padding: .8cm; background: #fff; color: #111; opacity: 1; }
    .qr-head { justify-content: center; }
    .qr-title { font-size: 22pt; }
    .qr-frame { border: 0; }
    .qr-img { width: 6cm; height: 6cm; }
    .qr-caption { color: #333; font-size: 11pt; }
}

/* Production copy (local debugging): impossible to mistake for the live site. */
.prodcopy-banner { position: sticky; top: 0; z-index: 1080; padding: .4rem 1rem; text-align: center; font-size: .85rem; font-weight: 600;
  color: #fff; background: repeating-linear-gradient(45deg, #b91c1c, #b91c1c 14px, #991b1b 14px, #991b1b 28px); }
/* Platform errors page */
.error-row-detail { white-space: pre-wrap; word-break: break-word; font-size: .78rem; max-height: 28rem; overflow: auto; margin: .5rem 0 0; }
.error-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; align-items: end; }
