/* Tagiora's shop app, redesigned (the design canvas of 4–5 Nov 2026): a Google-style layer
   over tagiora.css, loaded on the app site only (base.html), so the public site and the
   console keep their own look. Tokens first, then the shell (top bar, menu, page panel,
   phone tab bar), then the parts every page uses. Page-specific rules live with their page
   further down, each under its own heading. */
:root {
  --ui-font: Roboto, system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --ui-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ui-bg: #f5f3fb;          /* the page behind the panels */
  --ui-surface: #fff;
  --ui-soft: #f7f5fc;        /* a quiet box inside a panel */
  --ui-ink: #1c1a29;
  --ui-muted: #4a4660;
  --ui-outline: #79748c;     /* field and outline-button borders */
  --ui-line: #e3deef;        /* card borders */
  --ui-rule: #efecf5;        /* rows inside a card */
  --ui-primary: #5b3fd6;
  --ui-primary-deep: #4429b8;
  --ui-link: #4a2fc4;
  --ui-link-hover: #2f1a99;
  --ui-tonal: #e6e0fb;
  --ui-on-tonal: #22105e;
  --ui-hover: #f3effd;
  --ui-error: #b3261e;
  --ui-ok-bg: #ddf2e4; --ui-ok: #0f5c2e;
  --ui-warn-bg: #fff0d4; --ui-warn: #6b4500;
  --ui-bad-bg: #fbe3e1; --ui-bad: #8c1d18;
  --ui-radius: 16px;
  --tg-ink: var(--ui-ink);
  --tg-muted: var(--ui-muted);
  --tg-brand: var(--ui-primary);
  --tg-brand-deep: var(--ui-primary-deep);
  --tg-paper: var(--ui-bg);
  --tg-line: var(--ui-line);
  --bs-body-font-family: var(--ui-font);
  --bs-body-color: var(--ui-ink);
  --bs-link-color: var(--ui-link);
  --bs-link-color-rgb: 74, 47, 196;
  --bs-link-hover-color: var(--ui-link-hover);
  --bs-link-hover-color-rgb: 47, 26, 153;
  --bs-secondary-color: var(--ui-muted);
  --bs-border-color: var(--ui-line);
  --bs-border-radius: 8px;
  --bs-focus-ring-color: rgba(91, 63, 214, .3);
}
.tg-body { background: var(--ui-bg); color: var(--ui-ink); font-family: var(--ui-font); font-size: 14px; line-height: 1.45; }
.text-secondary { color: var(--ui-muted) !important; }
a { color: var(--ui-link); }
a:hover { color: var(--ui-link-hover); }
:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }

/* ------------------------------------------------------------------ type */
.tg-h1, .ui-h1 { font-size: 28px; font-weight: 400; line-height: 1.25; letter-spacing: 0; margin: 0; color: var(--ui-ink); }
.tg-h2, .ui-h2 { font-size: 16px; font-weight: 500; line-height: 1.35; letter-spacing: 0; color: var(--ui-ink); }
.tg-h3 { font-size: 14px; font-weight: 500; }
.tg-note, .form-text { color: var(--ui-muted); font-size: 13px; }
.fw-semibold { font-weight: 500 !important; }
.fw-bold { font-weight: 700 !important; }
.tg-code, code.tg-code, .ui-code { font-family: var(--ui-mono); font-size: 13px; font-weight: 500; color: var(--ui-ink); }

