/* ===== AgenX App Shell ===== */

/*
 * ‼ THE SHELL LAYS ITSELF OUT. IT DOES NOT BORROW A RESET FROM A CDN.
 *
 * This file had no box-sizing rule at all, and `#page-content` below is
 * `width: 100%` with `padding: 16px 12px`. With the browser default
 * (content-box) the padding is added OUTSIDE the 100%, so the container is 24px
 * wider than its parent at every width. Measured with `npm run walk:phone` on
 * 25 November: #page-content is 398px wide at a 390px viewport, on every screen
 * in the product, and the page runs 16px to 187px past the phone it is on.
 *
 * It looked right in a browser only because Tailwind's preflight sets
 * `box-sizing: border-box` on everything - and Tailwind is fetched from
 * cdn.tailwindcss.com AT RUNTIME. So on a venue's wifi that blocks that CDN,
 * the screens are not merely unstyled: the layout is wrong. That is the
 * "blocked CDN" item in CLAUDE.md's Still open list with a measurement attached,
 * and it is five days before a demo on somebody else's network.
 *
 * On the universal selector rather than on #page-content, so the next container
 * anybody adds does not have to find this out again.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --sidebar-w: 264px;
}

/*
 * ‼ THE WIDE-TABLE SCROLLER, DEFINED HERE AS WELL AS IN TAILWIND.
 *
 * `overflow-x-auto` is a Tailwind utility, and Tailwind is fetched from
 * cdn.tailwindcss.com at runtime. Measured on 25 November with
 * `npm run walk:phone` in a container with no egress to that CDN: the team
 * table sits inside a `<div class="overflow-x-auto">`, exactly as every table
 * in purchases.js does, and it still painted 536px wide at a 390px viewport
 * with `right: 577` - because the class had no definition at all. With
 * `body { overflow-x: hidden }` below, that is not a sideways scroll. It is a
 * CLIP, and the last column of that table is the row's own Edit control.
 *
 * So the property that decides whether a control can be REACHED was being
 * served from a third party. Same shape as the box-sizing rule above and a
 * worse consequence: a layout that is merely ugly without the CDN is one thing,
 * a layout that hides the button is another.
 *
 * The declaration is identical to Tailwind's own, so nothing changes when the
 * CDN does answer. It is here so that something still works when it does not.
 */
.overflow-x-auto {
  overflow-x: auto;
}

html, body { height: 100%; }
body { overflow-x: hidden; }

#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f9f7ff 100%);
  border-right: 1px solid #eeebfb;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.25s ease;
}
#sidebar .brand {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid #eeebfb;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #1e293b;
}
#sidebar nav { padding: 14px 12px 24px; }
#sidebar .nav-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a68ce5;
  padding: 16px 12px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.nav-link i { width: 18px; text-align: center; color: #a68ce5; font-size: 14px; }
.nav-link:hover { background: #f7f6fd; color: #5d38a1; }
.nav-link.active { background: linear-gradient(90deg, #eeebfb, #e3f2ff); color: #5d38a1; box-shadow: inset 0 0 0 1px #dcd5f6; }
.nav-link.active i { color: #7247c4; }
/* A screen that lives under the entry above it (Phase 1: Holo-Menu under Online
   Ordering). Indented, and otherwise the same link, 44px tap target included. */
.nav-link-child { margin-left: 18px; }

/* ---- Main area ---- */
#main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#topbar {
  height: 72px;
  border-bottom: 1px solid #eeebfb;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}
/* ‼ KAN-510. THE CURSOR MOVED OFF THIS RULE AND ON TO THE CONTROL.
   `.selector` is shared by `<select id="branch-select">`, which is a control,
   and `<div id="signed-in-as">`, which shell.js fills with "Name (role)" and
   binds nothing to. `cursor: pointer` here therefore styled the one element in
   the topbar that does nothing as the thing most likely to be pressed: a
   bordered box in the corner where every other application puts the account
   menu.

   Found by the phone walk, and not as a size: it reported `#signed-in-as
   216x31` under SMALL TAP on all twenty-one screens, because the walk counts
   anything with a pointer cursor as a control. That is the right rule and it
   is what made this visible.

   The box styling stays on both - pairing the name with the branch picker is
   deliberate, and the pairing is not what lied. An account menu is a feature
   and belongs to whoever decides what goes in it; a cursor that promises one
   is a defect today, on a phone where there is no hover to learn the truth
   from. */
#topbar .selector {
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid #dcd5f6;
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  color: #4c2f81;
}
#topbar select.selector { cursor: pointer; }
#page-content { padding: 28px 28px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
/* KAN-448. This rule had no phone companion anywhere in the file, so a 360px
   screen spent 56px - over 15% of the viewport - on empty margin, and every
   page in the app inherited it. 12px is the standard phone gutter. */
@media (max-width: 640px) {
  #page-content { padding: 16px 12px 48px; }
}

/* mobile sidebar toggle */
#sidebar-toggle { display: none; }
#sidebar-backdrop { display: none; }

/* ‼ KAN-448. 1023.98px, NOT 900px.
   Tailwind's `lg:` is 1024px and every page's grid is written against it. At
   900 the band from 900 to 1024 got a permanently visible sidebar BESIDE
   phone-width one-column grids - the worst of both layouts, on exactly the
   width a tablet in landscape reports. One number, so the CSS and the classes
   agree about where "desktop" starts. */
@media (max-width: 1023.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.25); }
  #main-area { margin-left: 0; }
  /* ‼ KAN-509. THE ONLY WAY TO THE NAVIGATION ON A PHONE, AND IT WAS THE
     SMALLEST BUTTON IN THE APPLICATION. `.vx-btn-sm` is `padding: 5px 10px`
     with no minimum of any kind, and this button wraps nothing but an `<i>`,
     so its whole size was a glyph plus 10px of padding and 2px of border -
     about 32 x 26 once the icon font loads, and 22 x 12 in the gate container
     where the CDN is blocked. Apple asks 44, Android 48, WCAG 2.2's floor is
     24.

     A DECLARED MINIMUM ALSO MAKES THE MEASUREMENT HONEST: the box is 44px
     whether or not the icon font arrives, so the phone walk can check it in a
     container with no egress, which it could not do while the size came from
     a glyph.

     Mobile only, inside this media query. The same minimum on `.vx-btn` would
     re-space fourteen dense desktop screens, and that is a design decision
     rather than a defect fix. */
  #sidebar-toggle {
    display: inline-flex;
    min-width: 44px; min-height: 44px;
    justify-content: center;
  }
  /* Pressed rarely and therefore badly placed: a 26px control at the top of the
     page is the one people hit by accident and cannot hit on purpose. */
  #sign-out { min-height: 44px; justify-content: center; }

  /* ‼ AND EVERY ROW CONTROL, because the shell was only the half that showed
     up on all twenty-one screens. `.vx-btn-sm` is a 13px line in 5px of
     padding inside a 1px border: 26px tall, measured, and that figure does
     NOT depend on the icon font - the phone walk reported `#team-edit-2
     99x26` with the CDN blocked, and the text sets the line height either
     way. Forty-nine of them on the team screen alone.

     Still mobile only: below 1024px there are no dense desktop grids to
     re-space, which is the objection that keeps this out of `.vx-btn-sm`
     itself. Rows get taller on a phone, which is the point.

     Checked rather than assumed: the phone walk was re-run across all
     twenty-one screens after this, and every one still reports FITS at 390px.
     A 44px minimum on three buttons in a row is exactly the change that could
     have pushed a table past the viewport.

     ‼ ON `.vx-btn`, NOT ON `.vx-btn-sm`. The first version of this rule said
     `.vx-btn-sm` and the walk immediately found what it missed: `#chat-send`
     and `#advisor-send` are `.vx-btn.vx-btn-primary` wrapping nothing but an
     icon - the send button of both chat panels - and they are not `-sm`, so a
     rule scoped to the small variant left the one control on those screens
     under the bar. `.vx-btn` covers both variants, and a large button already
     taller than 44px is unaffected by a minimum of 44px.

     ‼ AND `min-width` AS WELL, because the height fix made the walk report
     `button 22x44` four times on the receiving list: an icon-only button's
     width is its glyph plus 20px of padding, about 32px once the font loads
     and 22px with the font blocked. A 44px-tall sliver 32px wide is still a
     miss on a thumb. Text buttons are already wider than 44px, so the
     minimum does nothing to them - and the walk was re-run after this too,
     because four 44px-wide buttons in one table row is exactly what could
     push a table past the viewport. Every screen still FITS. */
  .vx-btn { min-height: 44px; min-width: 44px; }

  /* ‼ KAN-518. AND EVERY ROW OF THE DRAWER, which is the control a phone user
     touches first and most. `.nav-link` is `padding: 10px 12px` around a
     13.5px line: 36px tall, measured, and the figure does not depend on the
     icon font because the padding and the type size are both declared here.
     Twenty-odd of them stacked 2px apart in the only navigation a phone has,
     every one of them 8px under the guidance - and stacked targets that small
     are mis-tapped as well as missed.

     The desktop sidebar keeps 36px: it is a mouse, and the drawer is not on
     screen there at all. The drawer scrolls, so the extra 160px costs a
     gesture nobody notices and no layout anywhere. */
  .nav-link { min-height: 44px; }

  /* ‼ AND THE THREE RULES THAT COVER EVERYTHING ELSE. With the drawer fixed,
     the walk's remaining findings at 390px were not twenty defects but three
     declarations, each 6 to 12 pixels under the guidance across the whole
     product:

       .vx-input / .vx-select / textarea   9px padding on a 13.5px line  = 37px
       .vx-tab                            10px padding on a 13px line    = 38px
       #topbar .selector (the branch pick) 7px padding on a 12.5px line   = 32px

     None of those figures depends on the icon font: the padding and the type
     sizes are all declared in this file, so they are the measurement and not a
     floor. Every one is a control somebody types into or taps on a phone.

     Taller fields and tabs cost vertical space, which on a phone is the right
     trade and is why these are inside the media query. `.vx-tabs` is already a
     horizontal scroller, so a taller tab changes nothing about the row. The
     21-screen walk was re-run after this: 42 of 42 still FITS. */
  .vx-input, .vx-select, textarea.vx-input { min-height: 44px; }
  .vx-tab { min-height: 44px; display: flex; align-items: center; }
  #topbar .selector { min-height: 44px; }

  /* The drawer used to slide over live content with nothing but a shadow, so
     tapping the page behind it did nothing - and on a phone the drawer covers
     most of the screen, so the thing under your thumb was live and invisible.
     The backdrop is the tap target that closes it, and `inert` on #main-area
     (set in shell.js) is what stops focus and pointer events reaching through. */
  #sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 30, 0.45);
    z-index: 39;
  }
  #sidebar-backdrop:not([hidden]) { display: block; }
}

