/* =============================================================================
   CLINIC TOUCH — MapleClinic's visual language, modelled on MaplePOS / MapleCoffee's touch
   surface (SPC.Blazor.RES.Touch: cafe-touch.css + touch-setup.css + the home tiles). Copied and
   re-tinted rather than referenced: that library is restaurant code (RULES.md rule 6).

   Served, not scoped: a .razor.css in a referenced project never reaches a head's bundle, and
   TouchPage renders the shell elements, so a scoped rule for them would match nothing.

   Colours live ONCE, in the --cli-* primitives below (steel blue on cool grey — the family's
   "slate" palette). The .theme-dark block re-declares the SAME names in night values; the theme
   class sits on an ancestor (.touch-shell / .app-theme), so no rule is written twice. Every
   token composed from another token is repeated in the night block — a var() inside a custom
   property is substituted where it is DECLARED, not where it is used.
   ========================================================================== */

:root {
    --cli-accent:        #2f4a63;   /* accent FILL — buttons, lead tile */
    --cli-accent-2:      #4b6a86;   /* accent gradient end */
    --cli-accent-ink:    #2f4a63;   /* accent as TEXT / ICON */
    --cli-on-accent:     #f4f8fc;   /* text on an accent fill */
    --cli-page-1:        #f3f5f8;   /* background top */
    --cli-page-2:        #e7ebf0;
    --cli-page-3:        #dbe1e8;   /* background bottom */
    --cli-ink:           #1b2430;
    --cli-muted:         #5a6672;
    --cli-hint:          #8b97a3;
    --cli-line:          #d7dee6;

    --cli-panel:         rgba(250, 252, 255, 0.62);
    --cli-panel-sheer:   rgba(250, 252, 255, 0.44);
    --cli-panel-solid:   rgba(250, 252, 255, 0.86);
    --cli-panel-border:  rgba(255, 255, 255, 0.66);
    --cli-panel-inset:   rgba(255, 255, 255, 0.6);
    --cli-field-bg:      rgba(255, 255, 255, 0.72);
    --cli-danger:        #b03a2e;
    --cli-ok:            #1a7f4f;
    --cli-warn:          #a86f14;   /* the car is at this step now (in-repair amber) */
    --cli-shadow:        rgba(22, 34, 48, 0.16);

    --cli-gradient:        linear-gradient(160deg, var(--cli-page-1) 0%, var(--cli-page-2) 55%, var(--cli-page-3) 100%);
    --cli-accent-gradient: linear-gradient(135deg, var(--cli-accent) 0%, var(--cli-accent-2) 100%);

    /* Core touch components (TouchPage's Back/Home cluster, shared touch views) read --touch-*. */
    --touch-ink:          var(--cli-ink);
    --touch-muted:        var(--cli-muted);
    --touch-hint:         var(--cli-hint);
    --touch-accent:       var(--cli-accent-ink);
    --touch-accent-fill:  var(--cli-accent-gradient);
    --touch-on-accent:    var(--cli-on-accent);
    --touch-accent-soft:  color-mix(in srgb, var(--cli-accent-ink) 9%, transparent);
    --touch-shadow:       var(--cli-shadow);
    --touch-panel:        var(--cli-panel);
    --touch-panel-2:      var(--cli-panel-sheer);
    --touch-control:      var(--cli-field-bg);
    --touch-control-border: var(--cli-line);
    --touch-line:         var(--cli-line);
    --touch-tile-alt:     var(--cli-panel-solid);      /* the core booking screens' solid panel */
    --touch-frost-border: var(--cli-panel-border);
    --touch-frost-inset:  var(--cli-panel-inset);
    /* Status colours for core touch views (SMS setup's notices, checks), from the clinic's own. */
    --touch-ok:            var(--cli-ok);
    --touch-ok-bg:         color-mix(in srgb, var(--cli-ok) 12%, transparent);
    --touch-ok-border:     color-mix(in srgb, var(--cli-ok) 35%, transparent);
    --touch-warn:          #c98a2b;
    --touch-warn-bg:       color-mix(in srgb, #c98a2b 12%, transparent);
    --touch-warn-border:   color-mix(in srgb, #c98a2b 35%, transparent);
    --touch-danger:        var(--cli-danger);
    --touch-danger-bg:     color-mix(in srgb, var(--cli-danger) 12%, transparent);
    --touch-danger-border: color-mix(in srgb, var(--cli-danger) 35%, transparent);
    /* Core checkout (TouchCheckoutView) reads the --t-* family. */
    --t-fg:     var(--cli-ink);
    --t-muted:  var(--cli-muted);
    --t-bg:     var(--cli-panel-solid);
    --t-border: var(--cli-line);
    --t-accent: var(--cli-accent-ink);
}

/* ── Night: the shop after hours ──────────────────────────────────────────── */
.theme-dark {
    --cli-accent:        #4b6a86;
    --cli-accent-2:      #587a98;
    --cli-accent-ink:    #a9c4de;
    --cli-on-accent:     #f4f8fc;
    --cli-page-1:        #161c23;
    --cli-page-2:        #10151b;
    --cli-page-3:        #0b0f14;
    --cli-ink:           #eaf0f6;
    --cli-muted:         #a5b2bf;
    --cli-hint:          #8b97a3;
    --cli-line:          rgba(255, 255, 255, 0.10);

    --cli-panel:         rgba(36, 46, 58, 0.62);
    --cli-panel-sheer:   rgba(36, 46, 58, 0.44);
    --cli-panel-solid:   rgba(28, 37, 47, 0.9);
    --cli-panel-border:  rgba(255, 255, 255, 0.10);
    --cli-panel-inset:   rgba(255, 255, 255, 0.06);
    --cli-field-bg:      rgba(255, 255, 255, 0.06);
    --cli-danger:        #f0a39a;
    --cli-ok:            #7fd6a4;
    --cli-warn:          #f0c27a;
    --cli-shadow:        rgba(0, 0, 0, 0.44);
    --cli-night-surface: #202a35;

    /* Re-composed tokens (see the header note). */
    --cli-gradient:        linear-gradient(160deg, var(--cli-page-1) 0%, var(--cli-page-2) 55%, var(--cli-page-3) 100%);
    --cli-accent-gradient: linear-gradient(135deg, var(--cli-accent) 0%, var(--cli-accent-2) 100%);
    --touch-ink:          var(--cli-ink);
    --touch-muted:        var(--cli-muted);
    --touch-hint:         var(--cli-hint);
    --touch-accent:       var(--cli-accent-ink);
    --touch-accent-fill:  var(--cli-accent-gradient);
    --touch-on-accent:    var(--cli-on-accent);
    --touch-accent-soft:  color-mix(in srgb, var(--cli-accent-ink) 12%, transparent);
    --touch-shadow:       var(--cli-shadow);
    --touch-panel:        var(--cli-panel);
    --touch-panel-2:      var(--cli-panel-sheer);
    --touch-control:      var(--cli-field-bg);
    --touch-control-border: rgba(255, 255, 255, 0.20);
    --touch-line:         var(--cli-line);
    --touch-tile-alt:     var(--cli-panel-solid);
    --touch-frost-border: var(--cli-panel-border);
    --touch-frost-inset:  var(--cli-panel-inset);
    /* Status colours for core touch views (SMS setup's notices, checks), from the clinic's own. */
    --touch-ok:            var(--cli-ok);
    --touch-ok-bg:         color-mix(in srgb, var(--cli-ok) 12%, transparent);
    --touch-ok-border:     color-mix(in srgb, var(--cli-ok) 35%, transparent);
    --touch-warn:          #c98a2b;
    --touch-warn-bg:       color-mix(in srgb, #c98a2b 12%, transparent);
    --touch-warn-border:   color-mix(in srgb, #c98a2b 35%, transparent);
    --touch-danger:        var(--cli-danger);
    --touch-danger-bg:     color-mix(in srgb, var(--cli-danger) 12%, transparent);
    --touch-danger-border: color-mix(in srgb, var(--cli-danger) 35%, transparent);
    /* Core checkout (TouchCheckoutView) reads the --t-* family. */
    --t-fg:     var(--cli-ink);
    --t-muted:  var(--cli-muted);
    --t-bg:     var(--cli-panel-solid);
    --t-border: var(--cli-line);
    --t-accent: var(--cli-accent-ink);
}

/* ── Selectable looks (Setup → Display; ClinicLooks) ─────────────────────────
   The class sits on <html> (TouchPaletteService → App.razor), the same element as :root, so the
   composed gradients above recompute from these primitives. Night re-points them under the shell's
   .theme-dark, which re-declares its own composites. Only the accent and the page tint change;
   ink, panels and status colours stay the clinic's. No class = steel, the sheet's default. */
html.touch-palette--bistro   { --cli-accent: #7a2e3b; --cli-accent-2: #9a4455; --cli-accent-ink: #7a2e3b; --cli-page-1: #faf4f2; --cli-page-2: #f2e8e5; --cli-page-3: #e9dbd7; }
html.touch-palette--olive    { --cli-accent: #3f5f3a; --cli-accent-2: #5a7a52; --cli-accent-ink: #3f5f3a; --cli-page-1: #f5f7ee; --cli-page-2: #eaeee0; --cli-page-3: #dfe5d2; }
html.touch-palette--charcoal { --cli-accent: #2b2b2b; --cli-accent-2: #4a4a4a; --cli-accent-ink: #2b2b2b; --cli-page-1: #f6f6f4; --cli-page-2: #ecece9; --cli-page-3: #e1e1dd; }
html.touch-palette--bistro .theme-dark   { --cli-accent: #a3475a; --cli-accent-2: #b85a6c; --cli-accent-ink: #f0b3bf; --cli-page-1: #26161a; --cli-page-2: #1d1013; --cli-page-3: #140b0d; --cli-night-surface: #2e1d22; }
html.touch-palette--olive .theme-dark    { --cli-accent: #5f7f56; --cli-accent-2: #6f9166; --cli-accent-ink: #bcd8b0; --cli-page-1: #1b2318; --cli-page-2: #141a12; --cli-page-3: #0e120c; --cli-night-surface: #243020; }
html.touch-palette--charcoal .theme-dark { --cli-accent: #4a4a4a; --cli-accent-2: #5c5c5c; --cli-accent-ink: #d6d6d6; --cli-page-1: #1c1c1c; --cli-page-2: #151515; --cli-page-3: #0f0f0f; --cli-night-surface: #262626; }

/* MudBlazor's own dark palette is a neutral grey; on the steel night page re-point it so
   MudPaper / fields / tables wear the same surface as everything around them. */
.theme-dark.touch-shell--clinic,
.theme-dark .cli-theme {
    --mud-palette-surface: var(--cli-night-surface);
    --mud-palette-background: transparent;
    --mud-palette-background-gray: rgba(255, 255, 255, 0.05);
    --mud-palette-text-primary: var(--cli-ink);
    --mud-palette-text-secondary: var(--cli-muted);
    --mud-palette-action-default: var(--cli-muted);
    --mud-palette-lines-default: var(--cli-line);
    --mud-palette-lines-inputs: rgba(255, 255, 255, 0.24);
    --mud-palette-divider: var(--cli-line);
    --mud-palette-primary: var(--cli-accent-ink);
    --mud-palette-primary-text: var(--cli-page-1);
    --mud-palette-table-lines: var(--cli-line);
}

/* ── The reusable theme class: any page root that wants the clinic look ── */
.cli-theme {
    --ink: var(--cli-ink);
    --muted: var(--cli-muted);
    --accent: var(--cli-accent);
    --panel: var(--cli-panel);
    --panel-border: var(--cli-panel-border);
    --mud-palette-primary: var(--cli-accent);
    background: var(--cli-gradient);
    color: var(--cli-ink);
}

/* ── Shell (ClinicTouchLayout) ──────────────────────────────────────────── */
.touch-shell { touch-action: manipulation; }  /* no double-tap zoom, no tap delay */
.touch-shell--clinic {
    position: relative;
    min-height: 100vh;
    background: var(--cli-gradient);
    background-attachment: fixed;
    color: var(--cli-ink);
}
.touch-shell--clinic .touch-shell__body { position: relative; z-index: 1; }
/* The shop's background photos (Setup → Display) play in fixed layers under this scrim, which is
   tinted from the page tokens so it follows light / night and the chosen look. No photos → no scrim. */
.touch-shell--clinic .touch-shell__scrim {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(160deg, color-mix(in srgb, var(--cli-page-1) 58%, transparent) 0%, color-mix(in srgb, var(--cli-page-3) 76%, transparent) 100%);
}

/* Frosted-glass tiers: --sheer for launcher tiles, base for panels, --solid for dense data. */
/* .touch-glass is the family's name for the same material — the shared HR / core touch views use
   it, so it is an alias here rather than a second look. */
.cli-glass,
.touch-shell .touch-glass {
    background: var(--cli-panel);
    border: 1px solid var(--cli-panel-border);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 14px 40px var(--cli-shadow), inset 0 1px 0 var(--cli-panel-inset);
}
.cli-glass--sheer, .touch-shell .touch-glass--sheer { background: var(--cli-panel-sheer); }
.cli-glass--solid, .touch-shell .touch-glass--solid { background: var(--cli-panel-solid); }

/* ── Editor / setup pages (TouchPage ShellClass="cli-editor-shell cli-theme") ── */
.cli-editor-shell {
    height: 100dvh;
    overflow-y: auto;                 /* the shell IS the scroll container */
    color: var(--cli-ink);
    --tph-ink: var(--cli-ink);        /* Core's title/subtitle paint (touch-page-chrome.css) */
    --tph-muted: var(--cli-muted);
}
.cli-editor-shell .form-page { padding-bottom: 64px; }
/* The setup hub floats Home alone, so its title reserves one button, not two. */
.cli-editor-shell.cli-hub-shell { --tph-nav-w: 54px; }
.cli-editor-shell .mud-button-filled-primary:not(:disabled) {
    background: var(--cli-accent-gradient) !important;
    color: var(--cli-on-accent) !important;
}

/* The .form-page frame TouchPage renders (the family's form.css basics; this head has no
   form.css of its own). Core's touch-page-chrome.css then positions the title row. */
.form-page {
    width: 100%;
    max-width: 1536px;
    margin: 0 auto;
    padding: 4.25rem 1rem 1rem;
    box-sizing: border-box;
    display: grid;
    /* One column that can NEVER be wider than the screen. A bare grid's column grows to its widest
       child's content (a long car name, the search box, a row of buttons), which on a phone pushed
       every page off the right edge. minmax(0, 1fr) caps it; children then wrap or ellipsize. */
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}
.form-page > * { min-width: 0; }
.form-page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
/* Wrap is load-bearing: below 640px core's touch-page-chrome.css gives the command slot the whole row
   (flex-basis 100%) so it drops under the title. Without wrap the row cannot break, and iPhone Safari
   drew the commands on top of the page content instead. */
.form-page-title {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.45rem);
    line-height: 1.05;
    font-weight: 800;
    color: var(--tph-ink, var(--ink));
}
.form-page-subtitle { margin: .35rem 0 0; max-width: 48rem; color: var(--tph-muted, var(--muted)); font-size: .96rem; line-height: 1.45; }

/* A content panel on the glass. */
.cli-panel {
    border-radius: 18px;
    padding: 20px;
    background: var(--cli-panel-solid);
    border: 1px solid var(--cli-panel-border);
    box-shadow: 0 10px 30px var(--cli-shadow);
}
.cli-panel__title {
    margin: 0 0 12px;
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cli-muted);
}
.cli-panel__note { margin: -4px 0 12px; font-size: .85rem; color: var(--cli-muted); }

/* Primary command — a plain button, styled directly (no MudButton cascade fights). */
.cli-btn {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: var(--cli-accent-gradient);
    color: var(--cli-on-accent);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px var(--cli-shadow);
    touch-action: manipulation;
    transition: filter .12s ease, transform .06s ease;
}
.cli-btn:hover:not(:disabled) { filter: brightness(1.08); }
.cli-btn:active:not(:disabled) { transform: scale(.98); }
.cli-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ── Touch home (/clinic) — big role tiles on frosted glass ─────────────── */
.ghome { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 28px; padding: 40px clamp(16px, 6vw, 80px); }
.ghome__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ghome__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ghome__logo { width: 48px; height: 48px; border-radius: 999px; object-fit: cover; border: 2px solid var(--cli-panel-border); }
.ghome__mark { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--cli-accent-gradient); color: var(--cli-on-accent); box-shadow: 0 6px 18px var(--cli-shadow); }
.ghome__title { margin: 0; font-size: 2rem; font-weight: 800; color: var(--cli-ink); }
.ghome__clock { color: var(--cli-muted); font-weight: 700; }

/* Account chip + dropdown. */
.ghome__acct { position: relative; display: flex; align-items: center; gap: 16px; }
.ghome__user { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
    background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 4px 12px 4px 4px; touch-action: manipulation; }
.ghome__user:hover, .ghome__user.is-open { background: var(--cli-panel-sheer); border-color: var(--cli-panel-border); }
.ghome__avatar { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--touch-accent-soft); color: var(--cli-accent-ink); font-size: .85rem; font-weight: 800; }
.ghome__user-name { color: var(--cli-ink); font-weight: 700; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghome__caret { color: var(--cli-hint); font-size: .8rem; }
.ghome__scrim { position: fixed; inset: 0; z-index: 40; }
.ghome__menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 41; min-width: 240px; display: flex; flex-direction: column; padding: 8px;
    border-radius: 16px; border: 1px solid var(--cli-panel-border); background: var(--cli-panel-solid);
    backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: 0 18px 52px var(--cli-shadow); }
.ghome__menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; }
.ghome__menu-name { color: var(--cli-ink); font-weight: 800; }
.ghome__menu-sub { color: var(--cli-hint); font-size: .82rem; font-weight: 600; }
.ghome__menu-item { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; text-align: left; width: 100%;
    display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: 10px;
    color: var(--cli-ink); font-weight: 700; text-decoration: none; background: none; border: 0; border-top: 1px solid var(--cli-line); }
.ghome__menu-item:hover { background: var(--cli-panel-sheer); color: var(--cli-accent-ink); }
.ghome__menu form { margin: 0; }

.ghome__grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-content: center;
    max-width: 1040px; width: 100%; margin: 0 auto; }
.ghome__tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px;
    min-height: 180px; padding: 26px; border-radius: 24px; text-decoration: none; box-sizing: border-box;
    transition: transform .06s ease, box-shadow .16s ease; }
.ghome__tile:active { transform: scale(.985); }
.ghome__tile:hover { box-shadow: 0 18px 52px var(--cli-shadow), inset 0 1px 0 var(--cli-panel-inset); }
.ghome__tile--lead { background: var(--cli-accent-gradient); border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 18px 52px var(--cli-shadow), inset 0 1px 0 rgba(255, 255, 255, .22); }
.ghome__tile--soon { cursor: default; opacity: .72; }
.ghome__tile--soon:active { transform: none; }
.ghome__ic { color: var(--cli-accent-ink); line-height: 1; }
.ghome__name { font-size: 1.45rem; font-weight: 800; color: var(--cli-ink); }
.ghome__sub { font-size: 1rem; color: var(--cli-muted); }
.ghome__tile--lead .ghome__ic,
.ghome__tile--lead .ghome__name { color: var(--cli-on-accent); }
.ghome__tile--lead .ghome__sub { color: color-mix(in srgb, var(--cli-on-accent) 88%, transparent); }
.ghome__soon { position: absolute; top: 16px; right: 16px; padding: 3px 10px; border-radius: 999px;
    background: var(--touch-accent-soft); color: var(--cli-accent-ink); font-size: .75rem; font-weight: 800; letter-spacing: .03em; }
.ghome__tile--lead .ghome__soon { background: rgba(255, 255, 255, .18); color: var(--cli-on-accent); }

/* ── Setup hub (/clinic/setup) — grouped tile grid ──────────────────────── */
.gsetup { gap: 34px; }
.gsetup__group { display: flex; flex-direction: column; }
.gsetup__heading { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--cli-panel-border); }
.gsetup__heading h2 { margin: 0; font-size: .92rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--cli-muted); }
.gsetup__subtitle { margin: 10px 0 14px; color: var(--cli-muted); font-size: .9rem; }
.gsetup__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.gsetup__tile { -webkit-appearance: none; appearance: none; font-family: inherit; text-align: left; display: flex; flex-direction: column; gap: 7px;
    min-height: 124px; padding: 18px; background: var(--cli-panel); border: 1px solid var(--cli-panel-border); border-radius: 16px;
    cursor: pointer; color: inherit; touch-action: manipulation;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease; }
.gsetup__tile:hover:not(:disabled) { background: var(--cli-panel-solid); border-color: color-mix(in srgb, var(--cli-accent-ink) 35%, transparent); transform: translateY(-1px); }
.gsetup__tile:focus-visible { outline: 2px solid var(--cli-accent-ink); outline-offset: 2px; }
.gsetup__tile:disabled { cursor: default; opacity: .6; }
.gsetup__icon { color: var(--cli-accent-ink); line-height: 1; }
.gsetup__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 1rem; color: var(--cli-ink); }
.gsetup__desc { color: var(--cli-muted); font-size: .84rem; line-height: 1.35; }
.gsetup__badge { padding: 2px 9px; border-radius: 999px; background: var(--touch-accent-soft); color: var(--cli-accent-ink); font-size: .74rem; font-weight: 700; }