/* ------------------------------------------------------------------ buttons
   Filled for the one main action, outlined for the others, text for the quiet ones. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 0 20px; border-radius: 20px; font: 500 14px/1.2 var(--ui-font); letter-spacing: .01em;
  white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { min-height: 36px; padding: 0 16px; border-radius: 18px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 28px; border-radius: 24px; font-size: 15px; }
.btn.w-100 { width: 100%; }
.tg-btn, .btn-primary { background: var(--ui-primary); border: 1px solid var(--ui-primary); color: #fff; font-weight: 500; }
.tg-btn:hover, .tg-btn:focus-visible, .btn-primary:hover { background: var(--ui-primary-deep); border-color: var(--ui-primary-deep); color: #fff; }
.tg-btn:disabled, .tg-btn.disabled { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; opacity: .4; }
.tg-btn-ghost, .btn-outline-secondary, .btn-light { background: var(--ui-surface); border: 1px solid var(--ui-outline);
  color: var(--ui-link); font-weight: 500; }
.tg-btn-ghost:hover, .tg-btn-ghost:focus-visible, .btn-outline-secondary:hover, .btn-light:hover {
  background: var(--ui-hover); border-color: var(--ui-outline); color: var(--ui-link); }
.tg-btn-ghost[aria-pressed="true"], .tg-btn-ghost.active { background: var(--ui-tonal); border-color: var(--ui-tonal); color: var(--ui-on-tonal); }
.tg-btn-text, .btn-link { background: transparent; border: 1px solid transparent; color: var(--ui-link); padding-inline: 12px; text-decoration: none; }
.tg-btn-text:hover, .btn-link:hover { background: var(--ui-hover); color: var(--ui-link); }
.tg-btn-danger, .btn-danger { background: var(--ui-error); border: 1px solid var(--ui-error); color: #fff; }
.tg-btn-danger:hover, .btn-danger:hover { background: #8c1d18; border-color: #8c1d18; color: #fff; }
.btn-outline-danger { background: var(--ui-surface); border: 1px solid var(--ui-outline); color: var(--ui-error); }
.btn-outline-danger:hover { background: var(--ui-bad-bg); border-color: var(--ui-outline); color: var(--ui-error); }
.tg-tonal { background: var(--ui-tonal); border: 1px solid var(--ui-tonal); color: var(--ui-on-tonal); }
.tg-tonal:hover { background: #d9d0f8; border-color: #d9d0f8; color: var(--ui-on-tonal); }
.tg-icon-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none; border: 0;
  border-radius: 24px; background: transparent; color: var(--ui-muted); }
.tg-icon-btn:hover, .tg-icon-btn:focus-visible { background: rgba(91, 63, 214, .08); color: var(--ui-ink); }
.tg-icon-btn svg { width: 24px; height: 24px; }

/* ------------------------------------------------------------------ cards, chips, tags */
.tg-card { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  box-shadow: none; padding: 20px; }
.tg-card > :last-child { margin-bottom: 0; }
.ui-soft { background: var(--ui-soft); border-radius: var(--ui-radius); }
.tg-chip, .ui-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--ui-outline); border-radius: 8px; background: var(--ui-surface); color: var(--ui-ink);
  font: 500 13px/1.2 var(--ui-font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.tg-chip:hover, .ui-chip:hover { background: var(--ui-hover); color: var(--ui-ink); }
.tg-chip[aria-pressed="true"], .tg-chip[aria-current="page"], .tg-chip.is-on,
.ui-chip[aria-pressed="true"], .ui-chip[aria-current="page"] { background: var(--ui-tonal); border-color: var(--ui-tonal); color: var(--ui-on-tonal); }
.ui-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tg-badge, .ui-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px;
  padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--ui-tonal); color: var(--ui-on-tonal); }