/* ---- Generic components ---- */
.vx-card {
  background: #fff;
  border: 1px solid #eeebfb;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px -4px rgba(122,108,214,0.08);
}
.vx-page-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.5rem; color: #1e293b; }
.vx-page-sub { color: #64748b; font-size: 13.5px; margin-top: 2px; }

.vx-tabs { display: flex; flex-wrap: nowrap; gap: 4px; border-bottom: 1px solid #eeebfb; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
/* KAN-661: no tab bar shows a scrollbar, in any browser. The strip still scrolls by touch until tab-overflow.js has fitted it. */
.vx-tabs::-webkit-scrollbar, .ux-tabbar::-webkit-scrollbar, #hx-tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* The shell's own row is the one seen wherever the new shell is on. */
body.ui-shell.hx #hx-tabs { scrollbar-width: none; -ms-overflow-style: none; }
.vx-tabs [data-overflow], #hx-tabs [data-overflow] { display: none !important; }
.vx-tabs-more {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 10px 14px;
  font-size: 13px; font-weight: 700; color: #94a3b8; background: transparent; border: 0; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.vx-tabs-more[hidden] { display: none; }
.vx-tabs-more:hover, .vx-tabs-more[aria-expanded="true"] { color: #5d38a1; }
.vx-tabs-more:focus-visible, .vx-tabs-menu-item:focus-visible { outline: 2px solid var(--vx-focus-ring); outline-offset: -2px; }
/* A strip that has been fitted holds only what fits, so it does not scroll, and a menu may hang from it. */
.vx-tabs.vx-tabs-fitted, body.ui-shell.hx #hx-tabs.vx-tabs-fitted { position: relative; overflow: visible; }
.vx-tabs-menu {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 80; min-width: 180px; max-width: min(320px, calc(100vw - 16px)); max-height: 60vh; overflow-y: auto;
  padding: 4px; background: #fff; border: 1px solid #eeebfb; border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
.vx-tabs-menu-item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; text-align: start;
  font-size: 13px; font-weight: 700; color: #334155; background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.vx-tabs-menu-item:hover { background: #f4f1fd; color: #5d38a1; }
.vx-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 700; color: #94a3b8; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.vx-tab.active { color: #7247c4; border-color: #7247c4; }
.vx-tab:hover { color: #5d38a1; }

.vx-btn {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; border: none; transition: all 0.15s;
}
.vx-btn-primary { background: linear-gradient(90deg,#3695f0,#7247c4); color: #fff; }
.vx-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.vx-btn-secondary { background: #fff; color: #5d38a1; border: 1px solid #dcd5f6; }
.vx-btn-secondary:hover { border-color: #a68ce5; }
.vx-btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.vx-btn-danger:hover { background: #fee2e2; }
/* Quiet variant. The kitchen card already carries a primary action, so the
   Recipe button has to be reachable without competing with Ready. */
.vx-btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.vx-btn-ghost:hover { background: #f8fafc; color: #475569; }
.vx-btn-sm { padding: 5px 10px; font-size: 12px; }
.vx-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.vx-input, .vx-select, textarea.vx-input {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: 13.5px; color: #1e293b; background: #fff; outline: none; transition: border 0.15s;
}
.vx-input:focus, .vx-select:focus { border-color: #a68ce5; box-shadow: 0 0 0 3px rgba(166,140,229,0.15); }
.vx-label { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 4px; display: block; }

/*
 * KAN-559's one period selector (public/static/lib/period-picker.js). Its
 * layout lives here rather than in Tailwind utilities on the element: the
 * class was written as a hook with `flex flex-wrap items-end gap-2` beside it,
 * which class-sweep refused - a vx- class the CSS never defines renders as
 * nothing, and the next person to read the markup cannot tell which of the two
 * is doing the work. Tailwind also arrives from a CDN (KAN-439), so a selector
 * that depends on it has no layout at all wherever that fetch fails.
 */
.vx-period-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.vx-period-picker label { font-size: 12px; font-weight: 600; color: #475569; }
.vx-period-picker select, .vx-period-picker input[type="date"] { width: auto; }
.vx-period-picker > span { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.vx-period-picker > span[hidden] { display: none; }
.vx-field { margin-bottom: 14px; }

.vx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vx-table th {
  text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: #94a3b8; padding: 8px 12px; border-bottom: 2px solid #f1f5f9;
}
.vx-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.vx-table tr:hover td { background: #fbfaff; }

.vx-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.vx-badge-green { background: #dcfce7; color: #16a34a; }
.vx-badge-amber { background: #fef3c7; color: #d97706; }
.vx-badge-red { background: #fee2e2; color: #dc2626; }
/* Not reported. Deliberately colourless: a number the server did not send must
   not look like a number the server sent, and green would read as "all clear". */
.vx-badge-slate { background: #f1f5f9; color: #64748b; }
.vx-badge-gray { background: #f1f5f9; color: #64748b; }
.vx-badge-blue { background: #dbeafe; color: #2563eb; }
.vx-badge-purple { background: #eeebfb; color: #7247c4; }

/* Connectivity pill (KAN-57). Present in the topbar at all times: an indicator
   that only appears when things break is one nobody thinks to look for. Quiet
   when healthy, and loud enough to catch the eye across a counter when not. */
.vx-conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; user-select: none; }
.vx-conn-green { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.vx-conn-amber { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.vx-conn-red { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.vx-conn-age { font-variant-numeric: tabular-nums; opacity: 0.75; font-weight: 800; }
/* Degraded states pulse; the healthy one must not, or the movement becomes
   part of the furniture and stops meaning anything. */
.vx-conn-amber, .vx-conn-red { animation: vx-conn-pulse 2s ease-in-out infinite; }
@keyframes vx-conn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.68; } }
@media (prefers-reduced-motion: reduce) { .vx-conn-amber, .vx-conn-red { animation: none; } }
/* On a narrow till the word is dropped and the icon plus timer carry it. */
@media (max-width: 640px) { .vx-conn span:not(.vx-conn-age) { display: none; } }

.vx-kpi { background: linear-gradient(135deg,#f7f6fd,#f2f9ff); border: 1px solid #eeebfb; border-radius: 14px; padding: 16px 18px; }
.vx-kpi .val { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.6rem; color: #1e293b; }
.vx-kpi .lbl { font-size: 11.5px; font-weight: 700; color: #7247c4; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

/* Data Upload (W16). The only two pieces of furniture this repository did not
   already have: somewhere to drop a file, and a bar that says how far a long
   write has got. Sized so both work at phone width, which is where the owner
   actually opens the system. */
.vx-dropzone {
  border: 2px dashed #dcd5f6;
  border-radius: 16px;
  background: #fbfaff;
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.vx-dropzone:hover, .vx-dropzone:focus-visible { border-color: #7247c4; background: #f7f6fd; outline: none; }
.vx-dropzone.is-over { border-color: #7247c4; background: #f2ecff; }
.vx-dropzone i { font-size: 26px; color: #a78bfa; display: block; margin-bottom: 8px; }

.vx-progress { height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.vx-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7247c4, #a78bfa);
  border-radius: 999px;
  /* Travels rather than jumps, which is the whole reason the bar is moved in
     place instead of by repainting its card. */
  transition: width 240ms ease;
}

.vx-empty { text-align: center; padding: 40px 20px; color: #64748b; font-size: 13.5px; }
.vx-empty i { font-size: 28px; color: #dcd5f6; margin-bottom: 10px; display: block; }

/* Toast */
#vx-toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.vx-toast {
  min-width: 260px; max-width: 360px; padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.2); animation: vx-toast-in 0.2s ease;
  display: flex; align-items: flex-start; gap: 10px;
}
.vx-toast.success { background: #1e293b; color: #fff; }
.vx-toast.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.vx-toast.info { background: #fff; color: #334155; border: 1px solid #e2e8f0; }
/* A soft warning: the thing happened, and somebody should know it happened.
   Distinct from .error, which means it did not happen. Added for the till's
   "this dish is 86'd and you sold it anyway" warning, which the server has
   always raised and no screen could show. */
.vx-toast.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
@keyframes vx-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Modal */
#vx-terms-backdrop, #vx-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.vx-modal {
  background: #fff; border-radius: 18px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.35);
}
.vx-modal-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.15rem; color: #1e293b; margin-bottom: 16px; }

/* Two-factor step-up.
   Sits above the modal layer (150) and below the toasts (200), because it is
   almost always raised from inside a modal and must not replace it — showModal
   closes whatever is open, which would destroy the operator's work. */
/* A refusal raised from inside an open form. KAN-463.
   Same reason as the MFA overlay below, and the same shape: these boxes live
   inside the New Employee, Bank details and Correct modals, and showModal
   closes whatever is open, which would throw away a half-typed employee.
   Above the modal layer (150), below the toasts (200). */
#vx-notice-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 180;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}

#vx-mfa-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 175;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}

/* POS Terminal */
.pos-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
@media (max-width: 1100px) { .pos-grid { grid-template-columns: 1fr; } }
.menu-item-btn {
  border: 1px solid #eeebfb; border-radius: 14px; padding: 14px 10px; text-align: center; cursor: pointer;
  background: #fff; transition: all 0.15s;
}
.menu-item-btn:hover { border-color: #a68ce5; transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(122,108,214,0.3); }
.kds-ticket { background: #fff; border: 1px solid #eeebfb; border-radius: 14px; padding: 14px; }
.kds-ticket.late { border-color: #fecaca; background: #fff7f7; }
/* KAN-186. Louder per rung, on the card the cook is already reading. Rung 3 is
   a thick border rather than an animation: a flashing kitchen screen is ignored
   within a day and is a hazard beside a fryer. */
.kds-ticket.rung-2 { border-color: #f87171; border-width: 2px; }
.kds-ticket.rung-3 { border-color: #dc2626; border-width: 3px; background: #fef2f2; }
.kds-rung { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; padding: 3px 8px; border-radius: 8px; }
.kds-rung-1 { background: #fef3c7; color: #92400e; }
.kds-rung-2 { background: #fee2e2; color: #b91c1c; }
.kds-rung-3 { background: #dc2626; color: #fff; }

.vx-alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.vx-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.vx-alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.vx-alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
/* Success. The provisioning screen is the first thing that needed one: a
   tenant that was created is the only place in the app where a green banner
   is the honest answer. Palette matches .vx-badge-green. */
.vx-alert-green { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

.vx-chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.vx-chat-bubble.user { background: linear-gradient(90deg,#3695f0,#7247c4); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.vx-chat-bubble.bot { background: #f7f6fd; color: #334155; align-self: flex-start; border-bottom-left-radius: 4px; }

/* ===== Printable documents =====
   A bill goes to an 80mm thermal roll far more often than to A4, so the
   document is sized for the roll and simply centres on a larger sheet.
   Everything else on the page is hidden at print time. */
.vx-doc {
  width: 80mm;
  margin: 0 auto;
  padding: 6mm 4mm;
  background: #fff;
  color: #000;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
}
.vx-doc .doc-brand { text-align: center; margin-bottom: 8px; }
.vx-doc .doc-brand .name { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.vx-doc .doc-brand .meta { font-size: 11px; }
.vx-doc .doc-title {
  text-align: center; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 11px; margin: 8px 0;
  border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 4px 0;
}
.vx-doc .doc-row { display: flex; justify-content: space-between; gap: 8px; }
.vx-doc .doc-row.muted { font-size: 11px; }
.vx-doc .doc-items { margin: 8px 0; border-top: 1px dashed #000; padding-top: 6px; }
.vx-doc .doc-item { margin-bottom: 4px; }
.vx-doc .doc-item .qty { display: inline-block; min-width: 22px; }
.vx-doc .doc-totals { border-top: 1px dashed #000; margin-top: 6px; padding-top: 6px; }
.vx-doc .doc-totals .grand { font-weight: 700; font-size: 14px; border-top: 1px solid #000; margin-top: 4px; padding-top: 4px; }
.vx-doc .doc-foot { text-align: center; margin-top: 10px; font-size: 11px; border-top: 1px dashed #000; padding-top: 6px; }
.vx-doc .doc-note { text-align: center; font-size: 10px; margin-top: 8px; }

/* The kitchen reads across a room, so the docket is large and priceless. */
.vx-doc.ticket { font-size: 14px; }
.vx-doc.ticket .doc-item { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.vx-doc.ticket .station {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid #000; margin: 10px 0 6px;
}

@media print {
  /* Only the document reaches the paper. */
  /* No fade on paper: .vx-btn eases every property, visibility too, so a control could still show. */
  body * { visibility: hidden; transition: none !important; }
  #vx-print-area, #vx-print-area * { visibility: visible; }
  #vx-print-area { position: absolute; inset: 0; margin: 0; }
  #vx-modal-backdrop, #vx-terms-backdrop, #sidebar, #sidebar-backdrop, #topbar, #vx-toast-wrap { display: none !important; }
  .vx-doc { width: auto; max-width: 80mm; box-shadow: none; }
  /* A purchase order goes to a supplier on a page; bills and receipts keep the till’s width. */
  .vx-doc.vx-doc-page { width: 100%; max-width: 190mm; margin: 0 auto; }
  /* printDocument adds its paper to the body: then nothing else may keep its room, or empty pages follow. */
  body:has(> #vx-print-area) > :not(#vx-print-area) { display: none !important; }
  @page { margin: 4mm; }
  /* KAN-585. A browser prints no backgrounds unless asked, so the Executive Dashboard printed
     from the dark theme came out near white on white paper. On paper it is the light theme's
     ink on white, with no dark panel left behind it for a print that does ask for backgrounds.
     The dashboard only, and the dark theme only: other paper prints as before. */
  body[data-ui-theme="dark"]:has(.exec-root) { background: #fff !important; }
  /* The legend's squares are drawn as a background, which paper drops unless the square asks to keep it.
     The dark rule below must leave them alone too, or the lines of a chart cannot be told apart. */
  .exec-root .ux-key { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-ui-theme="dark"] .exec-root,
  body[data-ui-theme="dark"] .exec-root *:not(.ux-key) {
    color: #17132e !important; background-color: transparent !important;
    background-image: none !important; box-shadow: none !important; border-color: #e4e1f4 !important;
  }
  body[data-ui-theme="dark"] .exec-root svg text { fill: #17132e !important; }
}

/* A control that has been pressed and is waiting on the network.
   Feedback within one frame is the whole point: the operator must never be
   left wondering whether the tap registered, because that is when they tap
   again and create a duplicate. */
.is-busy {
  position: relative;
  pointer-events: none;
  opacity: 0.55;
  cursor: progress;
}
.is-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  box-shadow: -11px 0 0 currentColor, 0 0 0 currentColor, 11px 0 0 currentColor;
  animation: ld-busy 0.9s linear infinite;
}
/* Three dots in the text's own colour, each bright in turn (KAN-639). */
@keyframes ld-busy {
  0%, 100% { box-shadow: -11px 0 0 currentColor, 0 0 0 transparent, 11px 0 0 transparent; }
  33% { box-shadow: -11px 0 0 transparent, 0 0 0 currentColor, 11px 0 0 transparent; }
  66% { box-shadow: -11px 0 0 transparent, 0 0 0 transparent, 11px 0 0 currentColor; }
}
@keyframes vx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .is-busy::after { animation: none; }
}

/* The AI call takes seconds on a thinking model. Without this the user sees
   their own message and then nothing at all, presses send again, and pays for
   a second call. The dots say the question was received. */
.vx-chat-bubble.vx-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.vx-chat-bubble.vx-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: vx-typing-dot 1.2s ease-in-out infinite; }
.vx-chat-bubble.vx-typing span:nth-child(2) { animation-delay: .18s; }
.vx-chat-bubble.vx-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes vx-typing-dot { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .vx-chat-bubble.vx-typing span { animation: none; opacity: .6; } }

/* POS floor tile (KAN-116). The tile's colour and border come from the state
   classes on the same element; what belongs here is the shape, because a room
   of tables has to read as a grid of equal cells rather than boxes that grow
   with whatever the order happens to carry. A tile with a clock and a cover
   count would otherwise be taller than the free table beside it.

   `class-sweep` is right to have flagged this even though the tile was never
   actually invisible: the element also carries layout utilities, so it had a
   box. The rule the sweep asks for is the one that makes the boxes agree. */
.vx-floor-tile { display: flex; flex-direction: column; justify-content: center; min-height: 94px; width: 100%; transition: filter 120ms ease, box-shadow 120ms ease; }
.vx-floor-tile[data-order] { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.vx-floor-tile[data-order]:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .vx-floor-tile { transition: none; } }

/* A drillable pivot figure (KAN-117). It is a button for the keyboard and the
   screen reader, and a figure to the eye: a column of buttons styled as
   buttons would read as controls rather than as the numbers they are. The
   dotted underline is the only affordance, which is why it is not removed on
   hover but made solid. */
.vx-pivot-cell { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
/**
 * ‼ KAN-514. THE TILL'S QUANTITY STEPPER, DECLARED HERE RATHER THAN BORROWED.
 *
 * `pos.js` drew these as `w-7 h-7 rounded-lg bg-lilac-50` - 28 x 28, and every
 * pixel of it a Tailwind utility fetched from cdn.tailwindcss.com at runtime.
 * Two problems in one control, and the control is the one a cashier presses
 * most often:
 *
 *   28 x 28 is a finger target on a tablet. Apple asks 44, Android 48, and
 *   WCAG 2.2's floor is 24. `control-class-sweep` found it because it carried
 *   no `vx-` class at all, so KAN-509's 44px minimum on `.vx-btn` could not
 *   reach it.
 *
 *   And with the CDN blocked it had NO size, NO background and NO radius: two
 *   bare glyphs side by side. That is KAN-492's defect exactly - the
 *   application borrowing from a CDN what it never declared itself - and the
 *   six runtime CDNs are still the open risk before 1 December.
 *
 * `#f7f6fd` is the lilac tint this stylesheet already uses for a hover surface
 * (`.nav-link:hover`, `.vx-dropzone:hover`), so the control looks the same as
 * it did and keeps looking that way with no network.
 *
 * `qty-step` stays in the markup as the JavaScript hook - pos.js binds on it -
 * because a class that styles and a class that selects are two jobs, and
 * merging them quietly is how a restyle unbinds a handler.
 */
.vx-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #eeebfb;
  border-radius: 10px;
  background: #f7f6fd;
  color: #475569;
  cursor: pointer;
}
.vx-step:hover { background: #f2ecff; border-color: #a68ce5; }
.vx-step:disabled { opacity: 0.5; cursor: not-allowed; }

/* KAN-512 / KAN-513, Sree's decision of 26 November: the controls that were built from
 * utility classes move into the design system as THREE NEUTRAL components, and every
 * theme (REQ-16, ?theme=a|b|c) restyles them by overriding the custom properties below.
 * Nothing here knows which theme is on: a component that hard-codes a colour is how a
 * control comes to be invisible to the next redesign.
 *
 *   .vx-chip      one of a row of mutually exclusive choices (the period selector)
 *   .vx-icon-btn  a button that is one glyph (remove a line); 44px to hit, small to look at
 *   .vx-link-btn  an action written as text inside a sentence or a card
 *
 * The 44px minimum for a phone is the rule KAN-509 gave `.vx-btn`; these carry it too.
 */
:root {
  --vx-chip-bg: transparent;
  --vx-chip-fg: #64748b;
  --vx-chip-active-bg: #ffffff;
  --vx-chip-active-fg: #6d28d9;
  --vx-chip-radius: 8px;
  --vx-link-fg: #5d38a1;
  --vx-link-fg-hover: #3f2873;
  --vx-icon-fg: #f87171;
  --vx-icon-fg-hover: #dc2626;
  --vx-focus-ring: #7247c4;
}
.vx-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; min-height: 32px; border: 0; border-radius: var(--vx-chip-radius);
  background: var(--vx-chip-bg); color: var(--vx-chip-fg);
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.vx-chip.is-active { background: var(--vx-chip-active-bg); color: var(--vx-chip-active-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.vx-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.vx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0 8px; cursor: pointer;
  color: var(--vx-icon-fg); min-width: 32px; min-height: 32px;
}
.vx-icon-btn:hover { color: var(--vx-icon-fg-hover); }
.vx-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vx-link-btn {
  display: inline; background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--vx-link-fg); font: inherit; font-weight: 700; text-decoration: underline;
}
.vx-link-btn:hover { color: var(--vx-link-fg-hover); }
.vx-link-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vx-chip:focus-visible, .vx-icon-btn:focus-visible, .vx-link-btn:focus-visible {
  outline: 2px solid var(--vx-focus-ring); outline-offset: 2px;
}
@media (max-width: 640px) {
  .vx-chip, .vx-icon-btn { min-height: 44px; min-width: 44px; }
  .vx-link-btn { display: inline-block; min-height: 44px; line-height: 44px; }
}

.vx-pivot-cell:hover { color: #2563eb; }
.vx-pivot-cell:focus-visible { outline: 2px solid #7247c4; outline-offset: 2px; border-radius: 3px; }

/* KAN-524, found by walking the real screens with Tailwind and the icon font LOADED.
   The container walk of 26 November had no route to either CDN, so every screen read
   FITS; with them loaded, every screen is 92px wider than a 390px phone and the page
   drags sideways. The cause is the one element all screens share: the topbar's right
   cluster. The branch picker takes the width of its longest option (204px here), the
   "Name (role)" box another 90, the sign-out button its 44px minimum, and the cluster
   is 398px wide before the 24px gutters. Each is bounded on a phone; the full name
   stays one long-press away in the box's title. */
@media (max-width: 640px) {
  #topbar { padding: 0 12px; gap: 8px; }
  #topbar .selector { min-width: 0; }
  #topbar select.selector { max-width: 110px; text-overflow: ellipsis; }
  #topbar #signed-in-as { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* DESIGN TOKENS (decisions-11). The one place a colour, a space or a radius is
   written for the shared components. Light and calm: white cards on very light
   grey, one accent. A theme restyles every component by overriding these. */
:root {
  --ui-page: #f6f7f9;
  --ui-surface: #ffffff;
  --ui-line: #e5e7eb;
  --ui-ink: #1e293b;
  --ui-muted: #5b6472;
  --ui-accent: var(--vx-focus-ring, #7247c4);
  --ui-on-accent: #ffffff;
  /* The accent for words. A block that changes --ui-accent restates this. */
  --ui-accent-text: var(--ui-accent);
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface));
  /* State colours, each dark enough to read on its own soft tint. */
  --ui-ok: #166534;
  --ui-watch: #92400e;
  --ui-bad: #b91c1c;
  --ui-info: #1e40af;
  /* Chart series. Each is also named in words beside its chart. */
  --ui-series-1: var(--ui-accent);
  --ui-series-2: #0f766e;
  --ui-series-3: #b45309;
  --ui-series-4: #1d4ed8;
  --ui-series-5: #9d174d;
  --ui-series-6: #64748b;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-radius: 12px;
  --ui-radius-sm: 8px;
  --ui-radius-round: 999px;
  --ui-tap: 44px;
  --ui-panel-width: 360px;
}
/* END DESIGN TOKENS */

/* decisions-57: go live is English only. Every control that changes the language, hidden by
   one rule; lib/languages.js marks the page when Arabic is offered again. */
html:not([data-arabic-offered]) :is(#hx-lang, #so-lang, [data-lang], [data-language-chips], [data-ask-language], [data-vis="language"]) {
  display: none !important;
}

/* KAN-577. Everything here is under body.ui-shell (the switch) or is a new
   search class, so with the switch off nothing on any screen changes. */
body.ui-shell #topbar .selector,
body.ui-shell #topbar #sign-out { min-height: 44px; }
body.ui-shell #topbar #ux-search-button { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ux-search-word, .ux-kbd { display: none; }
@media (min-width: 900px) {
  body.ui-shell .ux-search-word { display: inline; }
  body.ui-shell .ux-kbd { display: inline-block; font-size: 10px; border: 1px solid color-mix(in srgb, var(--vx-focus-ring) 25%, transparent); border-radius: 6px; padding: 1px 6px; color: var(--vx-chip-fg); }
}
.ux-found { max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.ux-group { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--vx-chip-fg); margin: 12px 0 4px; }
.ux-results { list-style: none; margin: 0; padding: 0; }
.ux-result { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 8px; border-radius: 10px; }
.ux-result:hover, .ux-result:focus-visible { background: color-mix(in srgb, var(--vx-focus-ring) 10%, transparent); }
.ux-result:focus-visible { outline: 3px solid var(--vx-focus-ring); outline-offset: -3px; }
.ux-result-title { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.ux-result-detail { font-size: 11.5px; color: var(--vx-chip-fg); }
.ux-note { font-size: 12px; color: var(--vx-chip-fg); margin-top: 8px; }
/* KAN-577 phone: the search button is paid for by narrowing the two names. */
@media (max-width: 639px) {
  body.ui-shell #topbar { gap: 8px; }
  body.ui-shell #topbar select.selector { max-width: 84px; }
  body.ui-shell #topbar #signed-in-as { max-width: 46px; }
}.ux-why { display: none; }
body.ui-shell .ux-why { display: block; }
body.ui-shell .ux-why summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--vx-link-fg); }
.ux-why p { font-size: 12px; color: var(--vx-chip-fg); margin: 0 0 6px; }

/* SHARED COMPONENTS (decisions-11), used through lib/command/ui-kit.js. Only
   .ux- classes, so no older screen changes by their being here. */
.ux-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--ui-space-3); margin-block-end: var(--ui-space-4); }
.ux-page-names { min-width: 0; }
.ux-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--ui-ink); }
.ux-sub { font-size: 13px; color: var(--ui-muted); margin-block-start: var(--ui-space-1); }
.ux-actions { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); }

.ux-chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; line-height: 1.4; padding-block: 2px; padding-inline: var(--ui-space-2); border-radius: var(--ui-radius-round); white-space: nowrap; }
.ux-chip-ok { color: var(--ui-ok); background: color-mix(in srgb, var(--ui-ok) 10%, var(--ui-surface)); }
.ux-chip-watch { color: var(--ui-watch); background: color-mix(in srgb, var(--ui-watch) 10%, var(--ui-surface)); }
.ux-chip-bad { color: var(--ui-bad); background: color-mix(in srgb, var(--ui-bad) 10%, var(--ui-surface)); }
.ux-chip-info { color: var(--ui-info); background: color-mix(in srgb, var(--ui-info) 10%, var(--ui-surface)); }
.ux-chip-neutral { color: var(--ui-muted); background: color-mix(in srgb, var(--ui-muted) 10%, var(--ui-surface)); }

.ux-brand-select { width: auto; min-width: 190px; max-width: 100%; }
.ux-guide-steps { list-style: decimal; padding-inline-start: 1.5rem; margin-block-end: var(--ui-space-2); font-size: 13px; }
.ux-guide-steps li { margin-block-end: var(--ui-space-2); }
.ux-scope { font-size: 12px; color: var(--ui-muted); margin-block-end: var(--ui-space-2); }
.ux-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--ui-space-3); margin-block-end: var(--ui-space-4); }
.ux-tile { min-width: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: var(--ui-space-4); }
.ux-tile-label { font-size: 12px; font-weight: 700; color: var(--ui-muted); }
.ux-tile-value { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--ui-ink); margin-block-start: var(--ui-space-1); overflow-wrap: anywhere; }
.ux-tile-chips { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); margin-block-start: var(--ui-space-2); }
.ux-tile-note { font-size: 12px; color: var(--ui-muted); margin-block-start: var(--ui-space-2); }
.ux-tile-why summary { min-height: var(--ui-tap); display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ui-accent-text); }
.ux-tile-why p { font-size: 12px; color: var(--ui-muted); }

.ux-filter { max-width: 320px; min-height: var(--ui-tap); margin-block-end: var(--ui-space-3); }
.ux-table-wrap { overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); }
.ux-table th { text-align: start; color: var(--ui-muted); }
.ux-table td { color: var(--ui-ink); }
.ux-table .ux-end { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ux-no-match { padding: var(--ui-space-4); font-size: 13px; color: var(--ui-muted); }

.ux-state { text-align: center; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding-block: var(--ui-space-6); padding-inline: var(--ui-space-4); }
.ux-state-title { font-weight: 700; font-size: 14px; color: var(--ui-ink); }
.ux-state-text { font-size: 13px; color: var(--ui-muted); margin-block-start: var(--ui-space-1); }
.ux-state-error { border-color: var(--ui-bad); }
.ux-tap { min-height: var(--ui-tap); }
/* Brought into view below the header, which stays at the top of the page. */
.ux-anchor { scroll-margin-top: 150px; }
.ux-preview { display: block; max-width: 100%; height: auto; margin-block-start: var(--ui-space-3); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); }
/* A value not provided: words, smaller than a figure so it is not read as one. */
.ux-missing { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); font-size: 13px; font-weight: 700; color: var(--ui-watch); }
/* Space between blocks, so no screen writes a style attribute. */
.ux-above-sm { margin-block-start: var(--ui-space-2); }
.ux-above { margin-block-start: var(--ui-space-3); }
.ux-below { margin-block-end: var(--ui-space-3); }
.ux-state-retry { margin-block-start: var(--ui-space-3); }

.ux-banner { border: 1px solid currentColor; border-radius: var(--ui-radius-sm); padding: var(--ui-space-3); margin-block-end: var(--ui-space-3); font-size: 13px; font-weight: 700; }
.ux-banner-watch { color: var(--ui-watch); background: color-mix(in srgb, var(--ui-watch) 8%, var(--ui-surface)); }
.ux-banner-bad { color: var(--ui-bad); background: color-mix(in srgb, var(--ui-bad) 8%, var(--ui-surface)); }

.ux-agent-open { min-height: var(--ui-tap); }
.ux-agent { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(var(--ui-panel-width), 100%); overflow-y: auto; z-index: 60; background: var(--ui-surface); border-inline-start: 1px solid var(--ui-line); padding: var(--ui-space-4); }
.ux-agent[hidden] { display: none; }
.ux-agent-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-2); }
.ux-agent-title { font-weight: 800; font-size: 15px; color: var(--ui-ink); }
.ux-agent-body { font-size: 13px; color: var(--ui-ink); }
.ux-agent-part { margin-block-start: var(--ui-space-4); }
.ux-agent-heading { font-size: 12px; font-weight: 800; color: var(--ui-muted); margin-block-end: var(--ui-space-2); }
.ux-agent-list { list-style: none; margin: 0; padding: 0; }
.ux-agent-list li { border-block-end: 1px solid var(--ui-line); padding-block: var(--ui-space-2); }
.ux-agent-reason { display: block; font-size: 12px; color: var(--ui-muted); }
.ux-steps { display: flex; flex-wrap: wrap; gap: var(--ui-space-3); list-style: none; margin-block: 0 var(--ui-space-4); padding: 0; }
.ux-step { display: flex; align-items: center; gap: var(--ui-space-2); font-size: 12.5px; font-weight: 700; color: var(--ui-muted); }
.ux-step-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-round); }
.ux-step.is-current { color: var(--ui-ink); }
.ux-step.is-current .ux-step-n { color: var(--ui-on-accent); background: var(--ui-accent); border-color: var(--ui-accent); }
.ux-step.is-done .ux-step-n { color: var(--ui-ok); border-color: var(--ui-ok); }
.ux-step-label { overflow-wrap: anywhere; }
.ux-wizard, .ux-wizard-body { min-width: 0; }
.ux-wizard-foot { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); margin-block-start: var(--ui-space-4); }
.ux-wizard-next { margin-inline-start: auto; }

.ux-apps-button { display: flex; justify-content: center; margin-block-start: var(--ui-space-3); margin-inline: var(--ui-space-3); }
.ux-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--ui-space-3); }
.ux-app-list { list-style: none; margin: 0; padding: 0; }
.ux-app { display: flex; align-items: center; gap: var(--ui-space-2); min-height: var(--ui-tap); padding-inline: var(--ui-space-2); border-radius: var(--ui-radius-sm); font-size: 13.5px; font-weight: 600; color: var(--ui-ink); }
.ux-app:hover, .ux-app:focus-visible { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
.ux-app:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: -3px; }
.ux-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-3); margin-block-end: var(--ui-space-4); }
@media (min-width: 900px) { .ux-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A page used standing up: every control a thumb's size, at every width. */
.ux-page .vx-card { padding: var(--ui-space-4); min-width: 0; }
.ux-page :is(.vx-btn, .vx-chip, .vx-input, .vx-select, .vx-tab, summary) { min-height: var(--ui-tap); }
.ux-page summary { display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; }
/* A grid or a section that is hidden stays hidden. */
.ux-page .ux-grid[hidden], .ux-page section[hidden] { display: none; }
.ux-page .vx-btn:focus-visible,
.ux-page .vx-chip:focus-visible,
.ux-page .vx-tab:focus-visible,
.ux-page .vx-input:focus-visible,
.ux-page .vx-select:focus-visible,
.ux-page summary:focus-visible,
.ux-page .ux-range:focus-visible,
.ux-page [type="checkbox"]:focus-visible,
.ux-page a:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 2px; }
/* A number broken across lines reads as two numbers. */
.ux-page .p1-kpi .val { overflow-wrap: normal; white-space: nowrap; font-size: clamp(20px, 6vw, 28px); }
@media (max-width: 599px) {
  .ux-page .p1-kpi-row { grid-template-columns: minmax(0, 1fr); }
}

.ux-card-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 14px; color: var(--ui-ink); }
.ux-muted { font-size: 12px; color: var(--ui-muted); margin-block-start: var(--ui-space-1); overflow-wrap: anywhere; }
.ux-fine { font-weight: 400; font-size: 11px; }
.ux-text { font-size: 13px; }
.ux-nowrap { white-space: nowrap; }
.ux-medium { display: flex; align-items: center; gap: var(--ui-space-2); font-size: 20px; }
.ux-big { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 56px; line-height: 1; min-width: 2ch; }
.ux-big-sm { font-size: 36px; }
.ux-headline { display: flex; align-items: center; gap: var(--ui-space-4); }
.ux-stack { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ux-stack .vx-btn { align-self: flex-start; }

.ux-between { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ui-space-3); flex-wrap: wrap; }
.ux-between-center { align-items: center; }
.ux-align-start { align-items: flex-start; }
.ux-split { display: flex; justify-content: space-between; gap: var(--ui-space-3); font-size: 13px; font-weight: 700; }
.ux-gap-v { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); margin-block: var(--ui-space-3); }
.ux-chiprow { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); margin-block-end: var(--ui-space-3); }
.ux-toggles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--ui-space-2); }
.ux-toggles .vx-chip { display: inline-flex; align-items: center; gap: var(--ui-space-2); }
.ux-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ui-space-2); margin-block-end: var(--ui-space-3); }
.ux-filters > div { min-width: 140px; }
.ux-filters[hidden], .ux-filters [hidden] { display: none; }
.ux-tabbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-block-end: var(--ui-space-3); }
.ux-tabbar .vx-tab { flex: 0 0 auto; white-space: nowrap; }

.ux-range { width: 100%; height: var(--ui-tap); accent-color: var(--ui-accent); }
.ux-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ui-space-2); }
@media (min-width: 600px) { .ux-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ux-option { justify-content: center; text-align: center; }
.ux-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-3); margin-block-start: var(--ui-space-3); }
.ux-fields[hidden] { display: none; }
@media (min-width: 600px) { .ux-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.ux-list { list-style: none; margin: 0; padding: 0; }
.ux-list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ui-space-2); padding-block: var(--ui-space-3); border-block-start: 1px solid var(--ui-line); }
.ux-list-main { flex: 1 1 220px; min-width: 0; font-size: 13px; }
.ux-list-item { padding-block: var(--ui-space-3); border-block-start: 1px solid var(--ui-line); }
.ux-list-item .vx-btn { margin-block-start: var(--ui-space-2); }
.ux-bullets { font-size: 12px; color: var(--ui-muted); padding-inline-start: var(--ui-space-5); list-style: disc; }

.ux-scroll { max-height: 320px; overflow: auto; }
.ux-scroll td { white-space: nowrap; }
/* A small bar chart. The stroke widths are the drawing's geometry. */
.ux-trend { width: 100%; height: 160px; display: block; margin-block-start: var(--ui-space-3); }
.ux-trend-bar { fill: var(--ui-accent); }
.ux-trend-base { stroke: var(--ui-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ux-trend-critical { stroke: var(--ui-bad); stroke-width: 8px; stroke-linecap: round; }
.ux-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ui-muted); }
/* Charts (lib/command/ui-charts.js). Stroke widths are the drawing's geometry. */
.ux-chart { margin: 0; min-width: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: var(--ui-space-4); }
.ux-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ui-space-2); margin-block-end: var(--ui-space-3); }
.ux-chart-title { font-weight: 800; font-size: 13.5px; color: var(--ui-ink); }
.ux-chart-none { font-weight: 700; font-size: 14px; color: var(--ui-muted); }
.ux-chart-figure { text-align: center; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--ui-ink); overflow-wrap: anywhere; }
.ux-chart-svg { display: block; width: 100%; }
.ux-chart-time { height: 160px; }
.ux-chart-time:where([dir="rtl"] *) { transform: scaleX(-1); }
.ux-chart-axis { display: flex; justify-content: space-between; gap: var(--ui-space-2); font-size: 11px; color: var(--ui-muted); margin-block-start: var(--ui-space-1); }
.ux-chart-data summary { min-height: var(--ui-tap); display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ui-accent-text); }
.ux-ring { position: relative; max-width: 180px; margin-inline: auto; }
.ux-ring-track { stroke: var(--ui-line); stroke-width: 4; }
.ux-ring-value { stroke: var(--ui-accent); stroke-width: 4; }
.ux-ring-figure { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--ui-ink); }
.ux-gauge { max-width: 280px; margin-inline: auto; }
.ux-gauge-track { stroke: var(--ui-line); stroke-width: 9; }
.ux-gauge-value { stroke: var(--ui-accent); stroke-width: 9; }
.ux-gauge-mark { stroke-width: 1.6; }
.ux-mark-no_loss { stroke: var(--ui-watch); }
.ux-mark-recovery { stroke: var(--ui-ok); }
.ux-gauge-list { display: grid; gap: var(--ui-space-1); margin-block: var(--ui-space-3) 0; font-size: 13px; }
.ux-gauge-list div { display: flex; justify-content: space-between; gap: var(--ui-space-2); }
.ux-gauge-list dt { color: var(--ui-muted); }
.ux-gauge-list dd { margin: 0; font-weight: 700; color: var(--ui-ink); }
.ux-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: var(--ui-space-2); background: var(--ui-series-6); }
.ux-key-no_loss { background: var(--ui-watch); }
.ux-key-recovery { background: var(--ui-ok); }
.ux-key-target { background: var(--ui-watch); }
.ux-bar-profit { fill: var(--ui-ok); }
.ux-bar-loss { fill: var(--ui-bad); }
.ux-chart-zero { stroke: var(--ui-muted); stroke-width: 1; }
.ux-chart-target { stroke: var(--ui-watch); stroke-width: 2px; stroke-dasharray: 6 4; }
.ux-band-range { fill: var(--ui-accent-soft); }
.ux-band-mid { stroke: var(--ui-accent); stroke-width: 2px; }
.ux-band-single { stroke: var(--ui-accent); stroke-width: 4px; stroke-linecap: round; }
.ux-compare-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ui-space-2); padding-block: var(--ui-space-2); border-block-start: 1px solid var(--ui-line); font-size: 13px; }
.ux-compare-name { flex: 1 1 110px; font-weight: 700; color: var(--ui-ink); }
.ux-compare-now { font-weight: 800; color: var(--ui-ink); white-space: nowrap; }
.ux-compare-before { font-size: 12px; color: var(--ui-muted); white-space: nowrap; }
.ux-donut { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-3); align-items: center; }
.ux-donut .ux-chart-svg { max-width: 180px; margin-inline: auto; }
@media (min-width: 600px) { .ux-donut { grid-template-columns: 180px minmax(0, 1fr); } }
.ux-slice { stroke-width: 6; }
.ux-slice.ux-series-1 { stroke: var(--ui-series-1); }
.ux-slice.ux-series-2 { stroke: var(--ui-series-2); }
.ux-slice.ux-series-3 { stroke: var(--ui-series-3); }
.ux-slice.ux-series-4 { stroke: var(--ui-series-4); }
.ux-slice.ux-series-5 { stroke: var(--ui-series-5); }
.ux-slice.ux-series-6 { stroke: var(--ui-series-6); }
.ux-key.ux-series-1 { background: var(--ui-series-1); }
.ux-key.ux-series-2 { background: var(--ui-series-2); }
.ux-key.ux-series-3 { background: var(--ui-series-3); }
.ux-key.ux-series-4 { background: var(--ui-series-4); }
.ux-key.ux-series-5 { background: var(--ui-series-5); }
.ux-key.ux-series-6 { background: var(--ui-series-6); }
.ux-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ux-legend li { display: flex; align-items: center; gap: var(--ui-space-2); padding-block: var(--ui-space-1); }
.ux-legend-name { flex: 1; color: var(--ui-ink); }
.ux-legend-value, .ux-legend-share { white-space: nowrap; font-weight: 700; color: var(--ui-ink); }
.ux-days { display: flex; gap: var(--ui-space-2); overflow-x: auto; list-style: none; margin: 0; padding: 0 0 var(--ui-space-2); }
.ux-day { flex: 0 0 140px; border: 1px solid var(--ui-line); border-block-start-width: 4px; border-radius: var(--ui-radius-sm); padding: var(--ui-space-2); font-size: 12px; color: var(--ui-ink); }
.ux-heat-1 { border-block-start-color: var(--ui-series-6); }
.ux-heat-2 { border-block-start-color: var(--ui-watch); }
.ux-heat-3 { border-block-start-color: var(--ui-bad); }
.ux-heat-unknown { border-style: dashed; }
.ux-day-date { display: block; font-weight: 800; }
.ux-day-amount { display: block; font-weight: 700; white-space: nowrap; }
.ux-day-items { list-style: none; margin: 0; padding: 0; color: var(--ui-muted); overflow-wrap: anywhere; }
/* END SHARED COMPONENTS */

/* UI LIGHT LOOK (decisions-11), only with the ui_shell switch on. Colour, line,
   radius and shadow only: no size on an older screen changes. */
body.ui-shell { background: var(--ui-page); color: var(--ui-ink); }
body.ui-shell #sidebar { background: var(--ui-surface); border-color: var(--ui-line); }
body.ui-shell #sidebar .brand { border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell #sidebar .nav-section-label { color: var(--ui-muted); }
body.ui-shell .nav-link i { color: var(--ui-muted); }
body.ui-shell .nav-link:hover { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
body.ui-shell .nav-link.active { background: var(--ui-accent-soft); color: var(--ui-accent-text); box-shadow: none; }
body.ui-shell .nav-link.active i { color: var(--ui-accent-text); }
body.ui-shell #topbar { background: var(--ui-surface); border-color: var(--ui-line); backdrop-filter: none; }
body.ui-shell #topbar .selector { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell .vx-page-title { color: var(--ui-ink); }
body.ui-shell .vx-page-sub { color: var(--ui-muted); }
body.ui-shell .vx-card { background: var(--ui-surface); border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: none; }
body.ui-shell .vx-kpi { background: var(--ui-surface); border-color: var(--ui-line); border-radius: var(--ui-radius); }
body.ui-shell .vx-kpi .val { color: var(--ui-ink); }
body.ui-shell .vx-kpi .lbl { color: var(--ui-muted); }
body.ui-shell .vx-tabs { border-color: var(--ui-line); }
body.ui-shell .vx-tabs-more { color: var(--ui-muted); }
body.ui-shell .vx-tabs-more:hover, body.ui-shell .vx-tabs-more[aria-expanded="true"] { color: var(--ui-accent-text); }
body.ui-shell .vx-tabs-menu { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell .vx-tabs-menu-item { color: var(--ui-ink); }
body.ui-shell .vx-tabs-menu-item:hover { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
body.ui-shell .vx-tab { color: var(--ui-muted); }
body.ui-shell .vx-tab.active { color: var(--ui-accent-text); border-color: var(--ui-accent); }
body.ui-shell .vx-btn-primary { background: var(--ui-accent); color: var(--ui-on-accent); }
body.ui-shell .vx-btn-secondary { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-accent-text); }
body.ui-shell .vx-input, body.ui-shell .vx-select { border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell .vx-table th { color: var(--ui-muted); border-color: var(--ui-line); }
body.ui-shell .vx-table td { color: var(--ui-ink); border-color: var(--ui-line); }
/* The older badges and quiet text, which fall under 4.5 to 1, in the token
   colours. A badge that means "not reported" stays colourless. */
body.ui-shell .vx-badge-green { color: var(--ui-ok); background: color-mix(in srgb, var(--ui-ok) 10%, var(--ui-surface)); }
body.ui-shell .vx-badge-amber { color: var(--ui-watch); background: color-mix(in srgb, var(--ui-watch) 10%, var(--ui-surface)); }
body.ui-shell .vx-badge-red { color: var(--ui-bad); background: color-mix(in srgb, var(--ui-bad) 10%, var(--ui-surface)); }
body.ui-shell .vx-badge-blue { color: var(--ui-info); background: color-mix(in srgb, var(--ui-info) 10%, var(--ui-surface)); }
body.ui-shell .vx-badge-slate { color: var(--ui-muted); background: color-mix(in srgb, var(--ui-muted) 10%, var(--ui-surface)); }
body.ui-shell .vx-badge-gray { color: var(--ui-muted); background: color-mix(in srgb, var(--ui-muted) 10%, var(--ui-surface)); }
body.ui-shell .vx-empty { color: var(--ui-muted); }
/* END UI LIGHT LOOK */

/* ===== KAN-577 APP SHELL (the 27 November UI spec) =====
   Only under body.ui-shell.hx, which lib/command/hx-shell.js sets with the ui_shell
   switch on. With it off, nothing below matches anything. */

/* DIRECTION A (KAN-640, decisions-59): deep indigo and violet. Light is the
   default. Green is for profit and red for loss: a "done" status is violet here,
   never green. --ui-profit and --ui-loss are the exact pair, for bars, dots and
   edges. --ui-ok and --ui-bad are the same two for WORDS, shaded only as far as
   4.5 to 1 needs on a card, a chip and a glass tile. --ui-accent fills;
   --ui-accent-text is the accent for words. */
body.ui-shell.hx {
  --ui-page: #f6f5fb;
  --ui-surface: #ffffff;
  --ui-line: #e4e1f4;
  --ui-ink: #17132e;
  --ui-muted: #5b5680;
  --ui-accent: #7c3aed;
  --ui-accent-text: #6d28d9;
  --ui-on-accent: #ffffff;
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface));
  --ui-done: #5b21b6;
  --ui-profit: #0a8a55;
  --ui-loss: #d42f32;
  --ui-ok: #067647;
  --ui-watch: #92400e;
  --ui-bad: #bf2427;
  --ui-info: #1e40af;
  --ui-tint: 6%;
  /* Restated here: a series set only at the root is worked out there, and kept the old accent. */
  --ui-series-1: var(--ui-accent);
  --ui-series-2: #06b6d4;
  --ui-series-3: #b45309;
  --ui-series-4: #1d4ed8;
  --ui-series-5: #be185d;
  --ui-series-6: #94a3b8;
  /* Glass: a tint, a rim and a gloss over the top. */
  --ui-tile: rgba(124, 58, 237, 0);
  --ui-rim: rgba(124, 58, 237, 0.2);
  --ui-gloss: rgba(124, 58, 237, 0.06);
  --ui-shadow: 0 8px 24px -16px rgba(23, 19, 46, 0.25);
  --vx-focus-ring: #7c3aed;
  --vx-link-fg: #6d28d9;
  --vx-link-fg-hover: #4c1d95;
  --vx-chip-active-fg: #6d28d9;
  --vx-chip-fg: #5b5680;
  --sidebar-w: 232px;
  background: var(--ui-page);
}
body.ui-shell.hx[data-ui-theme="dark"] {
  --ui-page: #0c0a1c;
  --ui-surface: #1a1536;
  --ui-line: #2f2760;
  --ui-ink: #eceaff;
  --ui-muted: #9b97c7;
  --ui-accent: #8b5cf6;
  --ui-accent-text: #c4b5fd;
  --ui-on-accent: #13081f;
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 16%, var(--ui-surface));
  --ui-done: #c4b5fd;
  --ui-profit: #16c784;
  --ui-loss: #f0484a;
  --ui-ok: #16c784;
  --ui-watch: #f0b429;
  --ui-bad: #ff7476;
  --ui-info: #93c5fd;
  --ui-tint: 4%;
  --ui-series-1: var(--ui-accent);
  --ui-series-2: #67e8f9;
  --ui-series-3: #f0b429;
  --ui-series-4: #7aa2f7;
  --ui-series-5: #f472b6;
  --ui-series-6: #94a3b8;
  --ui-tile: rgba(124, 92, 255, 0.1);
  --ui-rim: rgba(150, 124, 255, 0.26);
  --ui-gloss: rgba(168, 142, 255, 0.16);
  --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --vx-focus-ring: #c4b5fd;
  --vx-link-fg: #c4b5fd;
  --vx-link-fg-hover: #ffffff;
  --vx-chip-active-bg: #1a1536;
  --vx-chip-active-fg: #c4b5fd;
  --vx-chip-fg: #9b97c7;
  color-scheme: dark;
  color: var(--ui-ink);
}
/* The top bar and the brand corner stay dark in light too, so the wordmark reads.
   Only their tokens change: everything inside them follows. */
body.ui-shell.hx #topbar, body.ui-shell.hx #sidebar .brand {
  --ui-page: #09071a;
  --ui-surface: #09071a;
  --ui-line: #2a2352;
  --ui-ink: #eceaff;
  --ui-muted: #9b97c7;
  --ui-accent: #8b5cf6;
  --ui-accent-text: #c4b5fd;
  --ui-on-accent: #13081f;
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 16%, var(--ui-surface));
  /* The launcher and the menus open inside the bar: their status words need the dark set. */
  --ui-done: #c4b5fd;
  --ui-profit: #16c784;
  --ui-loss: #f0484a;
  --ui-ok: #16c784;
  --ui-watch: #f0b429;
  --ui-bad: #ff7476;
  --ui-info: #93c5fd;
  --ui-tint: 4%;
  --vx-focus-ring: #c4b5fd;
  --vx-chip-fg: #9b97c7;
  --vx-chip-active-bg: #1a1536;
  --vx-chip-active-fg: #c4b5fd;
  --vx-link-fg: #c4b5fd;
  color: var(--ui-ink);
  color-scheme: dark;
}

/* The launcher and the user menu open inside the dark bar. In light they take the light set back. */
body.ui-shell.hx:not([data-ui-theme="dark"]) #topbar #hx-launcher, body.ui-shell.hx:not([data-ui-theme="dark"]) #topbar .hx-user-menu {
  --ui-page: #f6f5fb;
  --ui-surface: #ffffff;
  --ui-line: #e4e1f4;
  --ui-ink: #17132e;
  --ui-muted: #5b5680;
  --ui-accent: #7c3aed;
  --ui-accent-text: #6d28d9;
  --ui-on-accent: #ffffff;
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface));
  --ui-done: #5b21b6;
  --ui-profit: #0a8a55;
  --ui-loss: #d42f32;
  --ui-ok: #067647;
  --ui-watch: #92400e;
  --ui-bad: #bf2427;
  --ui-info: #1e40af;
  --ui-tint: 6%;
  --vx-focus-ring: #7c3aed;
  --vx-chip-fg: #5b5680;
  --vx-link-fg: #6d28d9;
  --vx-link-fg-hover: #4c1d95;
  --vx-chip-active-fg: #6d28d9;
  --ui-shadow: 0 8px 24px -16px rgba(23, 19, 46, 0.25);
  color: var(--ui-ink);
  color-scheme: light;
}

/* ---- App menu ---- */
body.ui-shell.hx #sidebar { background: var(--ui-surface); border: 0; border-inline-end: 1px solid var(--ui-line); inset-inline-start: 0; inset-inline-end: auto; display: flex; flex-direction: column; overflow: hidden; }
body.ui-shell.hx #sidebar .brand { height: 64px; flex: 0 0 auto; border-color: var(--ui-line); color: var(--ui-ink); background: var(--ui-surface); padding: 0 14px; }
body.ui-shell.hx .hx-brand { display: flex; align-items: center; gap: 10px; color: var(--ui-ink); text-decoration: none; }
body.ui-shell.hx .hx-mark { width: 32px; height: 32px; flex: 0 0 auto; border-radius: var(--ui-radius-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; background: var(--ui-accent); color: var(--ui-on-accent); }
body.ui-shell.hx .hx-brand .hx-mark i { color: inherit; }
body.ui-shell.hx .hx-logo { display: block; width: 131px; height: 30px; }
body.ui-shell.hx .hx-brand .hx-mark { display: none; }
@media (min-width: 1024px) {
  body.ui-shell.hx.hx-mini .hx-logo { display: none; }
  body.ui-shell.hx.hx-mini .hx-brand .hx-mark { display: flex; }
}
body.ui-shell.hx #sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
body.ui-shell.hx .hx-app { display: flex; align-items: center; gap: 12px; min-height: 40px; width: 100%; padding: 6px 10px; margin-block-end: 1px; border: 0; background: transparent; border-radius: var(--ui-radius-sm); font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ui-ink); text-decoration: none; cursor: pointer; text-align: start; }
body.ui-shell.hx .hx-app i { width: 18px; flex: 0 0 18px; text-align: center; color: var(--ui-muted); }
body.ui-shell.hx .hx-app:hover { background: var(--ui-accent-soft); }
body.ui-shell.hx .hx-app.is-current { background: var(--ui-accent-soft); color: var(--ui-accent-text); font-weight: 800; }
body.ui-shell.hx .hx-app.is-current i { color: var(--ui-accent-text); }
body.ui-shell.hx .hx-fold { flex: 0 0 auto; margin: 0; padding-inline: 18px; border-block-start: 1px solid var(--ui-line); border-radius: 0; min-height: 44px; color: var(--ui-muted); }
body.ui-shell.hx .hx-rule { border: 0; border-block-start: 1px solid var(--ui-line); margin: 8px 6px; }
@media (min-width: 1024px) {
  body.ui-shell.hx #main-area { margin: 0; margin-inline-start: var(--sidebar-w); }
  body.ui-shell.hx.hx-mini { --sidebar-w: 64px; }
  body.ui-shell.hx.hx-mini .hx-app-name { display: none; }
  body.ui-shell.hx.hx-mini .hx-fold i { transform: scaleX(-1); }
  body.ui-shell.hx.hx-rtl .hx-fold i { transform: scaleX(-1); }
  body.ui-shell.hx.hx-rtl.hx-mini .hx-fold i { transform: none; }
}
@media (max-width: 1023.98px) {
  body.ui-shell.hx .hx-fold { display: none; }
  body.ui-shell.hx .hx-app { min-height: 44px; }
}

/* ---- Header ---- */
body.ui-shell.hx #topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding: 8px 18px; gap: 8px; background: var(--ui-surface); border-color: var(--ui-line); backdrop-filter: none; }
body.ui-shell.hx #topbar > div { flex-wrap: wrap; min-width: 0; }
body.ui-shell.hx #topbar > div:first-child { flex: 1 1 260px; }
body.ui-shell.hx #topbar > div:first-child > a { display: none; }
body.ui-shell.hx #topbar #ux-search-button { order: 2; flex: 1 1 150px; max-width: 420px; justify-content: flex-start; color: var(--ui-muted); border: 1px solid var(--ui-line); background: var(--ui-page); }
body.ui-shell.hx #topbar #ux-search-button { white-space: nowrap; min-width: 0; }
body.ui-shell.hx #topbar #ux-search-button .ux-search-word { display: inline; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.ui-shell.hx #topbar #ux-search-button .ux-kbd { flex: 0 0 auto; }
body.ui-shell.hx #topbar #ux-search-button .ux-kbd { margin-inline-start: auto; }
body.ui-shell.hx .hx-app-title { order: 1; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 14px; color: var(--ui-ink); }
body.ui-shell.hx .hx-head-group { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
body.ui-shell.hx .hx-head-btn { min-height: 44px; min-width: 44px; justify-content: center; color: var(--ui-ink); border-color: var(--ui-line); padding-inline: 10px; }
body.ui-shell.hx .hx-head-btn:hover { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
body.ui-shell.hx .hx-lang-word { font-size: 12px; font-weight: 800; }
body.ui-shell.hx .hx-updated { font-size: 11.5px; font-weight: 700; color: var(--ui-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
body.ui-shell.hx .hx-updated.is-old { color: var(--ui-watch); }
body.ui-shell.hx #hx-refresh.is-spinning i { animation: vx-spin 0.8s linear infinite; }
body.ui-shell.hx #hx-refresh.is-busy::after { display: none; }
body.ui-shell.hx #topbar .selector { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink); min-height: 44px; }
body.ui-shell.hx #sign-out { min-height: 44px; color: var(--ui-ink); border-color: var(--ui-line); }

/* ---- Horizontal tabs ---- */
body.ui-shell.hx #hx-tabs { display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--ui-surface); border-block-end: 1px solid var(--ui-line); padding-inline: 12px; }
body.ui-shell.hx #hx-tabs[hidden] { display: none; }
body.ui-shell.hx .hx-tab { flex: 0 0 auto; display: flex; align-items: center; min-height: 46px; padding-inline: 14px; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--ui-muted); text-decoration: none; border-block-end: 3px solid transparent; }
body.ui-shell.hx .hx-tab:hover { color: var(--ui-accent-text); }
body.ui-shell.hx .hx-tab.is-current { color: var(--ui-accent-text); border-block-end-color: var(--ui-accent); }

/* ---- Vertical sub-menu inside the tab, content beside it ---- */
body.ui-shell.hx .hx-body { display: grid; grid-template-columns: 196px minmax(0, 1fr); align-items: start; flex: 1; }
body.ui-shell.hx #hx-sub { padding-block: 18px; padding-inline: 14px 0; }
body.ui-shell.hx #hx-sub[hidden] { display: none; }
body.ui-shell.hx #hx-sub[hidden] + .hx-content { grid-column: 1 / -1; }
body.ui-shell.hx .hx-sub-list { list-style: none; margin: 0; padding: 6px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
body.ui-shell.hx .hx-sub-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; padding: 6px 10px; border-radius: var(--ui-radius-sm); font-size: 13px; font-weight: 600; color: var(--ui-ink); text-decoration: none; }
body.ui-shell.hx .hx-sub-item:hover { background: var(--ui-accent-soft); }
body.ui-shell.hx .hx-sub-item.is-current { background: var(--ui-accent-soft); color: var(--ui-accent-text); font-weight: 800; }
body.ui-shell.hx .hx-content { min-width: 0; }
body.ui-shell.hx #page-content { padding: 18px 20px 60px; }
body.ui-shell.hx #hx-stale-note { margin: 14px 20px 0; }
body.ui-shell.hx #page-content.hx-stale { outline: 2px dashed var(--ui-watch); outline-offset: -8px; }
body.ui-shell.hx .vx-tabs.hx-covered { display: none; }
body.ui-shell.hx .hx-app:focus-visible, body.ui-shell.hx .hx-tab:focus-visible, body.ui-shell.hx .hx-sub-item:focus-visible, body.ui-shell.hx .hx-tile:focus-visible, body.ui-shell.hx #hx-user summary:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: -3px; }

/* ---- Launcher: a floating panel at the top right, three tiles to a row ---- */
body.ui-shell.hx #topbar { position: sticky; }
body.ui-shell.hx #hx-launcher { position: absolute; inset-block-start: 100%; inset-inline-end: 12px; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 96px); overflow-y: auto; z-index: 70; padding: var(--ui-space-3); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.35); }
body.ui-shell.hx #hx-launcher[hidden] { display: none; }
body.ui-shell.hx .hx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ui-space-1); }
/* The two dashboards, across the top of the launcher (decisions-55). */
body.ui-shell.hx .hx-dashes { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-2); padding-block-end: var(--ui-space-3); margin-block-end: var(--ui-space-2); border-block-end: 1px solid var(--ui-line); }
body.ui-shell.hx .hx-dash { display: flex; align-items: center; gap: var(--ui-space-3); min-height: var(--ui-tap); padding: 10px 12px; font-size: 13px; font-weight: 800; color: var(--ui-ink); text-decoration: none; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); }
body.ui-shell.hx .hx-dash:hover { background: var(--ui-page); }
body.ui-shell.hx .hx-dash:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: -3px; }
body.ui-shell.hx .hx-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 92px; padding: 12px 4px 8px; text-align: center; font-size: 11.5px; font-weight: 700; line-height: 1.25; color: var(--ui-ink); text-decoration: none; border-radius: var(--ui-radius); }
body.ui-shell.hx .hx-tile:hover { background: var(--ui-page); }
body.ui-shell.hx .hx-tile-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; font-size: 19px; color: var(--hx-tint); background: color-mix(in srgb, var(--hx-tint) 14%, var(--ui-surface)); }
/* Our own pastels. Not green and not red: those mean profit and loss. */
body.ui-shell.hx .hx-tint-teal { --hx-tint: #0f766e; }
body.ui-shell.hx .hx-tint-blue { --hx-tint: #2563eb; }
body.ui-shell.hx .hx-tint-cyan { --hx-tint: #0e7490; }
body.ui-shell.hx .hx-tint-violet { --hx-tint: #6d28d9; }
body.ui-shell.hx .hx-tint-pink { --hx-tint: #be185d; }
body.ui-shell.hx .hx-tint-orange { --hx-tint: #b45309; }
body.ui-shell.hx .hx-tint-slate { --hx-tint: #475569; }
body.ui-shell.hx[data-ui-theme="dark"] .hx-tile-icon { color: color-mix(in srgb, var(--hx-tint) 45%, #ffffff); background: color-mix(in srgb, var(--hx-tint) 32%, var(--ui-surface)); }

body.ui-shell.hx .hx-badge { font-size: 9.5px; font-weight: 800; line-height: 1.2; padding: 1px 6px; border-radius: var(--ui-radius-round); color: var(--ui-watch); background: color-mix(in srgb, var(--ui-watch) 12%, var(--ui-surface)); }
.ux-soon { display: flex; flex-direction: column; align-items: center; gap: var(--ui-space-3); text-align: center; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding-block: 64px; padding-inline: var(--ui-space-4); }
.ux-soon-line { font-size: 14px; color: var(--ui-muted); max-width: 46ch; }

/* ---- The bell and its count ---- */
body.ui-shell.hx #hx-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
body.ui-shell.hx .hx-bell-count { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; min-width: 17px; padding: 0 4px; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; border-radius: var(--ui-radius-round); color: var(--ui-on-accent); background: var(--ui-accent); }
body.ui-shell.hx .hx-bell-count[hidden] { display: none; }

/* ---- The user menu ---- */
body.ui-shell.hx #hx-user { position: relative; }
body.ui-shell.hx #hx-user summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
body.ui-shell.hx #hx-user summary::-webkit-details-marker { display: none; }
body.ui-shell.hx .hx-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--ui-radius-round); font-size: 12px; font-weight: 800; color: var(--ui-on-accent); background: var(--ui-accent); }
body.ui-shell.hx .hx-user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
body.ui-shell.hx .hx-user-menu { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; z-index: 70; display: flex; flex-direction: column; gap: 8px; min-width: 220px; padding: var(--ui-space-3); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.35); }
body.ui-shell.hx #topbar .hx-user-menu #signed-in-as { max-width: none; white-space: normal; }
body.ui-shell.hx .hx-user-menu #sign-out { justify-content: center; }
body.ui-shell.hx .hx-user-menu #sign-out span { display: inline; }

/* ---- Filter bar ---- */
body.ui-shell.hx .ux-filterbar, body.ui-shell.hx .ux-filter-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ui-space-3); }
body.ui-shell.hx .ux-filterbar { margin-block-end: var(--ui-space-4); }
body.ui-shell.hx .ux-filter-custom[hidden] { display: none; }
body.ui-shell.hx .ux-filter-field { display: flex; flex-direction: column; gap: var(--ui-space-1); font-size: 12px; font-weight: 700; color: var(--ui-muted); }
body.ui-shell.hx .ux-filter-field > * { width: auto; min-width: 140px; }

/* ---- Cards, tables, tiles, chips, forms: one look on every screen ---- */
body.ui-shell.hx .vx-card, body.ui-shell.hx .vx-kpi, body.ui-shell.hx .ux-tile, body.ui-shell.hx .ux-table-wrap, body.ui-shell.hx .ux-state, body.ui-shell.hx .ux-chart { background: var(--ui-surface); border-color: var(--ui-line); box-shadow: var(--ui-shadow); }
/* Glass. The gloss is a layer of the background, over the top 44 percent, so it
   lies under the words and never catches a press. */
body.ui-shell.hx :is(.ux-tile, .vx-kpi) { background: linear-gradient(180deg, var(--ui-gloss), transparent 44%), linear-gradient(var(--ui-tile), var(--ui-tile)), var(--ui-surface); border-color: var(--ui-rim); }
/* The till (KAN-640): dish and table tiles are one glass. A selected one, a dish
   on the order or the table whose check is open, has a glow ring and a filled
   badge; a hover has neither. Each table state keeps its word and takes one
   colour. A state the screen does not know keeps its neutral classes. */
body.ui-shell.hx :is(.menu-item-btn, .vx-floor-tile) { position: relative; background: linear-gradient(180deg, var(--ui-gloss), transparent 44%), linear-gradient(var(--ui-tile), var(--ui-tile)), var(--ui-surface); border-color: var(--ui-rim); }
body.ui-shell.hx .menu-item-btn:hover { border-color: var(--ui-accent-text); }
body.ui-shell.hx .menu-item-btn.is-out { border-color: var(--ui-loss); background: color-mix(in srgb, var(--ui-loss) var(--ui-tint), var(--ui-surface)); }
body.ui-shell.hx .menu-item-btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.75; }
body.ui-shell.hx .menu-item-btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
body.ui-shell.hx .vis-count { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; min-width: 26px; padding: 2px 7px; border-radius: var(--ui-radius-round); font-size: 12px; font-weight: 800; background: var(--ui-accent); color: var(--ui-on-accent); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="free"] { --vis-state: var(--ui-muted); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="reserved"] { --vis-state: var(--ui-info); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="seated"] { --vis-state: var(--ui-watch); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="ordered"] { --vis-state: var(--ui-accent-text); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="food_out"] { --vis-state: var(--ui-ok); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch)[data-state="bill_requested"] { --vis-state: var(--ui-bad); }
body.ui-shell.hx :is(.vx-floor-tile, .vis-swatch):is([data-state="free"], [data-state="reserved"], [data-state="seated"], [data-state="ordered"], [data-state="food_out"], [data-state="bill_requested"]) { border-color: var(--vis-state); color: var(--vis-state); }
body.ui-shell.hx .vis-swatch:is([data-state="free"], [data-state="reserved"], [data-state="seated"], [data-state="ordered"], [data-state="food_out"], [data-state="bill_requested"]) { background: var(--vis-state); }
/* A late table (P1-74): its word on a chip, and the loss colour round the tile. After the state colours, to win. */
body.ui-shell.hx .vx-floor-tile[data-late] { border-color: var(--ui-loss); box-shadow: 0 0 0 1px var(--ui-loss); }
body.ui-shell.hx .vis-late { text-transform: none; white-space: nowrap; }
/* A table's total and covers are small already: faded, they fall under 4.5 to 1. */
body.ui-shell.hx .vx-floor-tile [class*="opacity-"] { opacity: 1; }
body.ui-shell.hx :is(.menu-item-btn, .vx-floor-tile).is-selected { border-color: var(--ui-accent); box-shadow: 0 0 0 2px var(--ui-accent), 0 0 18px -2px var(--ui-accent); }
body.ui-shell.hx .ux-chip-ok, body.ui-shell.hx .vx-badge-green { color: var(--ui-done); background: color-mix(in srgb, var(--ui-done) 12%, var(--ui-surface)); }
body.ui-shell.hx .ux-chip-watch, body.ui-shell.hx .vx-badge-amber, body.ui-shell.hx .ux-banner-watch { background: color-mix(in srgb, var(--ui-watch) var(--ui-tint), var(--ui-surface)); }
body.ui-shell.hx .ux-chip-bad, body.ui-shell.hx .vx-badge-red, body.ui-shell.hx .ux-banner-bad { background: color-mix(in srgb, var(--ui-bad) var(--ui-tint), var(--ui-surface)); }
body.ui-shell.hx .ux-chip-info, body.ui-shell.hx .vx-badge-blue { background: color-mix(in srgb, var(--ui-info) var(--ui-tint), var(--ui-surface)); }
body.ui-shell.hx .vx-badge-purple { color: var(--ui-accent-text); background: var(--ui-accent-soft); }
body.ui-shell.hx .vx-input, body.ui-shell.hx .vx-select, body.ui-shell.hx textarea.vx-input { background: var(--ui-surface); }
body.ui-shell.hx .vx-modal { background: var(--ui-surface); color: var(--ui-ink); }
body.ui-shell.hx .vx-modal-title { color: var(--ui-ink); }
body.ui-shell.hx .vx-progress-bar { background: var(--ui-accent); }
body.ui-shell.hx .vx-table th { text-align: start; }
body.ui-shell.hx .vx-table tr:hover td { background: var(--ui-accent-soft); }
body.ui-shell.hx .vx-tab.active { color: var(--ui-accent-text); border-color: var(--ui-accent); }
body.ui-shell.hx .vx-tab:hover { color: var(--ui-accent-text); }
body.ui-shell.hx .vx-kpi .lbl, body.ui-shell.hx .text-lilac-500, body.ui-shell.hx .text-lilac-600, body.ui-shell.hx .text-lilac-700, body.ui-shell.hx .text-violet-700 { color: var(--ui-accent-text); }
body.ui-shell.hx .bg-lilac-50, body.ui-shell.hx .bg-lilac-100, body.ui-shell.hx .bg-violet-50 { background: var(--ui-accent-soft); }
body.ui-shell.hx .border-lilac-100, body.ui-shell.hx .border-lilac-200 { border-color: var(--ui-line); }
body.ui-shell.hx .vx-dropzone { background: var(--ui-surface); border-color: var(--ui-line); }

/* POS and KDS: the same design, bigger. */
body.ui-shell.hx.hx-big #page-content { font-size: 16px; }
body.ui-shell.hx.hx-big #page-content .vx-btn:not(.vx-link-btn) { min-height: 48px; font-size: 14.5px; }
body.ui-shell.hx.hx-big #page-content .vx-btn-sm:not(.vx-link-btn) { min-height: 44px; font-size: 13.5px; }
body.ui-shell.hx.hx-big .hx-sub-item, body.ui-shell.hx.hx-big .hx-tab { min-height: 52px; font-size: 14.5px; }

/* ---- Light: three colours that read at 4.4 to 1, measured; reading text needs 4.5 ---- */
html:not([data-theme]) body.ui-shell.hx[data-ui-theme="light"] .vx-btn-ghost { color: #4b5a70; }
html:not([data-theme]) body.ui-shell.hx[data-ui-theme="light"] .ux-note { color: #4b5a70; }
html:not([data-theme]) body.ui-shell.hx[data-ui-theme="light"] .vx-btn-danger { color: #b91c1c; }
html:not([data-theme]) body.ui-shell.hx[data-ui-theme="light"] #page-content .text-slate-400 { color: #5b6779; }
html:not([data-theme]) body.ui-shell.hx[data-ui-theme="light"] #page-content .text-slate-500 { color: #4b5666; }

/* KAN-640, measured on the walk. The bar is dark in light too, so the greys above,
   written for white, must not reach it. And older screens' amber, green and red
   words take the tokens in light as they already did in dark. */
body.ui-shell.hx #topbar .vx-btn-ghost { color: var(--ui-ink); }
body.ui-shell.hx #topbar .vx-conn-green { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-muted); }
body.ui-shell.hx #page-content :is(.text-amber-500, .text-amber-600) { color: var(--ui-watch); }
body.ui-shell.hx #page-content :is(.text-green-600, .text-emerald-600) { color: var(--ui-ok); }
body.ui-shell.hx #page-content :is(.text-red-500, .text-red-600) { color: var(--ui-bad); }

/* ---- Dark: the surfaces older screens paint with utility classes ---- */
body.ui-shell.hx[data-ui-theme="dark"] :is(.bg-white, .bg-slate-50, .bg-slate-100, .bg-gray-50, .menu-item-btn, .kds-ticket, .vx-step) { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.bg-blue-50, .bg-green-50, .bg-red-50, .bg-amber-50) { background: color-mix(in srgb, var(--ui-muted) 12%, var(--ui-surface)); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-slate-900, .text-slate-800, .text-slate-700) { color: var(--ui-ink); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-slate-600, .text-slate-500, .text-slate-400) { color: var(--ui-muted); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-green-600, .text-green-700) { color: var(--ui-ok); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-red-500, .text-red-600, .text-red-700) { color: var(--ui-bad); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.border-slate-100, .border-slate-200) { border-color: var(--ui-line); }
body.ui-shell.hx[data-ui-theme="dark"] .vx-conn-green { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-muted); }
body.ui-shell.hx[data-ui-theme="dark"] .vx-alert { background: color-mix(in srgb, var(--ui-muted) 10%, var(--ui-surface)); border: 1px solid var(--ui-line); color: var(--ui-ink); }
body.ui-shell.hx[data-ui-theme="dark"] .vx-btn-danger { background: color-mix(in srgb, var(--ui-bad) 14%, var(--ui-surface)); color: var(--ui-bad); border-color: var(--ui-line); }
/* Text written for a white page: labels, quiet buttons and the coloured words older screens use. */
body.ui-shell.hx[data-ui-theme="dark"] :is(.vx-label, .vx-period-picker label, .vx-dropzone, .vx-chip, .text-gray-400, .text-gray-500, .text-gray-600) { color: var(--ui-muted); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.vx-btn-ghost, .text-gray-700, .text-gray-800, .text-gray-900) { color: var(--ui-ink); }
body.ui-shell.hx[data-ui-theme="dark"] .vx-btn-ghost:hover { background: var(--ui-accent-soft); }
body.ui-shell.hx[data-ui-theme="dark"] .vx-chip.is-active { color: var(--ui-accent-text); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-amber-500, .text-amber-600, .text-amber-700, .text-amber-800) { color: var(--ui-watch); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-blue-600, .text-blue-700) { color: var(--ui-info); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-emerald-600, .text-emerald-700) { color: var(--ui-ok); }

/* Light backgrounds the older screens write into their HTML. Only !important beats an
   inline style. The pale red keeps a red tint, after the others because "#fff" matches it too. */
body.ui-shell.hx[data-ui-theme="dark"] #page-content :is([style*="background:#eeedf5" i], [style*="background:#f0eef6" i], [style*="background:#f1f0f6" i], [style*="background:#f7f5fb" i], [style*="background:#f8f7fc" i], [style*="background:#f9f8fc" i], [style*="background:#fff" i]) { background: var(--ui-page) !important; }
body.ui-shell.hx[data-ui-theme="dark"] #page-content :is([style*="background:#fff1f2" i]) { background: color-mix(in srgb, var(--ui-bad) 14%, var(--ui-surface)) !important; }
body.ui-shell.hx[data-ui-theme="dark"] #page-content [style*="color:#c0392f" i] { color: var(--ui-bad) !important; }
/* Captions with a fixed grey in other stylesheets, and the red words. */
body.ui-shell.hx[data-ui-theme="dark"] :is(.p1-kpi-note, .p1-chart-sub, .vis-note, .cmd-sub, .cmd-axis) { color: var(--ui-muted); }
body.ui-shell.hx[data-ui-theme="dark"] #page-content summary:not([class]) { color: var(--ui-muted); }
body.ui-shell.hx[data-ui-theme="dark"] :is(.text-rose-500, .text-rose-600, .text-rose-700) { color: var(--ui-bad); }

/* ---- One row from the desktop width up ---- */
/* Gate 5 saw three rows at 1280, with the launcher under the user menu. */
@media (min-width: 1024px) {
  body.ui-shell.hx #topbar, body.ui-shell.hx #topbar > div { flex-wrap: nowrap; }
  body.ui-shell.hx #topbar > div:first-child { flex: 1 1 0; min-width: 0; }
  body.ui-shell.hx #topbar > div:last-child { flex: 0 0 auto; }
  body.ui-shell.hx .hx-head-group { flex-wrap: nowrap; }
  body.ui-shell.hx #topbar #ux-search-button { flex: 1 1 0; min-width: 44px; overflow: hidden; }
  body.ui-shell.hx #topbar select.selector { max-width: 160px; text-overflow: ellipsis; }
}
@media (min-width: 1024px) and (max-width: 1439.98px) {
  body.ui-shell.hx #topbar { padding-inline: 12px; }
  body.ui-shell.hx .hx-app-title, body.ui-shell.hx .hx-head-word, body.ui-shell.hx .ux-kbd { display: none; }
  /* A good connection is its green tick. One that is not good keeps its words. */
  body.ui-shell.hx #connectivity-pill.vx-conn-green span:not(.vx-conn-age) { display: none; }
  body.ui-shell.hx .hx-user-name { max-width: 90px; }
  body.ui-shell.hx #topbar select.selector { max-width: 128px; }
}
@media (min-width: 1024px) and (max-width: 1179.98px) {
  body.ui-shell.hx .hx-user-name, body.ui-shell.hx .hx-updated { display: none; }
}

/* ---- Below the desktop width the menu is a drawer ---- */
@media (max-width: 1023.98px) {
  body.ui-shell.hx.hx-rtl #sidebar:not(.open) { transform: translateX(100%); }
  body.ui-shell.hx #main-area { margin: 0; }
}
@media (max-width: 767.98px) {
  body.ui-shell.hx .hx-body { display: block; }
  body.ui-shell.hx #hx-sub { padding: 10px 12px 0; }
  body.ui-shell.hx .hx-sub-list { display: flex; gap: 4px; overflow-x: auto; padding: 4px; }
  body.ui-shell.hx .hx-sub-item { white-space: nowrap; min-height: 44px; }
  body.ui-shell.hx #page-content { padding: 12px 12px 48px; }
  body.ui-shell.hx #hx-stale-note { margin: 10px 12px 0; }
}
@media (max-width: 639px) {
  body.ui-shell.hx #topbar { padding: 8px 10px; position: relative; }
  body.ui-shell.hx #topbar > div:first-child, body.ui-shell.hx #topbar > div:last-child { flex: 1 1 100%; }
  body.ui-shell.hx #topbar > div:last-child { justify-content: flex-start; }
  body.ui-shell.hx .hx-app-title { display: none; }
  body.ui-shell.hx .hx-head-word { display: none; }
  body.ui-shell.hx .hx-user-name { display: none; }
  body.ui-shell.hx #hx-user { position: static; }
  body.ui-shell.hx .hx-user-menu { inset-inline-end: 12px; inset-block-start: 100%; }
  body.ui-shell.hx #topbar #ux-search-button .ux-search-word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.ui-shell.hx #topbar select.selector { max-width: 130px; }
  body.ui-shell.hx #topbar #signed-in-as { max-width: 90px; }
}
@media print { body.ui-shell.hx #hx-tabs, body.ui-shell.hx #hx-sub { display: none !important; } }
/* KAN-632: one person to a row. The name takes the room, the button keeps its words on one line, and what was said goes under both. */
.ux-reset-list { max-height: 55vh; overflow-y: auto; }
.ux-reset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 8px 0; }
.ux-reset-who { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ux-reset-row button { white-space: nowrap; }
.ux-reset-said { grid-column: 1 / -1; }
.ux-reset-said:empty { display: none; }
/* UI UNIFORMITY KIT (Sree, 29 November, prompts/ui-uniformity-29nov.md): one button, one chip,
   one table heading, one card, one empty state, on every screen. Tokens only. A screen should
   not restate any of these. */
body.ui-shell .vx-btn, body.ui-shell .vx-btn-sm {
  min-height: 40px; padding: 0 16px; gap: 8px; justify-content: center; align-items: center;
  font-size: 13px; font-weight: 700; line-height: 1.25; border-radius: var(--ui-radius-sm);
  border: 1px solid transparent; letter-spacing: normal; text-transform: none; text-decoration: none;
}
/* The button already spaces its icon: a margin class on the icon spaced it twice. */
body.ui-shell .vx-btn > i[class*="mr-"] { margin-inline-end: 0; }
body.ui-shell .vx-btn-primary { background: var(--ui-accent); color: var(--ui-on-accent); border-color: transparent; }
body.ui-shell .vx-btn-primary:hover { filter: brightness(1.06); transform: none; }
body.ui-shell .vx-btn-secondary { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-ink); }
body.ui-shell .vx-btn-secondary:hover { background: var(--ui-accent-soft); border-color: var(--ui-accent); }
body.ui-shell .vx-btn-danger { background: var(--ui-surface); border-color: var(--ui-bad); color: var(--ui-bad); }
body.ui-shell .vx-btn-danger:hover { background: color-mix(in srgb, var(--ui-bad) 8%, var(--ui-surface)); }
body.ui-shell #page-content .vx-btn-ghost { background: transparent; border-color: transparent; color: var(--ui-accent-text); }
body.ui-shell #page-content .vx-btn-ghost:hover { background: var(--ui-accent-soft); }
body.ui-shell .vx-btn:disabled, body.ui-shell .vx-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }
/* A button in a table or a window keeps its words on one line: the table scrolls, and the
   window's row of buttons moves one down instead. */
body.ui-shell .vx-modal .vx-btn, body.ui-shell .vx-table .vx-btn, body.ui-shell .ux-table .vx-btn { white-space: nowrap; }
body.ui-shell .vx-modal .flex.justify-end { flex-wrap: wrap; }
body.ui-shell .vx-badge {
  font-size: 12px; font-weight: 700; line-height: 1.4; padding: 2px 10px;
  border-radius: var(--ui-radius-round); text-transform: none; letter-spacing: normal;
}
body.ui-shell .vx-table th { font-size: 12px; font-weight: 700; padding: 10px 12px; text-transform: none; letter-spacing: normal; }
body.ui-shell .vx-table td { padding: 10px 12px; }
body.ui-shell .vx-kpi { border-radius: var(--ui-radius); padding: 16px; }
body.ui-shell .vx-kpi .lbl { font-size: 12px; color: var(--ui-muted); text-transform: none; letter-spacing: normal; }
body.ui-shell .vx-label { font-size: 12px; text-transform: none; letter-spacing: normal; }
body.ui-shell .ux-group { font-size: 12px; text-transform: none; letter-spacing: normal; }
body.ui-shell .vx-card { border-radius: var(--ui-radius); padding: 20px; }
body.ui-shell .vx-empty { padding: 32px 16px; color: var(--ui-muted); font-size: 13.5px; }
body.ui-shell .vx-empty i { color: var(--ui-muted); }
@media (max-width: 768px) {
  body.ui-shell .vx-btn, body.ui-shell .vx-btn-sm { min-height: var(--ui-tap); }
  body.ui-shell .vx-card { padding: 16px; }
}
/* ===== END UI UNIFORMITY KIT ===== */
/* The What-If panel is mounted on Heartbeat and on the Digital Twin: its choices carry their own
   size, or they fall back to the chip's 32 px where the page around them sets none. */
body.ui-shell .cmd-whatif-panel .vx-chip { min-height: 40px; display: inline-flex; align-items: center; }
@media (max-width: 768px) {
  body.ui-shell .cmd-whatif-panel .vx-chip { min-height: var(--ui-tap); }
}
/* KAN-577: on a phone a long table keeps its first column while the others scroll under it.
   Solid, from the theme. A row spanning the table (an empty or loading line) is left alone. */
@media (max-width: 600px) {
  body.ui-shell .overflow-x-auto > .vx-table tr > :is(th, td):first-child:not([colspan]) {
    position: sticky; inset-inline-start: 0; z-index: 1; background: var(--ui-surface);
    max-width: 46vw; white-space: normal; overflow-wrap: break-word;
  }
  /* The box's own padding: without this, passing columns show beside the kept one. A block, not a
     shadow: the browser draws no cell shadow where a table merges its borders. */
  body.ui-shell .overflow-x-auto > .vx-table tr > :is(th, td):first-child:not([colspan])::before {
    content: ''; position: absolute; inset-block: 0; inset-inline-end: 100%; width: 24px; background: var(--ui-surface);
  }
}
/* ===== END APP SHELL ===== */

/* KAN-640: a finger is told by the pointer, not the width. A touch till or kitchen screen wider than the
   phone rules above still needs 44 px targets. Only those two screens: every other wide screen keeps its
   compact buttons (KAN-509), and so does a till worked with a mouse. */
@media (pointer: coarse) {
  #page-content:has(#pos-tab-content) :is(.vx-btn, .vx-tab) { min-height: 44px; min-width: 44px; }
}

/* KAN-640, decisions-75: the stock grade on a dish, for staff. Dark red = very low or out, light red = low,
   no rule = normal. Each also carries its word on the tile ("Very low", "Low", "Out of stock"), never colour alone.
   The tint is thin so the tile's own words keep their contrast in both themes. */
body.ui-shell.hx .menu-item-btn[data-stock="very_low"],
body .menu-item-btn[data-stock="very_low"] { background-image: linear-gradient(rgba(153, 27, 27, .20), rgba(153, 27, 27, .20)); }
body.ui-shell.hx .menu-item-btn[data-stock="very_low"]:not(.is-selected),
body .menu-item-btn[data-stock="very_low"]:not(.is-selected) { border-color: #991b1b; border-width: 2px; }
body.ui-shell.hx .menu-item-btn[data-stock="low"],
body .menu-item-btn[data-stock="low"] { background-image: linear-gradient(rgba(248, 113, 113, .09), rgba(248, 113, 113, .09)); }
body.ui-shell.hx .menu-item-btn[data-stock="low"]:not(.is-selected),
body .menu-item-btn[data-stock="low"]:not(.is-selected) { border-color: #f87171; border-width: 2px; }

/* KAN-567: the invalid number popup opens over another window. Seen on the walk:
   in dark it ran into the window behind it, and OK touched the text. */
dialog.pf-popup { width: min(92vw, 28rem); border: 1px solid var(--ui-bad, var(--bad)); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
dialog.pf-popup::backdrop { background: rgba(0, 0, 0, .55); }
dialog.pf-popup button { margin-top: 1rem; }

/* KAN-638, seen on the walk: inside an Insights card the kit's own card was a
   box in a box, and the ring's key repeated every amount in the list beside it.
   The list carries the ring's colours; "View as table" stays. */
.ins-chart > figure, .ins-chart > section { border: 0; box-shadow: none; background: none; padding: 0; margin: .75rem 0 0; width: 100%; }
.ins-ring .ux-legend { display: none; }
/* The themed card's own shadow and edge win on specificity, so they are removed here by force. */
.ins-chart > .ux-chart { box-shadow: none !important; border: 0 !important; background: transparent !important; }
.ins-ring .ux-donut { display: flex; justify-content: center; }

/* Walk of 29 November, 390 px: the phone rule's 44px min-width replaces the width a button's words need,
   so the kitchen's Refresh was squeezed beside the counts and its word ran off the screen. */
#page-content #refresh-kds { flex-shrink: 0; }

/* An open order's buttons: on a phone the third ran off the screen and dragged the page sideways. */
#lpo-actions { flex-wrap: wrap; }