/* ── Buttons: weights the BO chooses (DocumentActionKind) ──────────────── */
.cli-btn--primary { }
.cli-btn--success { background: linear-gradient(135deg, #1a7f4f 0%, #2a9d66 100%); }
.cli-btn--neutral, .cli-btn--ghost {
    background: var(--cli-field-bg); color: var(--cli-accent-ink);
    border: 1.5px solid var(--cli-line); box-shadow: none;
}
.cli-btn--danger {
    background: color-mix(in srgb, var(--cli-danger) 12%, var(--cli-field-bg));
    color: var(--cli-danger); border: 1.5px solid color-mix(in srgb, var(--cli-danger) 40%, transparent); box-shadow: none;
}
a.cli-btn { text-decoration: none; }
.cli-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cli-actions--ask { padding: 14px; border-radius: 16px; background: var(--cli-panel-solid); border: 1px solid var(--cli-panel-border); }

/* ── Status chip — one colour per status, everywhere ────────────────────── */
.cli-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800;
    letter-spacing: .02em; background: var(--touch-accent-soft); color: var(--cli-accent-ink); white-space: nowrap; }
.cli-status--confirmed { background: color-mix(in srgb, #3b82c4 16%, transparent); color: #3b82c4; }
.cli-status--arrived { background: color-mix(in srgb, #3fa34d 16%, transparent); color: #2f8a3c; }
.cli-status--cancelled, .cli-status--noshow { background: color-mix(in srgb, var(--cli-danger) 12%, transparent); color: var(--cli-danger); }
.theme-dark .cli-status--confirmed { color: #8cc0ee; }
.theme-dark .cli-status--arrived { color: #7fd6a4; }

/* ── Appointments (/clinic/appointments) ───────────────────────────────── */
.gappt { gap: 18px; }
.gappt__week { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.gappt__nav { -webkit-appearance: none; appearance: none; border: 0; background: none; color: var(--cli-muted); cursor: pointer; border-radius: 12px; padding: 0 6px; }
.gappt__nav:hover { background: var(--touch-accent-soft); }
.gappt__day { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; flex: 1 1 88px; min-width: 76px;
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px;
    background: var(--cli-panel); border: 1px solid var(--cli-panel-border); color: var(--cli-ink); touch-action: manipulation; }
.gappt__day.is-selected { background: var(--cli-accent-gradient); color: var(--cli-on-accent); border-color: transparent; }
.gappt__day.is-today:not(.is-selected) { border-color: color-mix(in srgb, var(--cli-accent-ink) 55%, transparent); }
.gappt__dow { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.gappt__num { font-size: 1.15rem; font-weight: 800; }
.gappt__load { font-size: .8rem; font-weight: 700; opacity: .85; }
.gappt__day.is-full:not(.is-selected) .gappt__load { color: var(--cli-danger); }
.gappt__meter { height: 8px; border-radius: 999px; background: var(--cli-panel); border: 1px solid var(--cli-panel-border); overflow: hidden; }
.gappt__meter-fill { height: 100%; background: var(--cli-accent-gradient); transition: width .2s ease; }
.gappt__meter-fill.is-full { background: var(--cli-danger); }
.gappt__empty { color: var(--cli-muted); }
.gappt__list { display: flex; flex-direction: column; gap: 10px; }
.gappt__card { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; border-radius: 18px; text-decoration: none; color: var(--cli-ink); }
.gappt__card.is-inactive { opacity: .6; }
.gappt__time { font-size: 1.25rem; font-weight: 800; min-width: 64px; color: var(--cli-accent-ink); }
.gappt__body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gappt__who { font-weight: 800; }
.gappt__phone { font-weight: 600; color: var(--cli-muted); margin-inline-start: 8px; }
.gappt__car { color: var(--cli-ink); }
.gappt__issue { color: var(--cli-muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gappt__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gappt__no { font-size: .78rem; color: var(--cli-hint); font-weight: 700; }

/* ── Pickers: a chosen customer / car, and the choices ─────────────────── */
.gform-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gpick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-top: 8px;
    background: var(--cli-field-bg); border: 1px solid var(--cli-line); color: var(--cli-ink); text-decoration: none; width: 100%; box-sizing: border-box; }
.gpick--button { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; text-align: left; }
.gpick--button:hover { border-color: color-mix(in srgb, var(--cli-accent-ink) 45%, transparent); }
.gpick.is-inactive { opacity: .6; }
.gpick__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gpick__name { font-weight: 800; }
.gpick__sub { color: var(--cli-muted); font-size: .9rem; }
.gnew { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--cli-line); }
.gnew__title { font-weight: 700; color: var(--cli-muted); margin-bottom: 6px; }
/* A list page's search rides in TouchPage's command slot, beside the title. */
.gsearch { flex: 0 1 440px; width: 440px; max-width: 100%; }
.gsearch .spc-field, .gsearch .mud-input-control { margin: 0; }
.gcars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gcars--list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gcar { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; text-align: left; text-decoration: none;
    display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 14px 16px; border-radius: 16px; color: var(--cli-ink);
    background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); touch-action: manipulation; }
.gcar--lg { min-height: 128px; padding: 18px 20px; gap: 18px; border-radius: 18px; }
.gcar:hover { border-color: color-mix(in srgb, var(--cli-accent-ink) 40%, transparent); }
.gcar.is-selected { border-color: var(--cli-accent-ink); box-shadow: inset 0 0 0 1px var(--cli-accent-ink); background: var(--cli-panel-solid); }
.gcar--add { justify-content: center; gap: 8px; color: var(--cli-accent-ink); border-style: dashed; }
.gcar__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gcar__name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.gcar--lg .gcar__name { font-size: 1.2rem; }
.gcar__plate { align-self: flex-start; font-weight: 800; letter-spacing: .08em; font-size: .85rem; padding: 2px 8px; border-radius: 6px;
    border: 1.5px solid var(--cli-line); background: var(--cli-panel-solid); }
.gcar__sub { color: var(--cli-muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Car logo — a white tile so every brand mark reads on light and dark themes alike. */
.gcarlogo { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px;
    background: #fff; border: 1px solid var(--cli-line); overflow: hidden; }
.gcarlogo img { width: 78%; height: 78%; object-fit: contain; }
.gcarlogo--sm { width: 36px; height: 36px; border-radius: 9px; }
.gcarlogo--md { width: 60px; height: 60px; }
.gcarlogo--lg { width: 88px; height: 88px; border-radius: 18px; }
.gcarlogo--xl { width: 120px; height: 120px; border-radius: 22px; }
.gcarlogo--mono { background: var(--touch-accent-soft); color: var(--cli-accent-ink); font-weight: 900; letter-spacing: .04em; }
.gcarlogo--sm.gcarlogo--mono { font-size: .8rem; }
.gcarlogo--md.gcarlogo--mono { font-size: 1.2rem; }
.gcarlogo--lg.gcarlogo--mono { font-size: 1.7rem; }
.gcarlogo--xl.gcarlogo--mono { font-size: 2.3rem; }
.gcarhero { display: flex; align-items: center; gap: 22px; }
.gcarhero__name { font-weight: 900; font-size: 1.5rem; line-height: 1.2; }

/* ── Timeline ─────────────────────────────────────────────────────────── */
.gtimeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gtimeline__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gtimeline__what { flex: 1; color: var(--cli-ink); }
.gtimeline__who { color: var(--cli-hint); font-size: .85rem; }

/* The repair order's route (VisitRoute) — MapleWF's approval route in clinic paint: a segmented
   bar, then a rail of state dots joined by a connector that turns green behind the car. */
.groute__bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.groute__seg { height: 8px; border-radius: 999px; background: var(--cli-line); }
.groute__seg--done, .groute__seg--skip { background: var(--cli-ok); }
.groute__seg--skip { opacity: .45; }
.groute__seg--now { background: linear-gradient(90deg, var(--cli-warn) 0 50%, var(--cli-line) 50% 100%); }
.groute__seg--stop { background: var(--cli-danger); }
.groute__caption { margin: 8px 0 18px; font-size: .85rem; font-weight: 700; color: var(--cli-muted); }

.groute__list { list-style: none; margin: 0; padding: 0; }
.groute__step { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; }
.groute__rail { display: flex; flex-direction: column; align-items: center; }
.groute__dot { width: 26px; height: 26px; flex: none; box-sizing: border-box; border-radius: 999px;
    display: grid; place-items: center; border: 2px solid var(--cli-line); background: var(--cli-field-bg); color: var(--cli-muted); }
.groute__dot .mud-icon-root { font-size: 15px; }
.groute__line { width: 2px; flex: 1; min-height: 22px; background: var(--cli-line); }
.groute__body { padding: 2px 0 20px; min-width: 0; }
.groute__step:last-child .groute__body { padding-bottom: 0; }
.groute__name { font-weight: 800; color: var(--cli-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.groute__tag { font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--cli-warn) 18%, transparent); color: var(--cli-warn); }
.groute__skip { font-size: .8rem; font-weight: 600; color: var(--cli-hint); }
.groute__event { margin-top: 6px; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.groute__note { color: var(--cli-ink); font-size: .92rem; }
.groute__who { color: var(--cli-hint); font-size: .8rem; }

.groute__step--done .groute__dot { border-color: var(--cli-ok); color: var(--cli-ok);
    background: color-mix(in srgb, var(--cli-ok) 14%, var(--cli-field-bg)); }
.groute__step--done .groute__line, .groute__step--skip .groute__line { background: var(--cli-ok); opacity: .45; }
.groute__step--now .groute__dot { border-color: var(--cli-warn);
    background: color-mix(in srgb, var(--cli-warn) 16%, var(--cli-field-bg)); animation: groute-pulse 2s infinite; }
.groute__pip { width: 9px; height: 9px; border-radius: 999px; background: var(--cli-warn); }
.groute__step--stop .groute__dot { border-color: var(--cli-danger); color: var(--cli-danger);
    background: color-mix(in srgb, var(--cli-danger) 14%, var(--cli-field-bg)); }
.groute__step--stop .groute__tag { background: color-mix(in srgb, var(--cli-danger) 16%, transparent); color: var(--cli-danger); }
.groute__step--skip .groute__dot { border-style: dashed; }
.groute__step--skip .groute__name, .groute__step--todo .groute__name { color: var(--cli-hint); font-weight: 700; }
.groute__step--todo .groute__dot { border-style: dashed; opacity: .7; }
@keyframes groute-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cli-warn) 45%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cli-warn) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .groute__step--now .groute__dot { animation: none; } }

/* ── Roles (Staff & roles) ─────────────────────────────────────────────── */
.groles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.grole { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px;
    padding: 14px; border-radius: 14px; background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); color: var(--cli-ink); }
.grole.is-on { border-color: var(--cli-accent-ink); background: var(--cli-panel-solid); box-shadow: inset 0 0 0 1px var(--cli-accent-ink); }
.grole:disabled { cursor: default; opacity: .75; }
.grole__name { font-weight: 800; }
.grole__hint { color: var(--cli-muted); font-size: .85rem; }

/* Clinic panels stack with air between them. */
.cli-editor-shell .form-page > .cli-panel + .cli-panel { margin-top: 0; }

@media (max-width: 640px) {
    .gappt__card { flex-wrap: wrap; }
    .gappt__side { flex-direction: row; align-items: center; }
    .ghome { padding-top: 24px; gap: 20px; }
    .ghome__title { font-size: 1.5rem; }
    .ghome__tile { min-height: 132px; }
    .gsetup__grid { grid-template-columns: 1fr; }
    .gsetup__tile { min-height: 0; }
}

/* ── The appointment book (/clinic/appointments) on the core booking screens ── */
.gbook { gap: 16px; }
.gbook__cols { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .gbook__cols { grid-template-columns: 1fr; } }
.gbook__side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gbook__n { min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; display: inline-grid; place-items: center;
    font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--cli-ink) 10%, transparent); }
.bk-chip.is-on .gbook__n { background: color-mix(in srgb, var(--cli-on-accent) 24%, transparent); }
.gbook__list { display: flex; flex-direction: column; padding: 6px; overflow: hidden; }
.gbook__dayhead { display: flex; align-items: center; gap: 6px; padding: 12px 12px 4px; font-size: .78rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--cli-hint); }
.gbook__card { display: flex; align-items: flex-start; gap: 14px; padding: 14px; text-decoration: none; color: var(--cli-ink);
    border-top: 1px solid var(--cli-line); border-left: 3px solid var(--s, transparent); }
.gbook__card:first-child, .gbook__dayhead + .gbook__card { border-top-color: transparent; }
.gbook__card--booked { --s: var(--bk-booked); }
.gbook__card--confirmed { --s: var(--bk-booked); }
.gbook__card--arrived { --s: var(--bk-arrived); }
.gbook__card--cancelled, .gbook__card--noshow { --s: var(--bk-alert); opacity: .65; }
.gbook__time { font-size: 1.25rem; font-weight: 800; min-width: 5.4ch; color: var(--cli-accent-ink); }
.gbook__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gbook__name { font-weight: 800; }
.gbook__phone { font-weight: 600; color: var(--cli-muted); margin-inline-start: 8px; }
.gbook__meta { color: var(--cli-ink); }
.gbook__issue { color: var(--cli-muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbook__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gbook__bay { font-size: .78rem; font-weight: 700; color: var(--cli-hint); }

/* ── The booking sheet (ClinicBookingSheet) ── */
.gsheet { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.gsheet__head { display: flex; align-items: center; gap: 10px; }
.gsheet__title { font-size: 1.3rem; font-weight: 800; }
.gsheet__close { margin-inline-start: auto; height: 36px; padding: 0 12px; }
.gsheet__group { display: flex; flex-direction: column; gap: 8px; }
.gsheet__label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cli-hint); }
.gsheet__day { font-size: 1.1rem; font-weight: 700; }
.gsheet__hint { font-size: .85rem; color: var(--cli-muted); }
.gsheet__error { font-size: .88rem; font-weight: 600; color: var(--bk-alert); }
.gsheet__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
@media (max-width: 700px) { .gsheet__row { grid-template-columns: 1fr; } }
.gsheet__lead { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; touch-action: manipulation;
    height: 52px; border-radius: 14px; border: 0; background: var(--cli-accent-gradient); color: var(--cli-on-accent); font-weight: 800; font-size: 1rem; }
.gsheet__lead:disabled { opacity: .55; cursor: default; }

/* The day book's commands (‹ Today ›) on the title row. */
.gdaybook { gap: 14px; }

/* "+2" after a customer card's car logos (the directory shows up to three). */
.gcars__more { font-weight: 800; color: var(--cli-muted); font-size: .9rem; }

/* ── Visit statuses (the RO the whole shop watches) ───────────────────────── */
.cli-status--checkedin { background: color-mix(in srgb, #3b82c4 16%, transparent); color: #3b82c4; }
.cli-status--inspecting, .cli-status--inrepair { background: color-mix(in srgb, #c98a2b 18%, transparent); color: #a86f14; }
.cli-status--awaitingapproval, .cli-status--waitingparts { background: color-mix(in srgb, #8a63d2 16%, transparent); color: #7652c0; }
.cli-status--qualitycheck, .cli-status--readyforpickup { background: color-mix(in srgb, #3fa34d 16%, transparent); color: #2f8a3c; }
.cli-status--handedover { background: color-mix(in srgb, var(--cli-muted) 16%, transparent); color: var(--cli-muted); }
.theme-dark .cli-status--checkedin { color: #8cc0ee; }
.theme-dark .cli-status--inspecting, .theme-dark .cli-status--inrepair { color: #f0c27a; }
.theme-dark .cli-status--awaitingapproval, .theme-dark .cli-status--waitingparts { color: #b9a0f0; }
.theme-dark .cli-status--qualitycheck, .theme-dark .cli-status--readyforpickup { color: #7fd6a4; }

/* ── Segmented touch choice (fuel, quick-check result) ────────────────────── */
.gseg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gseg__opt {
    -webkit-appearance: none; appearance: none; font: inherit; font-weight: 800; cursor: pointer; touch-action: manipulation;
    min-width: 56px; min-height: 48px; padding: 0 14px; border-radius: 12px;
    color: var(--cli-ink); background: var(--cli-field-bg); border: 1.5px solid var(--cli-line);
}
.gseg__opt.is-on { background: var(--cli-accent-gradient); color: var(--cli-on-accent); border-color: transparent; }
.gseg--sm .gseg__opt { min-height: 42px; min-width: 0; padding: 0 12px; font-size: .9rem; }
.gseg__opt--ok.is-on { background: #2a9d66; }
.gseg__opt--attention.is-on { background: #c98a2b; }
.gseg__opt--urgent.is-on { background: var(--cli-danger); }
.gseg__opt--notchecked.is-on { background: var(--cli-panel-solid); color: var(--cli-muted); border-color: var(--cli-line); }

/* ── Quick check rows ─────────────────────────────────────────────────────── */
.gchk { display: flex; flex-direction: column; }
.gchk__row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--cli-line); }
.gchk__row:first-child { border-top: none; }
.gchk__item { flex: 1 1 200px; font-weight: 700; }
.gchk__note { flex: 1 1 100%; }
.gchk__result { font-weight: 800; font-size: .9rem; }
.gchk__result--ok { color: #2a9d66; }
.gchk__result--attention { color: #c98a2b; }
.gchk__result--urgent { color: var(--cli-danger); }
.gchk__result--notchecked { color: var(--cli-muted); }
.gchk__seen { flex: 1 1 100%; color: var(--cli-muted); font-size: .92rem; }

/* ── Check-in & visit layout ──────────────────────────────────────────────── */
.gcheckin { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.gcheckin__foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 24px; }
.cli-btn--lg { min-height: 60px; padding: 0 36px; font-size: 1.15rem; }
.gvisit { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .gvisit { grid-template-columns: 1fr; } }
.gvisit__main, .gvisit__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gvisit__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gvisit__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gvisit__concerns { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 6px; font-size: 1.05rem; }
.gkv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.gkv > span { color: var(--cli-muted); }
.gkv > strong { text-align: right; }
.gcar--busy { opacity: .75; border-style: dashed; }

/* ── Customer-facing pages (receipt link) ─────────────────────────────────── */
.gpublic { min-height: 100dvh; box-sizing: border-box; padding: 20px 16px 40px; background: #eef2f6; }
.gpublic__gone { max-width: 420px; margin: 15vh auto 0; text-align: center; color: #1c2733; font-family: system-ui, sans-serif; }
.gpublic__gone h1 { font-size: 1.4rem; }

/* ── Visit pictures ───────────────────────────────────────────────────────── */
.gchk__cam { position: relative; min-height: 42px; padding: 0 12px; overflow: hidden; cursor: pointer; }
.gchk__file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gchk__photos { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.gchk__photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--cli-line); }
.gvisit__signature { display: block; width: 100%; max-height: 150px; object-fit: contain; background: #fff; border-radius: 12px; }

/* ── Parts & suppliers ────────────────────────────────────────────────────── */
.gparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.gpart {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border-radius: 16px; min-height: 84px;
    color: var(--cli-ink); text-decoration: none; background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border);
}
.gpart:hover { border-color: color-mix(in srgb, var(--cli-accent-ink) 40%, transparent); }
.gpart.is-low { border-color: color-mix(in srgb, #c98a2b 55%, transparent); }
.gpart.is-inactive { opacity: .6; }
.gpart__no { font-weight: 900; letter-spacing: .03em; }
.gpart__desc { grid-column: 1; color: var(--cli-ink); }
.gpart__meta { grid-column: 1; color: var(--cli-muted); font-size: .9rem; }
.gpart__qty { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; color: var(--cli-muted); }
.gpart__qty strong { display: block; font-size: 1.6rem; color: var(--cli-ink); line-height: 1.1; }
.gpart__low { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: #fff; background: #c98a2b; padding: 2px 8px; border-radius: 999px; }
/* Parts catalogue: a rail of sections beside the section lists (ClinicParts). */
.gcat { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.gcat__rail { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 16px; background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); }
.gcat__tab {
    -webkit-appearance: none; appearance: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px;
    border: none; border-radius: 12px; background: none; font: inherit; color: var(--cli-ink); text-align: left; cursor: pointer;
}
.gcat__tab:hover { background: color-mix(in srgb, var(--cli-accent-ink) 8%, transparent); }
.gcat__tab.is-on { background: color-mix(in srgb, var(--cli-accent-ink) 14%, transparent); color: var(--cli-accent-ink); font-weight: 800; }
.gcat__icon { flex: none; color: var(--cli-accent-ink); }
.gcat__name { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.gcat__count { flex: none; min-width: 28px; text-align: right; color: var(--cli-muted); font-variant-numeric: tabular-nums; }
.gcat__low { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #c98a2b; color: #fff; font-size: .75rem; font-weight: 800; text-align: center; }
.gcat__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gcat__sec { border-radius: 16px; background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); overflow: hidden; }
.gcat__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--cli-line); }
.gcat__title { margin: 0; font-size: 1.1rem; font-weight: 900; }
.gcat__sub { margin-left: auto; color: var(--cli-muted); font-size: .9rem; }
.gcat__list { display: flex; flex-direction: column; }
.gcat__row {
    display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) 80px 90px 110px; align-items: center; gap: 4px 16px;
    min-height: 60px; padding: 8px 16px; border-top: 1px solid var(--cli-line); color: var(--cli-ink); text-decoration: none;
}
.gcat__row:first-child { border-top: none; }
.gcat__row:hover { background: color-mix(in srgb, var(--cli-accent-ink) 6%, transparent); }
.gcat__row.is-low { box-shadow: inset 4px 0 0 #c98a2b; }
.gcat__no { font-weight: 900; letter-spacing: .03em; overflow-wrap: anywhere; }
.gcat__what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcat__desc { color: var(--cli-ink); }
.gcat__brand { color: var(--cli-muted); font-size: .9rem; }
.gcat__bin { color: var(--cli-muted); font-size: .9rem; }
.gcat__price { text-align: right; font-variant-numeric: tabular-nums; }
.gcat__qty { text-align: right; color: var(--cli-muted); }
.gcat__qty strong { font-size: 1.2rem; color: var(--cli-ink); font-variant-numeric: tabular-nums; }
.gcat__qty .gpart__low { margin: 0 0 0 6px; }
@media (max-width: 900px) {
    /* The rail becomes a strip of chips above the lists. */
    .gcat { grid-template-columns: minmax(0, 1fr); }
    .gcat__rail { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
    .gcat__tab { flex: none; min-height: 44px; }
    .gcat__name { white-space: nowrap; }
    .gcat__row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
    .gcat__no, .gcat__what, .gcat__bin { grid-column: 1; }
    .gcat__price { grid-column: 2; grid-row: 1; }
    .gcat__qty { grid-column: 2; grid-row: 2 / span 2; }
}
.cli-btn.is-on { border-color: var(--cli-accent-ink); color: var(--cli-accent-ink); }
.gmove { min-width: 52px; font-weight: 900; }
.gmove.is-in { color: #2a9d66; }
.gmove.is-out { color: var(--cli-danger); }
.gstockrow { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--cli-line); }
.gstockrow:first-child { border-top: none; }
.gstockrow__what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gstockrow__note { color: var(--cli-ink); }
.gstockrow__who { color: var(--cli-muted); font-size: .85rem; }
.gmore { -webkit-appearance: none; appearance: none; background: none; border: none; font: inherit; font-weight: 800; color: var(--cli-accent-ink); cursor: pointer; padding: 4px 0; }

/* ── Orders & counts ──────────────────────────────────────────────────────── */
.gorder { display: flex; flex-direction: column; }
.gorder__row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--cli-line); }
.gorder__row:first-child { border-top: none; }
.gorder__row.is-in { opacity: .7; }
.gorder__row.is-changed .gorder__what strong { color: #c98a2b; }
.gorder__what { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.gorder__sub { color: var(--cli-muted); font-size: .9rem; }
.gorder__got { font-weight: 700; color: var(--cli-muted); }
.gorder__got .is-ok { color: #2a9d66; }
.gorder__acts { display: flex; gap: 6px; }
.gorder__recv { display: grid; grid-template-columns: 110px 130px; gap: 10px; }
.gorder__total { display: flex; justify-content: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid var(--cli-line); }
.gcount { width: 130px; }
.gpicklist { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.glowbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Orders list + one order (ClinicOrders / ClinicOrderDetail) — the catalogue's section/row look. */
.gpo-empty { display: flex; flex-direction: column; gap: 4px; }
.gpo-none { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; color: var(--cli-muted); }
.gpo-more { display: block; width: 100%; padding: 12px; border: none; border-top: 1px solid var(--cli-line); background: none; font: inherit; font-weight: 800; color: var(--cli-accent-ink); cursor: pointer; }
.gcat__sec + .gcat__sec { margin-top: 16px; }
.gcat__row.gpo-row { grid-template-columns: minmax(0, 1fr) 110px minmax(150px, auto); }
.gpo-row.is-late { box-shadow: inset 4px 0 0 #c98a2b; }
.gpo-row.is-done .gpo-row__who strong, .gpo-row.is-done .gpo-row__total { color: var(--cli-muted); }
.gpo-row__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gpo-row__sub { display: block; color: var(--cli-muted); font-size: .9rem; }
.gpo-row__total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.gpo-row__state { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.gpo-due { font-size: .85rem; font-weight: 700; color: var(--cli-muted); white-space: nowrap; }
.gpo-due.is-late { color: #fff; background: #c98a2b; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: .78rem; }
.gpo-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* In a dialog (portalled outside the themed shell): MudBlazor's palette, not the --gar tokens. */
.gpo-sups { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.gpo-sup { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 12px;
    border: 1.5px solid var(--mud-palette-lines-default); background: transparent; color: var(--mud-palette-text-primary); font: inherit; text-align: left; cursor: pointer; }
.gpo-sup:hover { background: var(--mud-palette-action-default-hover); }
.gpo-sup.is-on { border-color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent); }
.gpo-sup__name { font-weight: 800; }
.gpo-sup__meta { color: var(--mud-palette-text-secondary); font-size: .85rem; }
.gpo-sup__open { color: #c98a2b; font-weight: 700; }
.gpo-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px;
    background: color-mix(in srgb, #c98a2b 12%, transparent); border: 1px solid color-mix(in srgb, #c98a2b 35%, transparent); font-size: .9rem; color: var(--mud-palette-text-primary); }
.gpo-hint__go { font-weight: 800; color: var(--mud-palette-primary); text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }

.gpo-sup-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; }
.gpo-sup-strip__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gpo-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 12px; flex-wrap: wrap; }
.gpo-note .mud-input-control { flex: 1 1 100%; }
.gpo-note__text { flex: 1 1 0; min-width: 0; white-space: pre-line; padding-top: 2px; }
.gpo-note__acts { display: flex; gap: 8px; }

.gpo-line { display: grid; grid-template-columns: minmax(0, 1fr) 60px 100px 100px 190px; align-items: center; gap: 4px 16px;
    min-height: 60px; padding: 8px 16px; border-top: 1px solid var(--cli-line); }
.gcat__list > .gpo-line:first-child { border-top: none; }
.gpo-line--head { min-height: 0; padding-top: 8px; padding-bottom: 8px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--cli-muted); border-top: none; border-bottom: 1px solid var(--cli-line); }
.gpo-line--head > span:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.gpo-line.is-in .gpo-line__what, .gpo-line.is-in .gpo-line__qty, .gpo-line.is-in .gpo-line__each, .gpo-line.is-in .gpo-line__total { opacity: .6; }
.gpo-line__what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gpo-line__no { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: .03em; }
.gpo-line__desc { color: var(--cli-ink); }
.gpo-line__qty { text-align: right; }
.gpo-line__qty strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.gpo-line__each, .gpo-line__total { text-align: right; font-variant-numeric: tabular-nums; }
.gpo-line__each { color: var(--cli-muted); }
.gpo-line__total { font-weight: 800; }
.gpo-line__end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.gpo-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    background: color-mix(in srgb, var(--cli-muted) 18%, transparent); color: var(--cli-muted); text-decoration: none; }
.gpo-tag--ro { background: color-mix(in srgb, #8a63d2 16%, transparent); color: #8a63d2; text-transform: none; }
.gpo-got { font-weight: 700; color: var(--cli-muted); white-space: nowrap; margin-right: auto; }
.gpo-got.is-ok { color: #2a9d66; }
.gpo-got.is-part { color: var(--cli-warn); }
.gpo-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
    border: 1.5px solid var(--cli-panel-border); background: transparent; color: var(--cli-accent-ink); cursor: pointer; }
.gpo-icon:hover { background: color-mix(in srgb, var(--cli-accent-ink) 8%, transparent); }
.gpo-icon--danger { color: var(--cli-danger); }
.gpo-icon:disabled { opacity: .5; cursor: default; }

.gpo-line--recv { grid-template-columns: minmax(0, 1fr) auto 90px 140px; }
.gpo-line--recv.is-none .gpo-line__what { opacity: .55; }
.gpo-line--recv .gpo-got { grid-column: 2 / -1; justify-self: end; margin: 0; }
.gpo-step { display: inline-flex; align-items: center; gap: 6px; }
.gpo-step__btn { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--cli-panel-border); background: transparent; color: var(--cli-ink);
    font: inherit; font-size: 1.5rem; font-weight: 800; line-height: 1; cursor: pointer; }
.gpo-step__btn:disabled { opacity: .4; cursor: default; }
.gpo-step__val { display: flex; flex-direction: column; align-items: center; min-width: 56px; line-height: 1.1; }
.gpo-step__val strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.gpo-step__val small { color: var(--cli-muted); font-size: .78rem; }
.gpo-recv-quick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.gpo-foot { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--cli-line); }
.gpo-foot strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.gpo-foot__sub { margin-right: auto; color: var(--cli-muted); font-size: .9rem; }
.gpo-actions { margin-top: 16px; }
.gpo-actions__gap { flex: 1 1 auto; }

.gpo-offer__cap { margin: 12px 0 4px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--mud-palette-text-secondary); }
.gpo-offers { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.gpo-offer { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0 12px; min-height: 48px; padding: 8px 12px; border-radius: 10px;
    border: 1.5px solid var(--mud-palette-lines-default); background: transparent; color: var(--mud-palette-text-primary); font: inherit; text-align: left; cursor: pointer; }
.gpo-offer:hover { background: var(--mud-palette-action-default-hover); }
.gpo-offer.is-on { border-color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent); }
.gpo-offer__no { font-weight: 900; letter-spacing: .03em; overflow-wrap: anywhere; }
.gpo-offer__desc { min-width: 0; }
.gpo-offer__have { grid-column: 2; color: var(--mud-palette-text-secondary); font-size: .85rem; }
.gpo-offer__have .gpart__low { margin: 0 6px 0 0; }
.gpo-offer__have em { font-style: normal; color: #c98a2b; font-weight: 700; }
.gpo-offer__note { margin: 10px 0 8px; color: var(--mud-palette-text-secondary); }

@media (max-width: 720px) {
    .gcat__row.gpo-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .gpo-row__who { grid-column: 1 / -1; }
    .gpo-row__total { grid-column: 1; grid-row: 2; text-align: left; }
    .gpo-row__state { grid-column: 2; grid-row: 2; }
    .gpo-lines .gcat__head { flex-wrap: wrap; }
    .gpo-lines .gcat__head .gcat__sub { flex-basis: 100%; margin-left: 0; }
    .gpo-line--head { display: none; }
    .gpo-line { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px; }
    .gpo-line__what { grid-column: 1 / -1; }
    .gpo-line__qty { grid-column: 1; grid-row: 2; text-align: left; display: flex; align-items: baseline; gap: 6px; }
    .gpo-line__qty::after { content: "×"; color: var(--cli-muted); }
    .gpo-line__each { display: none; }
    .gpo-line__total { grid-column: 2; grid-row: 2; }
    .gpo-line__end { grid-column: 1 / -1; }
    .gpo-line--recv { grid-template-columns: auto minmax(0, 1fr); }
    .gpo-line--recv .gpo-step { grid-column: 1; }
    .gpo-line--recv .gpo-recv-quick { grid-column: 2; flex-direction: row; gap: 16px; }
    .gpo-line--recv .gpo-recv-cost { grid-column: 1 / -1; }
    .gpo-line--recv .gpo-got { grid-column: 1 / -1; justify-self: start; }
}

/* ── Inspect & quote ──────────────────────────────────────────────────────── */
.gurg { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.gurg--safety { background: color-mix(in srgb, var(--cli-danger) 16%, transparent); color: var(--cli-danger); }
.gurg--soon { background: color-mix(in srgb, #c98a2b 18%, transparent); color: #b7791f; }
.gurg--monitor { background: color-mix(in srgb, var(--cli-muted) 18%, transparent); color: var(--cli-muted); }
.gjob { border-left: 5px solid var(--cli-line); }
.gjob--proposed { border-left-color: #8a63d2; }
.gjob--approved { border-left-color: #2a9d66; }
.gjob--declined { border-left-color: var(--cli-danger); opacity: .75; }
.gjob__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.gjob__title { font-weight: 900; font-size: 1.1rem; }
.gjob__state { color: var(--cli-muted); font-weight: 700; }
.gjob__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--cli-line); }
.gjob__adds { display: flex; flex-wrap: wrap; gap: 6px; }
.gjob__total { display: flex; align-items: baseline; gap: 12px; margin-left: auto; }
.gjob__total strong { font-size: 1.2rem; }
.gline { display: inline-block; min-width: 64px; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--cli-muted); }
.gfind { padding: 10px 0; border-top: 1px solid var(--cli-line); display: flex; flex-direction: column; gap: 4px; }
.gfind:first-of-type { border-top: none; }
.gfind__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ganswer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cli-line); }
.grecs { border-left: 5px solid #c98a2b; }
.grecs__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.gbadge { margin-left: 6px; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.22); }

/* ── Work & board ─────────────────────────────────────────────────────────── */
.gwork { border-left: 5px solid var(--cli-line); }
.gwork--working { border-left-color: #2a9d66; }
.gwork--paused { border-left-color: #c98a2b; }
.gwork--done { border-left-color: var(--cli-muted); opacity: .8; }
.gwork__state { color: var(--cli-muted); font-weight: 700; }
.gwork__techs { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.gwork__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.gwork__bar .cli-panel__title { margin: 0 auto 0 0; }
.gboard { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.gboard__col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gboard__head { font-weight: 900; text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; color: var(--cli-muted); display: flex; justify-content: space-between; align-items: center; }
.gboard__card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); color: var(--cli-ink); text-decoration: none; }
.gboard__card.is-late { border-color: var(--cli-danger); }
.gboard__top { display: flex; align-items: center; gap: 8px; }
.gboard__promise { font-size: .85rem; font-weight: 700; color: var(--cli-muted); }
.gboard__promise.is-late { color: var(--cli-danger); }
.gbadge--dark { background: var(--cli-panel-solid); color: var(--cli-ink); }
.gboard--4 { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.gboard--3 { grid-template-columns: repeat(3, minmax(220px, 1fr)); }

/* ── Data (/clinic/settings/data): backup ⇄ restore, demo shop, reset ─────────────────────── */
.gdata .cli-panel + .cli-panel { margin-top: 16px; }
.gdata__row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--cli-line); }
.gdata__row:first-of-type { border-top: none; }
.gdata__row--stacked { flex-direction: column; align-items: stretch; gap: 10px; }
.gdata__row--stacked > .cli-btn, .gdata__row--stacked .mud-file-upload { align-self: flex-start; }
.gdata__row-body { flex: 1; min-width: 0; }
.gdata__row-title { font-weight: 800; color: var(--cli-ink); }
.gdata__row-desc { font-size: .88rem; color: var(--cli-muted); }
.gdata__danger { border-color: color-mix(in srgb, var(--cli-danger) 35%, var(--cli-panel-border));
                 background: color-mix(in srgb, var(--cli-danger) 5%, var(--cli-panel-solid)); }
.gdata__backup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .82rem; color: var(--cli-muted); }
.gdata__backup code { word-break: break-all; }
.gdata__backup-size { font-weight: 700; }
.gdata__receipt { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: .88rem; }
.gdata__receipt th, .gdata__receipt td { padding: 4px 8px; border-bottom: 1px solid var(--cli-line); text-align: left; }
.gdata__receipt .num { text-align: right; }
.gdata__lede { margin: 0 0 8px; color: var(--cli-muted); }
.gdata__reset-list { list-style: none; margin: 0; padding: 0; }
.gdata__reset-row { display: flex; align-items: flex-start; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--cli-line); }
.gdata__reset-row.is-cascaded { opacity: .75; }
.gdata__reset-body { flex: 1; cursor: pointer; padding-top: 6px; }
.gdata__reset-title { font-weight: 700; }
.gdata__reset-desc { font-size: .85rem; color: var(--cli-muted); }
.gdata__tag { margin-left: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--cli-danger); }
.gdata__confirm-list { margin: 6px 0 0; padding-left: 20px; }

/* ── Phones (≤640px) ────────────────────────────────────────────────────────────────────────
   form.css stacks the title row into a column here; these make what stacks fit the screen.
   The command slot STRETCHES to the row (the base rule's align-items: flex-start sized it to its
   content, so a 440px search box ran off a 390px iPhone), and whatever rides in it — a search box,
   a pair of buttons — shrinks with it. Boards stop being side-by-side columns you have to swipe
   and read top to bottom, one status after another. */
@media (max-width: 640px) {
    .form-page { padding-left: .75rem; padding-right: .75rem; }
    /* form.css turns the row into a column here. In a column, core's flex-basis: 100% means 100% of
       the HEIGHT and wrap starts a second column — together they parked the commands off to the right. */
    .form-page-header { align-items: stretch; flex-wrap: nowrap; }
    .tpage__cmds { flex-basis: auto; width: 100%; min-width: 0; }
    .tpage__cmds > * { max-width: 100%; min-width: 0; }
    .gsearch { flex: 1 1 100%; width: 100%; }
    .cli-btn { white-space: normal; height: auto; min-height: 44px; }
    .gboard, .gboard--3, .gboard--4 { grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
    /* The Back / Home cluster is fixed to the corner so it never scrolls away — on a phone that means
       it floats over whatever scrolls under it (a signature pad, a card). A solid disc keeps it
       legible and reads as a control, not a stray glyph on the content. */
    .touch-page-chrome .tpage__btn { background: var(--cli-page-1); border: 1px solid var(--cli-panel-border);
        box-shadow: 0 4px 14px var(--cli-shadow); border-radius: 999px; }
}

/* A part's "fits" list and other numbers (part page). */
.gfits { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gfits__row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--cli-field-bg); border: 1px solid var(--cli-line); }
.gfits__text { flex: 1; min-width: 0; color: var(--cli-ink); }
.gfits__x { -webkit-appearance: none; appearance: none; border: none; background: none; cursor: pointer; font: inherit;
    font-size: 1.3rem; line-height: 1; width: 36px; height: 36px; border-radius: 999px; color: var(--cli-muted); }
.gfits__x:hover:not(:disabled) { background: color-mix(in srgb, var(--cli-danger) 12%, transparent); color: var(--cli-danger); }
/* The quote picker's verdict on each part for the RO's car. */
.gfit { font-size: .75rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.gfit--fits, .gfit--anycar { background: color-mix(in srgb, var(--cli-ok) 16%, transparent); color: var(--cli-ok); }
.gfit--notlisted { background: color-mix(in srgb, var(--cli-warn) 18%, transparent); color: var(--cli-warn); }

/* Home user menu: language buttons (MapleCoffee's chome__menu-langs, in clinic paint). */
.ghome__menu-langs { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--cli-line); }
.ghome__menu-lang { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; flex: 1;
    padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--cli-line); background: var(--cli-field-bg);
    color: var(--cli-ink); font-weight: 700; }
.ghome__menu-lang:hover { background: var(--touch-accent-soft); }
.ghome__menu-lang.is-active { border-color: var(--cli-accent-ink); color: var(--cli-accent-ink); }

/* ── Display: the Look card (ClinicDisplay) ───────────────────────────────── */
.glook { margin-bottom: 16px; }
.glook__head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.glook__title { margin: 0; font-size: 1.15rem; font-weight: 900; }
.glook__sub { color: var(--cli-muted); font-size: .9rem; }
.glook__modes { display: inline-flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--cli-field-bg); border: 1px solid var(--cli-line); margin-bottom: 14px; }
.glook__mode { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: none; border-radius: 10px; background: transparent;
    color: var(--cli-ink); font: inherit; font-weight: 800; cursor: pointer; }
.glook__mode.is-on { background: var(--cli-accent-gradient); color: var(--cli-on-accent); }
.glook__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.glook__choice { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; border: 2px solid var(--cli-line); background: var(--cli-field-bg);
    color: var(--cli-ink); font: inherit; cursor: pointer; text-align: left; }
.glook__choice.is-on { border-color: var(--cli-accent-ink); }
.glook__swatch { position: relative; display: block; align-self: stretch; width: 100%; box-sizing: border-box; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--cli-ink) 14%, transparent); }
/* The look's accent as a button on its page colour — the way the look reads on a real screen. */
.glook__swatch::before { content: ""; position: absolute; display: block; left: 10px; right: 40%; bottom: 10px; height: 18px; border-radius: 9px; background: var(--swatch-accent); }
.glook__swatch::after { content: ""; position: absolute; display: block; left: 10px; top: 10px; width: 28px; height: 18px; border-radius: 6px; background: var(--swatch-accent); opacity: .35; }
.glook__name { display: flex; justify-content: space-between; font-weight: 800; padding: 0 4px 2px; }
.glook__status { min-height: 1.2em; margin-top: 10px; color: var(--cli-muted); font-size: .9rem; }
.glook__doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.glook__door { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--cli-line); background: var(--cli-field-bg);
    color: var(--cli-ink); text-decoration: none; }
.glook__door:hover { border-color: var(--cli-accent-ink); }
.glook__door .mud-icon-root { color: var(--cli-accent-ink); flex: none; }
.glook__door span { display: flex; flex-direction: column; gap: 2px; }
.glook__door small { color: var(--cli-muted); font-size: .85rem; }

/* ── Wall TV screens (Components/Tv) — sized for a room, not a hand ────────── */
.gtv { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 2vh; padding: 3vh 3vw; color: var(--cli-ink); }
.gtv__head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.gtv__title-wrap { display: flex; align-items: center; gap: 1.2vw; }
.gtv__icon { font-size: clamp(2rem, 4vw, 3.4rem) !important; color: var(--cli-accent-ink); }
.gtv__title { margin: 0; font-size: clamp(1.8rem, 3.6vw, 3.2rem); font-weight: 900; }
.gtv__count { min-width: 1.6em; padding: .1em .5em; border-radius: 999px; background: var(--cli-accent-gradient); color: var(--cli-on-accent); font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 900; text-align: center; }
.gtv__clock { font-size: clamp(1.6rem, 3.2vw, 2.8rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.gtv__body { flex: 1; display: flex; flex-direction: column; gap: 1.2vh; border-radius: 24px; padding: 1.4vh 1.6vw; background: var(--cli-panel-solid); border: 1.5px solid var(--cli-panel-border); box-shadow: 0 12px 40px var(--cli-shadow); }
.gtv__empty { margin: auto; font-size: clamp(1.4rem, 2.6vw, 2.2rem); color: var(--cli-muted); font-weight: 700; }
.gtv__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(10vw, auto); align-items: center; gap: 2vw; padding: 1.3vh .6vw; border-bottom: 1px solid var(--cli-line); }
.gtv__row:last-child { border-bottom: none; }
.gtv__row.is-in { opacity: .6; }
.gtv__slot { font-size: clamp(1.3rem, 2.4vw, 2.1rem); font-weight: 900; font-variant-numeric: tabular-nums; color: var(--cli-accent-ink); }
.gtv__row:has(.gtv__slot) { grid-template-columns: 11vw minmax(0, 1fr) auto; }
.gtv__car { display: flex; flex-direction: column; min-width: 0; }
.gtv__car strong { font-size: clamp(1.3rem, 2.4vw, 2.1rem); font-weight: 900; line-height: 1.15; }
.gtv__who { font-size: clamp(1rem, 1.7vw, 1.5rem); color: var(--cli-muted); font-weight: 600; }
.gtv__stage { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.gtv__chip { padding: .3em .9em; border-radius: 999px; font-size: clamp(1rem, 1.7vw, 1.5rem); font-weight: 900; white-space: nowrap;
    background: color-mix(in srgb, #3b82c4 18%, transparent); color: #3b82c4; }
.gtv__chip--waitingforyou { background: color-mix(in srgb, #8a63d2 18%, transparent); color: #8a63d2; }
.gtv__chip--beingrepaired { background: color-mix(in srgb, #c98a2b 20%, transparent); color: #b0761c; }
.gtv__chip--ready { background: color-mix(in srgb, #2a9d66 20%, transparent); color: #1f8a57; }
.theme-dark .gtv__chip { color: #9cc7ee; }
.theme-dark .gtv__chip--beingrepaired { color: #f0c27a; }
.theme-dark .gtv__chip--ready { color: #7fd6a4; }
.theme-dark .gtv__chip--waitingforyou { color: #b9a0f0; }
.gtv__note { font-size: clamp(.85rem, 1.3vw, 1.15rem); color: var(--cli-warn); font-weight: 700; }
.gtv__when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.gtv__when small { font-size: clamp(.8rem, 1.2vw, 1.05rem); color: var(--cli-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.gtv__when strong { font-size: clamp(1.2rem, 2.2vw, 1.9rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.gtv__in { color: var(--cli-ok); }
.gtv__ready { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6vw; flex: 1; align-content: start; }
.gtv__card { display: flex; flex-direction: column; gap: .6vh; padding: 2.4vh 1.6vw; border-radius: 20px; background: color-mix(in srgb, #2a9d66 12%, transparent); border: 2px solid color-mix(in srgb, #2a9d66 40%, transparent); }
.gtv__card-ic { font-size: clamp(2rem, 3.4vw, 3rem) !important; color: var(--cli-ok); }
.gtv__card strong { font-size: clamp(1.4rem, 2.6vw, 2.3rem); font-weight: 900; line-height: 1.1; }
.gtv__card span { font-size: clamp(1.1rem, 1.9vw, 1.7rem); color: var(--cli-muted); font-weight: 700; }
.gtv__foot { text-align: center; font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 700; color: var(--cli-muted); padding-top: 1vh; }
.gtv__pages { display: flex; justify-content: center; gap: 10px; }
.gtv__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cli-line); }
.gtv__dot.is-on { background: var(--cli-accent-ink); }

.gtvw { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; box-sizing: border-box; }
.gtvw__card { display: flex; flex-direction: column; align-items: center; gap: 2vh; padding: 6vh 6vw; border-radius: 32px; text-align: center; color: var(--cli-ink);
    background: var(--cli-panel); border: 1.5px solid var(--cli-panel-border); box-shadow: 0 20px 60px var(--cli-shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.gtvw__logo { max-height: 16vh; max-width: 40vw; object-fit: contain; }
.gtvw__greet { font-size: clamp(1.3rem, 2.6vw, 2.2rem); font-weight: 800; color: var(--cli-accent-ink); }
.gtvw__name { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 900; line-height: 1.05; }
.gtvw__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh 3vw; font-size: clamp(1.1rem, 2.1vw, 1.8rem); font-weight: 700; color: var(--cli-muted); }
.gtvw__meta span { display: inline-flex; align-items: center; gap: 8px; }
.gtvw__clock { font-size: clamp(2rem, 4.4vw, 3.8rem); font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── Car status kiosk (ClinicKiosk) — a tablet in the waiting room ─────────── */
.gkiosk { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; }
.gkiosk__staff { position: fixed; top: 12px; right: 14px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
    color: var(--cli-muted); opacity: .45; text-decoration: none; font-size: 1.3rem; }
.gkiosk__card { width: min(460px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 28px; border-radius: 28px;
    background: var(--cli-panel-solid); border: 1.5px solid var(--cli-panel-border); box-shadow: 0 20px 60px var(--cli-shadow); color: var(--cli-ink); }
.gkiosk__card--wide { width: min(760px, 100%); }
.gkiosk__title { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 900; text-align: center; line-height: 1.15; }
.gkiosk__sub { margin: -6px 0 0; text-align: center; color: var(--cli-muted); font-size: 1.05rem; }
.gkiosk__phone { min-height: 64px; display: grid; place-items: center; border-radius: 16px; background: var(--cli-field-bg); border: 1.5px solid var(--cli-line);
    font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.gkiosk__phone.is-empty { color: var(--cli-hint); font-weight: 600; font-size: 1.4rem; letter-spacing: 0; }
.gkiosk__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gkiosk__key { min-height: 72px; border-radius: 18px; border: 1.5px solid var(--cli-line); background: var(--cli-field-bg); color: var(--cli-ink);
    font: inherit; font-size: 1.8rem; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.gkiosk__key:active { background: color-mix(in srgb, var(--cli-accent-ink) 16%, transparent); }
.gkiosk__key--soft { color: var(--cli-muted); font-size: 1.4rem; }
.gkiosk__go { width: 100%; justify-content: center; min-height: 64px; font-size: 1.25rem; }
.gkiosk__car { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 20px; background: var(--cli-field-bg); border: 1.5px solid var(--cli-line); }
.gkiosk__car-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gkiosk__car-head strong { font-size: 1.4rem; font-weight: 900; }
.gkiosk__car-head span { color: var(--cli-muted); font-weight: 800; }
.gkiosk__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gkiosk__step { position: relative; padding: 30px 4px 0; text-align: center; font-size: .85rem; font-weight: 700; color: var(--cli-muted); line-height: 1.2; }
.gkiosk__step::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%;
    background: var(--cli-line); border: 3px solid var(--cli-panel-solid); box-shadow: 0 0 0 2px var(--cli-line); }
.gkiosk__step.is-done::before { background: var(--cli-ok); box-shadow: 0 0 0 2px var(--cli-ok); }
.gkiosk__step.is-now { color: var(--cli-ink); font-weight: 900; }
.gkiosk__step.is-now::before { background: var(--cli-accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cli-accent-ink) 30%, transparent); }
.gkiosk__facts { display: flex; flex-direction: column; gap: 8px; }
.gkiosk__fact { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--cli-accent-ink) 8%, transparent); font-weight: 700; }
.gkiosk__fact--ok { background: color-mix(in srgb, #2a9d66 14%, transparent); color: var(--cli-ok); }
.gkiosk__fact--warn { background: var(--touch-warn-bg); color: var(--cli-warn); }

/* ── Clinic appointment statuses (MK.CLINIC P2): Pending waits for the desk, Completed is the visit done. ── */
.cli-status--pending { background: color-mix(in srgb, #c98a2b 18%, transparent); color: #a86f14; }
.cli-status--completed { background: color-mix(in srgb, #6b7686 16%, transparent); color: #5b6573; }
.theme-dark .cli-status--pending { color: #e2b56a; }
.theme-dark .cli-status--completed { color: #b7c0cc; }
.gbook__card--pending { --s: var(--bk-alert); }
.gbook__card--completed { --s: var(--bk-arrived); opacity: .75; }
.cli-sheet__row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .cli-sheet__row { grid-template-columns: 1fr; } }
.cli-detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.cli-detail dt { opacity: .7; }
.cli-detail dd { margin: 0; }
.cli-history { list-style: none; padding: 0; margin: 0; }
.cli-history li { padding: 6px 0; border-top: 1px solid var(--cli-line, rgba(127,127,127,.2)); }
.cli-history li:first-child { border-top: 0; }

/* ── Public booking pages (/book, /book/cancel) — phone-first, light, the clinic's accent ─────────── */
.cbook-page { background: #f3f6f9; color: #1c2733; font-family: Roboto, system-ui, sans-serif; }
.cbook { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.cbook__head h1 { margin: 6px 0 2px; font-size: 1.6rem; }
.cbook__back { color: #2f6f9f; text-decoration: none; font-weight: 600; }
.cbook__muted { color: #5b6573; margin: 4px 0; }
.cbook__card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 6px 20px rgba(28, 39, 51, .06); }
.cbook__card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.1rem; }
.cbook__step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #2f6f9f; color: #fff; font-size: .9rem; }
.cbook__option { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 14px; margin-bottom: 10px;
    border-radius: 14px; border: 1.5px solid #dbe3ea; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.cbook__option span { color: #5b6573; font-size: .9rem; }
.cbook__option.is-on { border-color: #2f6f9f; background: #eef5fb; }
.cbook__days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cbook__day { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 78px; min-height: 76px; padding: 8px;
    border-radius: 14px; border: 1.5px solid #dbe3ea; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.cbook__day span { font-size: .78rem; color: #5b6573; }
.cbook__day small { font-size: .72rem; color: #3f8a4d; }
.cbook__day.is-on { border-color: #2f6f9f; background: #eef5fb; }
.cbook__day:disabled { opacity: .45; cursor: default; }
.cbook__day:disabled small { color: #a0413c; }
.cbook__submit { width: 100%; min-height: 52px; margin-top: 14px; border: 0; border-radius: 14px; background: #2f6f9f; color: #fff;
    font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.cbook__submit:disabled { opacity: .5; cursor: default; }
a.cbook__submit { display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.cbook__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cbook__done { text-align: center; }
.cbook__tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e3f3e6; color: #2f8a3c; font-size: 1.6rem; }
.cbook__summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; text-align: left; margin: 14px 0; }
.cbook__summary dt { color: #5b6573; }
.cbook__summary dd { margin: 0; font-weight: 600; }
.cbook__code { font-size: 1.3rem; letter-spacing: .12em; }
.cbook__link { display: inline-block; margin-top: 8px; color: #2f6f9f; font-weight: 600; }

/* Checkout: VietQR is the clinic's main way to be paid besides cash — a big, plain-to-see button with its
   logo (core TouchCheckoutView renders it; it hides while banknotes are being counted). */
.cli-theme .tco__actions .tco__btn--icon { min-height: 3.4rem; padding: 0.6rem 1.4rem; font-size: 1.05rem;
  border-width: 2px; border-color: #1a5aa6; color: #1a5aa6; box-shadow: 0 4px 14px rgba(26, 90, 166, .18); }
.cli-theme .tco__actions .tco__btn--icon img { height: 2rem; }

/* A panel whose actions can't be undone from the app (Setup → Data): tinted, so it reads as the careful one. */
.cli-panel--danger { background: color-mix(in srgb, var(--mud-palette-error) 5%, var(--cli-surface, #fff)); border: 1px solid color-mix(in srgb, var(--mud-palette-error) 25%, transparent); }