.tg-badge.is-warn, .ui-tag.is-warn, .tg-badge.bg-warning { background: var(--ui-warn-bg) !important; color: var(--ui-warn) !important; }
.tg-badge.is-bad, .ui-tag.is-bad, .tg-badge.bg-danger { background: var(--ui-bad-bg) !important; color: var(--ui-bad) !important; }
.tg-badge.is-ok, .ui-tag.is-ok, .tg-badge.bg-success { background: var(--ui-ok-bg) !important; color: var(--ui-ok) !important; }
.tg-badge.is-quiet, .ui-tag.is-quiet, .tg-badge.bg-secondary { background: #eeecf3 !important; color: var(--ui-muted) !important; }
.tg-count { display: inline-flex; align-items: center; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
  background: var(--ui-tonal); color: var(--ui-on-tonal); font-size: 13px; font-weight: 500; vertical-align: middle; }

/* Segmented buttons (Today / 7 days / …, Monthly / Yearly). */
.ui-seg { display: inline-flex; border: 1px solid var(--ui-outline); border-radius: 20px; overflow: hidden; max-width: 100%; }
.ui-seg > a, .ui-seg > button, .ui-seg > label { display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
  padding: 0 16px; border: 0; border-right: 1px solid var(--ui-outline); background: var(--ui-surface); color: var(--ui-ink);
  font: 500 14px/1.2 var(--ui-font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ui-seg > :last-child { border-right: 0; }
.ui-seg > [aria-pressed="true"], .ui-seg > [aria-current="page"], .ui-seg > .is-on { background: var(--ui-tonal); color: var(--ui-on-tonal); }
.ui-seg > :hover { background: var(--ui-hover); }
/* Shop or godown in a stock popup: halves of one button around real radio buttons. */
.ui-place-pick { display: flex; width: 100%; }
.ui-place-pick > label { position: relative; flex: 1 1 0; justify-content: center; min-height: 44px; margin: 0; }
.ui-place-pick input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ui-place-pick > label:has(input:checked) { background: var(--ui-tonal); color: var(--ui-on-tonal); }
.ui-place-pick > label:has(input:focus-visible) { outline: 2px solid var(--ui-primary); outline-offset: -3px; }

/* Underline tabs (Settings, Help, one item). */
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tabs > a, .ui-tabs > button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px;
  padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ui-muted);
  font: 500 14px/1.2 var(--ui-font); text-decoration: none; white-space: nowrap; }
.ui-tabs > [aria-selected="true"], .ui-tabs > [aria-current="page"] { color: var(--ui-primary); border-bottom-color: var(--ui-primary); }
.ui-tabs > :hover { color: var(--ui-ink); background: var(--ui-hover); }
/* Tabs wider than the page: an arrow at each end with more past it (app.js). The arrow's
   fade matches what's behind the tabs: --ui-tabs-bg, the page unless set. */
.ui-tabs-wrap { position: relative; }
.ui-tabs-arrow { position: absolute; top: 0; bottom: 1px; z-index: 2; display: flex; align-items: center; width: 52px;
  padding: 0 6px; border: 0; color: var(--ui-ink); cursor: pointer; }
.ui-tabs-arrow[hidden] { display: none; }
.ui-tabs-arrow.is-back { left: 0; justify-content: flex-start; background: linear-gradient(to right, var(--ui-tabs-bg, var(--ui-bg)) 55%, transparent); }
.ui-tabs-arrow.is-on { right: 0; justify-content: flex-end; background: linear-gradient(to left, var(--ui-tabs-bg, var(--ui-bg)) 55%, transparent); }
.ui-tabs-arrow svg { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--ui-surface);
  box-shadow: 0 1px 3px rgba(28, 26, 41, .22); }
.ui-tabs-arrow:hover svg { background: var(--ui-hover); }

/* ------------------------------------------------------------------ fields */
.form-label, .ui-label { font-size: 13px; font-weight: 500; color: var(--ui-muted); margin-bottom: 4px; }
.form-control, .form-select { min-height: 44px; border: 1px solid var(--ui-outline); border-radius: 8px; padding: 8px 12px;
  font: 400 15px/1.4 var(--ui-font); color: var(--ui-ink); background-color: var(--ui-surface); }
.form-select { padding-right: 36px; }
.form-control-sm, .form-select-sm { min-height: 36px; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }
.form-control-lg { min-height: 52px; font-size: 17px; }
textarea.form-control { min-height: 88px; }
.form-control:focus, .form-select:focus { border-color: var(--ui-primary); box-shadow: 0 0 0 1px var(--ui-primary); }
.form-control::placeholder { color: #8a8599; }
.form-control.is-invalid, .form-select.is-invalid, .was-validated .form-control:invalid { border-color: var(--ui-error);
  box-shadow: 0 0 0 1px var(--ui-error); background-image: none; padding-right: 12px; }
.invalid-feedback, .errorlist { color: var(--ui-error); font-size: 13px; }
.form-check-input { width: 20px; height: 20px; margin-top: 0; border: 2px solid var(--ui-outline); }
.form-check-input:checked { background-color: var(--ui-primary); border-color: var(--ui-primary); }
.form-check { display: flex; align-items: center; gap: 10px; min-height: 40px; padding-left: 0; }
.form-check .form-check-input { float: none; margin-left: 0; flex: none; }
.form-switch .form-check-input { width: 40px; height: 24px; border-radius: 12px; }
.input-group-text { border: 1px solid var(--ui-outline); border-radius: 8px; background: var(--ui-soft); color: var(--ui-muted); }

/* ------------------------------------------------------------------ messages */
.alert { border: 0; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.alert-success { background: var(--ui-ok-bg); color: var(--ui-ok); }
.alert-info { background: var(--ui-tonal); color: var(--ui-on-tonal); }
.alert-warning { background: var(--ui-warn-bg); color: #4d3200; }
.alert-danger { background: var(--ui-bad-bg); color: var(--ui-bad); }
.alert a { color: inherit; font-weight: 700; }
.ui-status { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; background: var(--ui-ok-bg); color: var(--ui-ok); }
.ui-status.is-bad { background: var(--ui-bad-bg); color: var(--ui-bad); }
.ui-status.is-warn { background: var(--ui-warn-bg); color: #4d3200; }
.ui-status.is-info { background: var(--ui-tonal); color: var(--ui-on-tonal); }

/* ------------------------------------------------------------------ lists and tables */
.ui-list { display: flex; flex-direction: column; }
.ui-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--ui-rule);
  color: var(--ui-ink); text-decoration: none; }
.ui-row:last-child { border-bottom: 0; }
a.ui-row:hover { color: var(--ui-ink); background: #faf9fd; }
.table, .tg-table { --bs-table-bg: transparent; --bs-table-border-color: var(--ui-rule); color: var(--ui-ink); font-size: 14px; }
.table > thead th, .tg-table > thead th { font-size: 12px; font-weight: 500; color: var(--ui-muted); border-bottom-color: var(--ui-line);
  text-transform: none; letter-spacing: 0; white-space: nowrap; }
.table > :not(caption) > * > * { padding: 12px 10px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #faf9fd; }
.ui-scroll-x { overflow-x: auto; }

/* ------------------------------------------------------------------ dialogs and sheets
   A centred dialog on a computer; a sheet from the bottom on a phone. */
.ui-dialog, dialog.tg-dialog { border: 0; border-radius: 28px; padding: 24px; max-width: min(560px, calc(100vw - 32px));
  width: 100%; background: var(--ui-surface); color: var(--ui-ink); box-shadow: 0 12px 40px rgba(28, 26, 41, .28); }
.ui-dialog::backdrop, dialog.tg-dialog::backdrop { background: rgba(28, 26, 41, .42); }
.ui-dialog h2 { font-size: 22px; font-weight: 400; margin: 0 0 12px; }
.ui-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
/* "Are you sure?" (app.js): a title, a line under it, Cancel and Confirm. */
.ui-ask[open] { display: flex; flex-direction: column; gap: 16px; max-width: min(460px, calc(100vw - 32px)); }
.ui-ask h2 { margin: 0; }
.ui-ask p { margin: 0; color: var(--ui-muted); }
.ui-ask .ui-dialog-actions { margin-top: 4px; }
@media (max-width: 767.98px) {
  .ui-dialog.is-sheet { margin: auto 0 0; max-width: 100vw; border-radius: 28px 28px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
/* A popup never scrolls as a whole: a scrollbar on the box rides its rounded edge, and its
   buttons slip out of view. The box is a column: the title on top, the part marked
   .ui-dlg-body scrolling inside it only when the content is taller than the window, and the
   buttons (.ui-dlg-foot) right after that part, always in view. Every wrapper between the box
   and its body (a form, a div) is a column too. The body's 4px keeps focus rings unclipped;
   a box with its own padding or border goes inside the body, not on it. The side panels
   (Add item, a sale: .it-side-body) keep their own padding. */
dialog:modal { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100dvh - 32px); }
dialog:modal :has(.ui-dlg-body) { display: flex; flex-direction: column; min-height: 0; }
.ui-dlg-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
dialog:modal .ui-dlg-body:where(:not(.it-side-body)) { margin: -4px; padding: 4px; }
.ui-dlg-head, .ui-dlg-foot { flex: none; }
.ui-dlg-stack { display: flex; flex-direction: column; gap: 16px; }

/* The yellow strip for what only a preview shows (kept for the "Preview" buttons that stand
   in for a camera, a microphone or a payment in the stand-in backends). */
.ui-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed #b07d12;
  border-radius: 12px; background: #fff7d6; color: #4d3200; font-size: 13px; }

/* ================================================================== the shell
   Computers: the top bar across the window (☰, Tagiora, the shop's name with its switch,
   Home / Counter / Kitchen), and under it the menu at the left beside a white panel with the
   page. ☰ makes the menu small or full again (app.js keeps the choice in a cookie). Tablets
   and phones: ☰ slides the menu out over the page, and phones get a tab bar at the bottom. */
html:has(.tg-shell) { scrollbar-gutter: stable; }
.tg-shell { --tg-side-w: 256px; --tg-bar-h: 64px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.tg-appbar { position: sticky; top: 0; z-index: 30; flex: none; background: var(--ui-bg); border: 0; }
.tg-appbar-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 12px; min-height: var(--tg-bar-h);
  padding: 8px 16px; max-width: none; margin: 0; }
.tg-appbar-start { flex: 0 1 228px; min-width: 0; display: flex; align-items: center; gap: 4px; }
.tg-appbar .tg-brand { gap: 8px; color: var(--ui-ink); font-size: 20px; font-weight: 500; letter-spacing: 0; }
.tg-appbar .tg-brand .tg-mark { width: 30px; height: 30px; color: var(--ui-primary); }
.tg-appbar .tg-brand span { color: var(--ui-ink); }
.tg-appbar-sep { flex: none; width: 1px; height: 24px; background: #d6d0e6; }
.tg-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.tg-quick a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px;
  color: var(--ui-muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.tg-quick a:hover { background: rgba(91, 63, 214, .08); color: var(--ui-ink); }
.tg-quick a[aria-current="page"] { background: var(--ui-tonal); color: var(--ui-on-tonal); }

/* The shop's name, which switches shop when there's more than one. */
.tg-shopswitch { position: relative; min-width: 0; }
.tg-shop-name, .tg-shopswitch > summary { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 44px;
  padding: 0 6px 0 10px; border-radius: 22px; color: var(--ui-ink); font: 700 17px/1.2 var(--ui-font); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style: none; cursor: default; }
.tg-shopswitch > summary { cursor: pointer; }
.tg-shopswitch > summary::-webkit-details-marker { display: none; }
.tg-shopswitch > summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tg-shopswitch > summary svg { flex: none; width: 20px; height: 20px; color: var(--ui-muted); }
.tg-shopswitch > summary:hover, .tg-shopswitch[open] > summary { background: var(--ui-tonal); }
.tg-shop-menu { position: absolute; left: 0; top: 52px; z-index: 40; width: 340px; max-width: calc(100vw - 32px);
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 16px; box-shadow: 0 8px 28px rgba(28, 26, 41, .2);
  padding: 8px 0 4px; }
.tg-shop-menu-head { padding: 6px 16px 8px; font-size: 12px; font-weight: 500; color: var(--ui-muted); }
.tg-shop-menu form { margin: 0; }
.tg-shop-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0;
  background: var(--ui-surface); color: var(--ui-ink); font: inherit; text-align: left; }
.tg-shop-pick:hover { background: var(--ui-soft); }
.tg-shop-pick[aria-current="true"] { background: #f7f5fc; }
.tg-shop-dot { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 18px; color: #fff;
  font-size: 15px; font-weight: 500; background: var(--ui-primary); }
.tg-shop-pick:nth-of-type(6n+2) .tg-shop-dot, form:nth-of-type(6n+2) .tg-shop-dot { background: #2f8a8a; }
form:nth-of-type(6n+3) .tg-shop-dot { background: #b0571b; }
form:nth-of-type(6n+4) .tg-shop-dot { background: #3d6fb6; }
.tg-shop-pick-name { display: block; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-shop-pick-role { display: block; font-size: 13px; color: var(--ui-muted); }
.tg-shop-pick .tg-tick { flex: none; width: 20px; height: 20px; margin-left: auto; color: var(--ui-primary); }
a.tg-shop-add { text-decoration: none; color: var(--ui-link); }
a.tg-shop-add .tg-shop-dot { background: var(--ui-tonal); color: var(--ui-on-tonal); font-size: 20px; }
.tg-shop-menu-note { margin: 4px 0 0; padding: 10px 16px 8px; border-top: 1px solid var(--ui-rule); font-size: 12px; color: var(--ui-muted); }

/* The plan banner, under the bar: a strip across the window, its button at the end
   (the canvas's PlanBanner); on phones the button is a bold link at the end of the text. */
.tg-plan-banner { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 8px 24px; border: 0;
  border-radius: 0; font-size: 14px; line-height: 1.4; background: var(--ui-tonal); color: var(--ui-on-tonal); }
.tg-plan-banner svg { flex: none; width: 20px; height: 20px; }
.tg-plan-banner > span { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tg-plan-banner.is-info { background: var(--ui-tonal); color: var(--ui-on-tonal); }
.tg-plan-banner.is-warn { background: var(--ui-warn-bg); color: #4d3200; }
.tg-plan-banner.is-danger { background: var(--ui-bad-bg); color: var(--ui-bad); }
.tg-plan-banner-link { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 18px;
  background: #fff; color: inherit; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tg-plan-banner-link:hover { background: rgba(255, 255, 255, .7); color: inherit; }
@media (max-width: 767.98px) {
  .tg-plan-banner { align-items: flex-start; gap: 10px; }
  .tg-plan-banner svg { width: 18px; height: 18px; margin-top: 1px; }
  .tg-plan-banner > span { display: block; }
  .tg-plan-banner-link, .tg-plan-banner-link:hover { display: inline; min-height: 0; padding: 0; background: none; font-weight: 700;
    text-decoration: underline; }
}

/* The menu and the page beside it. */
.tg-shell-row { flex: 1 1 auto; display: flex; align-items: flex-start; min-width: 0; }
.tg-side { display: flex; flex-direction: column; background: var(--ui-bg); color: var(--ui-ink); }
.tg-side-head { display: none; }
.tg-side-nav, .tg-side-foot { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; border: 0; }
.tg-side-nav { flex: none; }
.tg-side-rule { height: 1px; margin: 12px 28px; background: #ddd8ea; }
.tg-side-foot form { margin: 0; }
.tg-side-link { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 44px; padding: 0 16px; border: 0;
  border-radius: 22px; background: transparent; color: #3d3a50; font: 500 14px/1.2 var(--ui-font); text-align: left;
  text-decoration: none; }
.tg-side-link svg { flex: none; width: 22px; height: 22px; }
.tg-side-link:hover, .tg-side-link:focus-visible { background: rgba(91, 63, 214, .08); color: var(--ui-ink); }
.tg-side-link[aria-current="page"] { background: var(--ui-tonal); color: var(--ui-on-tonal); font-weight: 700; }
.tg-side-who { margin: 16px 28px 24px; font-size: 12px; line-height: 1.5; color: var(--ui-muted); overflow-wrap: anywhere; }
.tg-install-tip { margin: 0 16px 8px; font-size: 13px; color: var(--ui-muted); }
.tg-side-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(28, 26, 41, .42); }
.tg-page { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* width: auto, not 100%: the panel's side margins would push it past the window's edge. */
.tg-frame { width: auto; max-width: none; margin-inline: 0; padding-inline: 0; }
/* The page: a white panel beside the menu. */
.tg-main { background: var(--ui-surface); border-radius: var(--ui-radius); margin: 0 16px 16px 0; padding: 24px 32px 40px;
  min-height: calc(100vh - var(--tg-bar-h) - 16px); }
.tg-main > .tg-crumbs:first-child, .tg-main > :first-child { margin-top: 0; }
.tg-crumbs { font-size: 13px; color: var(--ui-muted); margin-bottom: 8px; }
.tg-crumbs a { color: var(--ui-link); text-decoration: none; }
.tg-title, .tg-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }

@media (min-width: 992px) {
  .tg-side { position: sticky; top: var(--tg-bar-h); align-self: flex-start; flex: 0 0 var(--tg-side-w); width: var(--tg-side-w);
    max-height: calc(100vh - var(--tg-bar-h)); overflow-y: auto; border: 0; padding-top: 4px; }
  .tg-side-close, .tg-side-backdrop { display: none; }
  /* Small (☰): the pages from Home to How to Use as icons over their names; the rest
     (Help, My account, Sign out…) waits for the full menu. */
  .tg-shell.is-menu-small .tg-side { flex-basis: 80px; width: 80px; padding: 4px 0 16px; }
  .tg-shell.is-menu-small .tg-side-nav { align-items: center; gap: 4px; padding: 0 4px; }
  .tg-shell.is-menu-small .tg-side-link { flex-direction: column; gap: 4px; width: 72px; min-height: 0; padding: 4px 0 8px;
    border-radius: 0; background: none; color: #3d3a50; font-size: 12px; font-weight: 500; text-align: center;
    overflow-wrap: anywhere; }
  .tg-shell.is-menu-small .tg-side-link svg { width: 56px; height: 32px; padding: 5px 17px; box-sizing: border-box;
    border-radius: 16px; }
  .tg-shell.is-menu-small .tg-side-link:hover svg { background: rgba(91, 63, 214, .08); }
  .tg-shell.is-menu-small .tg-side-link[aria-current="page"] { background: none; color: var(--ui-ink); }
  .tg-shell.is-menu-small .tg-side-link[aria-current="page"] svg { background: var(--ui-tonal); color: var(--ui-on-tonal); }
  .tg-shell.is-menu-small .tg-side-rule, .tg-shell.is-menu-small .tg-side-foot,
  .tg-shell.is-menu-small .tg-side-who { display: none; }
  /* A window too short for the whole menu scrolls it, with a thin quiet bar. */
  .tg-side { scrollbar-width: thin; scrollbar-color: #d6d0e6 transparent; }
}
/* A laptop's short window: the menu's rows a little closer, so it fits without scrolling. */
@media (min-width: 992px) and (max-height: 860px) {
  .tg-side-link { min-height: 38px; }
  .tg-side-rule { margin: 8px 28px; }
  .tg-side-who { margin: 8px 28px 12px; }
  .tg-shell.is-menu-small .tg-side-nav { gap: 0; }
  .tg-shell.is-menu-small .tg-side-link { padding: 3px 0 6px; }
}
@media (max-width: 991.98px) {
  .tg-side { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(292px, calc(100vw - 56px)); overflow-y: auto;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border-radius: 0 16px 16px 0; background: var(--ui-bg);
    box-shadow: 0 8px 32px rgba(28, 26, 41, .28); transform: translateX(-100%); visibility: hidden;
    transition: transform .18s ease-out, visibility 0s linear .18s; }
  .tg-side.is-open { transform: none; visibility: visible; transition: transform .18s ease-out; }
  .tg-side-head { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 8px 0 24px; }
  .tg-side-head .tg-brand { gap: 8px; color: var(--ui-ink); font-size: 20px; font-weight: 500; }
  .tg-side-head .tg-brand .tg-mark { width: 28px; height: 28px; color: var(--ui-primary); }
  .tg-side-head .tg-brand span { color: var(--ui-ink); }
  .tg-main { margin: 0 8px 8px; padding: 20px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { .tg-side, .tg-side.is-open { transition: none; } }

/* Phones: ☰ and the shop's name on top, the tab bar at the bottom. */
@media (max-width: 767.98px) {
  .tg-appbar { padding-top: env(safe-area-inset-top); }
  .tg-appbar-row { min-height: 56px; padding: 0 8px 0 4px; gap: 2px; }
  .tg-appbar-start { flex: none; }
  .tg-appbar .tg-brand, .tg-appbar-sep, .tg-quick { display: none; }
  .tg-shopswitch, .tg-appbar-row > .tg-shop-name { flex: 1 1 auto; }
  /* The list of shops spans the screen, under the bar, rather than starting at the name and
     running off the right edge. */
  .tg-shop-menu { position: fixed; left: 12px; right: 12px; top: calc(56px + env(safe-area-inset-top)); width: auto; max-width: none; }
  /* A folded section's heading is a whole row to tap. */
  .tg-main details > summary { padding-block: 12px; }
  .tg-plan-banner { margin: 0; border-radius: 0; padding: 10px 16px; font-size: 13px; }
  .tg-main { margin: 0; border-radius: 0; min-height: 0; padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); background: var(--ui-bg); }
  .tg-h1 { font-size: 24px; }
}
.tg-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--ui-bg); border-top: 1px solid var(--ui-line); box-shadow: none;
  padding: 6px env(safe-area-inset-right) calc(10px + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
.tg-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 2px; font-size: 12px;
  font-weight: 500; color: var(--ui-muted); text-decoration: none; }
.tg-tab svg { width: 24px; height: 24px; padding: 4px 20px; box-sizing: content-box; border-radius: 16px; }
.tg-tab[aria-current="page"] { color: var(--ui-on-tonal); font-weight: 700; }
.tg-tab[aria-current="page"] svg { background: var(--ui-tonal); }
@media (min-width: 768px) { .tg-tabbar { display: none; } }
@media print { .tg-appbar, .tg-side, .tg-tabbar, .tg-plan-banner { display: none !important; } .tg-main { margin: 0; padding: 0; } }

/* Signing in and other pages without the menu: one card in the middle. */
.tg-auth { background: var(--ui-bg); }
.tg-auth .tg-card { border-radius: 24px; padding: 28px; max-width: 420px; }
.tg-auth h1 { font-size: 24px; font-weight: 400; }
.tg-auth .tg-brand { color: var(--ui-ink); font-size: 22px; font-weight: 500; }
.tg-auth .tg-brand .tg-mark { color: var(--ui-primary); }

/* Print, in place (print-here.js): what's printed is copied onto a sheet kept off screen, and
   printing shows that sheet alone, at its paper's width. How it went shows by the button. */
.tg-print-here { position: fixed; left: -10000px; top: 0; }
@media print {
  html.tg-printing body > :not(.tg-print-here), html.tg-printing dialog { display: none !important; }
  html.tg-printing .tg-print-here { position: static; }
  html.tg-printing .tg-print-here .tg-receipt-sheet { margin: 0; box-shadow: none; }
}
.ui-print-say { margin: 8px 0 0; font-size: 13px; color: var(--ui-muted); }
.ui-print-say.is-ok { color: var(--ui-ok); font-weight: 500; }
.ui-print-say.is-err { color: var(--ui-error); }
.ui-print-act { min-height: 32px; padding: 0 2px; border: 0; background: none; color: var(--ui-link); font: inherit; font-weight: 500;
  text-decoration: underline; cursor: pointer; }

/* Online orders waiting, next to its menu item (tagiora/orders). */
.tg-side-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #5b3fd6; color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
