/* admin/css/admin-responsive.css
 *
 * A narrow-screen safety net for the admin console. Desktop is deliberately
 * untouched: every rule here sits behind a max-width query.
 *
 * The problem it solves: a data table with eight or eighteen columns and no
 * scrolling container does one of two things on a phone. Either it forces the
 * whole page to scroll sideways, so every other column of content drifts off
 * screen, or it is clipped and the right-hand columns cannot be reached at all.
 * Roughly a third of admin pages have at least one table like that.
 *
 * Making the table its own scroll region fixes both, and is harmless where a
 * wrapper already exists - the table simply scrolls inside itself instead.
 */

/* ── Arbitrary Tailwind values the compiled stylesheet is missing ──────────
 *
 * Markup across the admin uses arbitrary utilities like `bg-[#4F6B4F]`. Those only
 * exist in the stylesheet if the build happened to compile that exact value, and
 * most were never compiled - so they applied nothing and failed silently. The
 * visible result was a dark-green Save button rendering as the browser default
 * grey, and on the dashboard a white-on-white, effectively invisible button.
 *
 * Declaring them here fixes every occurrence at once. No !important: these are
 * plain class selectors, so anything more specific still wins.
 */
.bg-\[\#FAFAF7\] { background-color: #FAFAF7; }
.bg-\[\#E6F4EA\] { background-color: #E6F4EA; }
.bg-\[\#4F6B4F\] { background-color: #4F6B4F; }
.bg-\[\#556855\] { background-color: #556855; }
.bg-\[\#93C5FD\] { background-color: #93C5FD; }
.bg-\[\#2f3830\] { background-color: #2f3830; }
.bg-\[\#1e2720\] { background-color: #1e2720; }
.text-\[\#4F6B4F\] { color: #4F6B4F; }
.text-\[\#3D5C3D\] { color: #3D5C3D; }
.text-\[\#556855\] { color: #556855; }
.text-\[\#3A5A3A\] { color: #3A5A3A; }
.text-\[\#635BFF\] { color: #635BFF; }
.text-\[\#7A6850\] { color: #7A6850; }
.border-\[\#EDE5DB\] { border-color: #EDE5DB; border-style: solid; }
.border-\[\#F0EBE3\] { border-color: #F0EBE3; border-style: solid; }
.border-\[\#F5F0EB\] { border-color: #F5F0EB; border-style: solid; }
.border-\[\#c9e2cf\] { border-color: #c9e2cf; border-style: solid; }

/* ── Small muted text that could not be read ────────────────────────────────
 *
 * Each ratio below was measured in a browser against the surface actually behind
 * the text. AA wants 4.5:1 for text under 18.66px. These sat between 2.0 and 3.4,
 * which on a 9-11px label means the word is effectively decorative.
 *
 * All are set to #7A6E5F, the existing --color-gray-700 (4.97:1 on white), so no
 * new colour enters the system.
 */
.rail-section-title { color: #6F6455; }   /* was #B8A99A, 2.03:1 at 9px. #7A6E5F only reached 4.41
                                             here because the rail is tinted, not white. */
.rail-label         { color: #6F6455; }   /* was #9A8B7A, 2.93:1 at 11px - density/view switches */
.email-rail p,
.rail-empty         { color: #6F6455; }   /* was #9A8B7A, 2.93:1 at 10px - "Inbox zero" and friends */
.thread-time        { color: #7A6E5F; }   /* was #C4B09A, 2.09:1 at 11px - chat timestamps */
.thread-preview     { color: #7A6E5F; }   /* was #9A8B7A, 3.31:1 at 12px - chat message preview */

/* Hardcoded light greys that the palette change could not reach, measured on white:
   .tab-btn 2.92:1, .kpi-label 3.31:1, .lbl 2.29:1 - all at 12-13px. These name the
   figures beside them, so they are not decoration. #6F6455 is 5.79:1. */
.tab-btn,
.kpi-label,
.kpi .lbl,
.card .lbl,
.stat-mini .lbl   { color: #6F6455; }

/* ── Editable fields must look editable ─────────────────────────────────────
 *
 * Several admin screens style inputs with `border-warm-200`, which in Tailwind sets
 * the border COLOUR only. Without the accompanying `border` utility the width stays
 * 0, so the control renders white-on-white and is indistinguishable from static
 * text. On the pricing grids that means a row of prices looks read-only, and the
 * only clue anything can be changed is a Save button at the end of the row.
 *
 * Targeting the class by substring fixes exactly the broken case - a control that
 * asked for a border and did not get one - without touching anything else.
 */
input[class*="border-warm-"],
select[class*="border-warm-"],
textarea[class*="border-warm-"],
input[class*="border-sage-"],
select[class*="border-sage-"],
textarea[class*="border-sage-"],
input[class*="border-red-"],
select[class*="border-red-"],
textarea[class*="border-red-"],
input[class*="border-gray-"],
select[class*="border-gray-"],
textarea[class*="border-gray-"],
input[class*="border-amber-"],
select[class*="border-amber-"],
textarea[class*="border-amber-"],
input[class*="border-green-"],
select[class*="border-green-"],
textarea[class*="border-green-"],
input[class*="border-emerald-"],
select[class*="border-emerald-"],
textarea[class*="border-emerald-"],
input[class*="border-slate-"],
select[class*="border-slate-"],
textarea[class*="border-slate-"],
input[class*="border-blue-"],
select[class*="border-blue-"],
textarea[class*="border-blue-"],
input[class*="border-rose-"],
select[class*="border-rose-"],
textarea[class*="border-rose-"],
input[class*="border-purple-"],
select[class*="border-purple-"],
textarea[class*="border-purple-"],
input[class*="border-yellow-"],
select[class*="border-yellow-"],
textarea[class*="border-yellow-"],
input[class*="border-indigo-"],
select[class*="border-indigo-"],
textarea[class*="border-indigo-"],
input[class*="border-orange-"],
select[class*="border-orange-"],
textarea[class*="border-orange-"],
input[class*="border-teal-"],
select[class*="border-teal-"],
textarea[class*="border-teal-"],
input[class*="border-cyan-"],
select[class*="border-cyan-"],
textarea[class*="border-cyan-"],
input[class*="border-pink-"],
select[class*="border-pink-"],
textarea[class*="border-pink-"],
input[class*="border-stone-"],
select[class*="border-stone-"],
textarea[class*="border-stone-"],
input[class*="border-neutral-"],
select[class*="border-neutral-"],
textarea[class*="border-neutral-"],
input[class*="border-zinc-"],
select[class*="border-zinc-"],
textarea[class*="border-zinc-"] {
    border-width: 1px;
    border-style: solid;
}

@media (max-width: 900px) {

    /* [w2-shell] 9 Oct 2026: these two rules were global (every table in main, a card, a section) and broke
       components: display:block split a table's header from its body (headings 23 to 294px off their columns),
       FullCalendar's grid collapsed to 0px, and nowrap stretched tables that fit. Now opt-in or scoped:
       admin/js/wc-layout.js wraps only a table that is wider than its column in .wc-tscroll (the scroll box),
       and only those keep their cells on one line, so columns stay readable while they scroll. A page that
       wants the old self-scrolling table marks it data-tscroll-self. Library widgets are never matched. */
    table[data-tscroll-self] {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .wc-tscroll > table:not(.fc table):not([data-no-tscroll] table) > :is(thead, tbody, tfoot) > tr > :is(th, td),
    table[data-tscroll-self] :is(th, td) {
        white-space: nowrap;
    }

    /* Nothing should be able to push the page itself sideways. */
    html, body { max-width: 100%; overflow-x: hidden; }

    /* Media and embeds stay inside their column. */
    img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

    /* Long unbroken strings - booking ids, tokens, URLs - wrap instead of
       stretching their container past the screen edge. */
    td, dd, p, li, .break-anywhere { overflow-wrap: anywhere; }
    td { overflow-wrap: normal; }   /* cells keep nowrap from the rule above */
}

/* Touch targets. A 16px icon button is fine with a mouse and a coin-flip with a
   thumb; 32px is the smallest that reliably works while staying visually light. */
@media (hover: none) and (pointer: coarse) {
    /* [design3] 2 Oct 2026: not the Training mode dots. At 32px wide they were ovals, and their 44px touch ring
       then reached past the screen edge (the page measured 399px wide at 390, so the phone zoomed out and every
       right-anchored control moved 9px). */
    a.btn, button:where(:not(.wctm-dot)), .btn, [role="button"] {
        min-height: 32px;
        min-width: 32px;
    }
}

/* ── Compiled Tailwind palette: the muted text utilities ────────────────────
   css/tailwind.css is a static build, so these could not be reached by the
   base.css token work. Measured on white, they are the single largest source
   of unreadable text in the admin - hundreds of elements across every page:

     .text-warm-400  #C4B09A  2.09:1  ->  #7F7263  4.68:1
     .text-warm-500  #B8A99A  2.29:1  ->  #776A5B  5.25:1   (113 uses sampled)
     .text-warm-600  #9A8B7A  3.31:1  ->  #6F6455  5.79:1
     .text-sage-400  #8B9E8B  2.85:1  ->  #5F7659  4.83:1   (262 uses sampled)
     .text-sage-500  #6B8068  4.28:1  ->  #55684F  6.01:1

   Each keeps its hue and the scale stays monotonic, so nothing reads as a
   different colour - only deep enough to be legible.

   .text-sage-300 and the warm-100/200/300 steps are deliberately NOT touched:
   those are the light-on-dark values (sage-300 sits on the #2F3830 panels),
   and darkening them would break the dark surfaces the way the --gold change
   did. Verified by measuring every use of these classes against its real
   computed background first: warm-400/500/600 and sage-400/500 had zero uses
   on a dark background; sage-300 had one.

   This sheet is injected last in <head>, so these win over tailwind.css at
   equal specificity without !important. */
.text-warm-400 { color: #7F7263; }
.text-warm-500 { color: #776A5B; }
.text-warm-600 { color: #6F6455; }
.text-sage-400 { color: #5F7659; }
.text-sage-500 { color: #55684F; }

/* Amber status utilities from the same static build. #D97706 is 3.19:1 and
   #B45309 4.39:1 on the off-white cards these badges sit on; #9A4708 is 6.2:1
   and still reads as amber. Verified zero uses on a dark background first. */
.text-amber-600 { color: #9A4708; }
.text-amber-700 { color: #9A4708; }

/* FullCalendar's toolbar buttons come from the CDN build and render their label
   at #C4B09A on the #F5F0EB chip - 1.85:1. "Today" is a navigation control, and
   a disabled-looking control that is actually live just reads as broken.
   #6F6455 keeps it visually secondary at 5.3:1 on that chip. */
.fc .fc-button,
.fc .fc-button-primary { color: #6F6455 !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { color: #FFFFFF !important; }

/* Error text at #EF4444 is 3.76:1 on white - and an error message is the one
   string on the page the reader cannot afford to squint at. #DC2626 is 4.83:1
   and reads as the same red. */
.text-red-500 { color: #DC2626; }

/* The premium theme restyles form controls and strips the border off the email
   inbox search row and sort select, leaving a white field on a white panel with
   nothing to say it is editable. Restoring a visible edge here rather than in
   email-inbox.css because the theme sheet loads after that one. */
.tp-search-row { border: 1px solid #DDD1C3; background: #F7F5F1; }
.tp-chips-row .sort-select { border: 1px solid #DDD1C3; background: #FFFFFF; }

/* ── Specificity parity with the theme sheet ────────────────────────────────
   themes.css writes its rules as `[data-theme="premium"] .x` (0,2,0). Every
   override above is a bare class (0,1,0), so the theme won and the fixes did
   nothing on a real page - which is exactly why the muted text and the missing
   input borders survived several rounds of "fixed and verified". Repeating the
   selectors behind [data-theme] ties the specificity, and this sheet is
   injected last in <head>, so the tie breaks in favour of these. */
[data-theme] .text-warm-400 { color: #7F7263; }
[data-theme] .text-warm-500 { color: #776A5B; }
[data-theme] .text-warm-600 { color: #6F6455; }
[data-theme] .text-sage-400 { color: #5F7659; }
[data-theme] .text-sage-500 { color: #55684F; }
[data-theme] .text-amber-600,
[data-theme] .text-amber-700 { color: #9A4708; }
[data-theme] .text-red-500 { color: #DC2626; }
[data-theme] .tab-btn,
[data-theme] .kpi-label,
[data-theme] .stat-mini .lbl { color: #6F6455; }

/* Controls the theme flattens: give the wrapper (or the control) its edge back
   so an editable field still looks editable. */
[data-theme] .tp-search-row      { border: 1px solid #DDD1C3; background: #F7F5F1; }
[data-theme] .tp-chips-row .sort-select { border: 1px solid #DDD1C3; background: #FFFFFF; }
[data-theme] .search-bar-enhanced { border: 1px solid #DDD1C3; background: #FFFFFF; border-radius: 10px; }
[data-theme] .dictate-bar .dictate-lang { border: 1px solid #DDD1C3; background: #FFFFFF; border-radius: 6px; }
[data-theme] .fc .fc-button,
[data-theme] .fc .fc-button-primary { color: #6F6455 !important; }

/* The theme sheet colours headings and body text near-black with a selector that
   outranks Tailwind's utilities, which silently repainted the LIGHT text classes
   too - so "Why these are buried" rendered #0F172A on the #2F3830 panel it was
   written to sit on: 1.47:1, an invisible heading. These restore the light steps
   at the theme's own specificity. Values are the compiled Tailwind ones, so this
   returns the intended colour rather than inventing a new one. */
[data-theme] .text-sage-50  { color: #F6F7F4; }
[data-theme] .text-sage-100 { color: #E8EBE3; }
[data-theme] .text-sage-200 { color: #D4DACA; }
[data-theme] .text-sage-300 { color: #B3BDA5; }
[data-theme] .text-warm-100 { color: #F5F0EB; }
[data-theme] .text-warm-200 { color: #EDE5DB; }
[data-theme] .text-warm-300 { color: #DDD1C3; }
[data-theme] .text-white    { color: #FFFFFF; }

/* Dark masts. ops.css sets `.mast { background: var(--forest-deep); color:
   var(--on-dark) }`, but the theme sheet colours headings and paragraphs with a
   selector that outranks an inherited colour, so an <h1> inside a dark mast came
   out near-black: "My day" and "Lead replies" rendered at 1.20:1 on the forest
   panel - a 52px page title nobody can read. Same story for the .payhero header.
   Re-assert the light ink for text inside those two dark surfaces only. */
[data-theme] .mast h1, [data-theme] .mast h2, [data-theme] .mast h3,
[data-theme] .payhero h1, [data-theme] .payhero h2, [data-theme] .payhero h3 {
    color: #F4F1EA;
}
[data-theme] .mast p, [data-theme] .mast li, [data-theme] .mast span,
[data-theme] .payhero p, [data-theme] .payhero li {
    color: #DCD5C6;
}

/* ── Wide tables on laptops ─────────────────────────────────────────────────
   commercial-pricing, zip-pricing-tiers and drafts-inbox carry tables wider than
   a 1280px window with no scroll container, so the whole page dragged sideways
   (probe 2026-09-11). Below 900px the rules above already handle it; this covers
   every width. A table rendered as a block keeps its row/cell layout and simply
   scrolls inside itself when it is wider than its column. */
/* Design wave 1 (Oct 1, 2026): replaced. Making each table its own scroll box also split its header
   and body into two separate tables, so headings sat 23 to 294px away from their columns. Every
   main table.w-full that had no scroll container now sits in div.wc-table-wrap (census of all 124
   table pages at 1280 and 390), and the wrapper scrolls instead; the table keeps one column grid. */
main .wc-table-wrap { overflow-x: auto; max-width: 100%; }

/* Crew cards in the rail: the status/meta line was appended straight after the
   name with no separation, printing Cat WrightOff (probe 2026-09-11). */
[data-theme] .navv2__crew-meta { display: block; margin-top: 1px; font-size: 11px; }

/* ── Phones (≤ 480px) ─────────────────────────────────────
   ~24 admin pages spilled sideways at 390px: multi-column grids, chip rows and
   filter bars that never collapse, inputs with fixed widths, and stat tiles set
   to 4 columns. These rules make every admin page fit a phone without touching
   page markup (probe 2026-09-11). Tokens only; no new colours. */
@media (max-width: 480px) {
    html, body { overflow-x: hidden; }
    main, .content, .page, .container { max-width: 100vw; min-width: 0; }

    /* Any grid that asks for 2-6 columns collapses to one; 2-col stays 2 only
       for stat tiles that are explicitly small. */
    main .grid[class*="grid-cols-2"], main .grid[class*="grid-cols-3"],
    main .grid[class*="grid-cols-4"], main .grid[class*="grid-cols-5"],
    main .grid[class*="grid-cols-6"], main [class*="lg:grid-cols-"],
    main [class*="md:grid-cols-"], main [class*="xl:grid-cols-"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    main .grid[class*="grid-cols-2"] > * { min-width: 0; }

    /* Horizontal flex rows (filters, chips, toolbars, headers) wrap instead of
       pushing the page wider. */
    main .flex:not(.flex-col):not(.flex-nowrap) { flex-wrap: wrap; }
    main .flex > * { min-width: 0; }
    main .whitespace-nowrap { white-space: normal; }

    /* Fixed-width form controls and search boxes fit the column. [inboxphone] 2 Oct 2026: not checkboxes or
       radios; at 100% a list row's select box took the whole row (Email Inbox rows showed only a checkbox). */
    main input:where(:not([type="checkbox"], [type="radio"])), main select, main textarea, main .input, main [class*="w-64"],
    main [class*="w-72"], main [class*="w-80"], main [class*="w-96"] {
        max-width: 100%;
        width: 100%;
    }
    main [class*="min-w-"] { min-width: 0 !important; }

    /* Wide tables already scroll inside themselves (rule above); make sure
       their wrapper never widens the page either. */
    main .overflow-x-auto, main .table-wrap { max-width: 100%; }
    main table { font-size: 12.5px; }

    /* Page titles and stat numbers: keep them readable, never clipped. */
    main h1 { font-size: clamp(22px, 7vw, 30px); line-height: 1.1; overflow-wrap: anywhere; }
    main [class*="text-3xl"], main [class*="text-4xl"] { font-size: 1.6rem !important; }

    /* Sticky action bars and buttons stack on a phone. */
    main .btn, main button[class*="px-"] { max-width: 100%; }
    main .space-x-2 > *, main .space-x-3 > *, main .space-x-4 > * { margin-left: 0 !important; margin-right: .5rem; margin-bottom: .5rem; }

    /* Long identifiers (emails, booking ids, urls) break instead of overflowing. */
    main li, main p, main dd { overflow-wrap: anywhere; }
    /* [w2-shell] a cell breaks only a word that cannot fit on its own line (anywhere broke "Created" into C/r/e... in narrow columns) */
    main td { overflow-wrap: break-word; }
    main img, main canvas, main svg, main iframe { max-width: 100%; height: auto; }
}

/* =============================================================================================
   W2. Admin shell, 9 Oct 2026 [w2-shell]. Owner, 9 Oct (04:15, phones): six crowded boxed buttons in the top bar,
   "New here? Training mode" covering pages, the gold Ask anything button and round help buttons over list rows, a
   stale deadline in the alert strip. Every value below is a token (css/wc-tokens.css, css/wc-surfaces.css).
   Script half: admin/js/wc-layout.js. Learn prompt: js/wc-explain.js + css/wc-explain.css.
   ============================================================================================= */

/* W2.1 The More button: one boxed 44px control at the right end of the phone and tablet top bar, the same chip as
   Menu and Back. It replaces Pin, Lesson, Training mode and Report a problem, which move into its sheet. */
[data-theme] .wcsh-more { display: none; }
@media (max-width: 1023px) {
  [data-theme] body:has(#navV2) .wcsh-more {
    position: fixed; z-index: var(--wcs-z-topbar);
    top: calc(env(safe-area-inset-top, 0px) + (var(--wcs-topbar-h) - var(--wcs-h-touch)) / 2); right: var(--wcs-gutter);
    display: grid; place-items: center; width: var(--wcs-h-touch); height: var(--wcs-h-touch); padding: 0; margin: 0;
    border: var(--wcs-hairline) solid var(--wcs-line); border-radius: var(--wcs-radius-sm);
    background: var(--wcs-raised); color: var(--wcs-ink); cursor: pointer;
    transition: background-color var(--wcs-dur-fast) var(--wcs-ease), border-color var(--wcs-dur-fast) var(--wcs-ease);
  }
  [data-theme] body:has(#navV2) .wcsh-more:hover,
  [data-theme] body:has(#navV2) .wcsh-more[aria-expanded="true"] { background: var(--wcs-sage-wash); border-color: var(--wcs-line-strong); }
  [data-theme] body:has(#navV2) .wcsh-more:focus-visible { outline: none; box-shadow: var(--wcs-focus); border-color: var(--wcs-sage-deep); }
  [data-theme] body:has(#navV2) .wcsh-more .wcsh-sheet__ico { width: var(--wcs-icon-md); height: var(--wcs-icon-md); }
  /* the not-yet-offered dot (js/wc-explain.js sets html[data-wcx-nudge]) */
  [data-theme][data-wcx-nudge="1"] body:has(#navV2) .wcsh-more::after {
    content: ""; position: absolute; top: calc(-1 * var(--wcs-space-1) / 2); right: calc(-1 * var(--wcs-space-1) / 2);
    width: calc(var(--wcs-space-2) + var(--wcs-space-1) / 2); height: calc(var(--wcs-space-2) + var(--wcs-space-1) / 2); border-radius: var(--wcs-radius-pill);
    background: var(--wcs-gold); box-shadow: 0 0 0 var(--wcs-hairline) var(--wcs-raised), 0 0 0 calc(2 * var(--wcs-hairline)) var(--wcs-raised);
  }

  /* The four controls it gathers leave the bar (each still exists: the sheet clicks it). The breadcrumb takes the room. */
  [data-theme].wcsh-on body:has(#navV2):not(#wc-x):not(#wc-y) { --wcs-bar-help: 0px; }
  [data-theme].wcsh-on body:has(#navV2) :is(#wcIssueFab, .wcx-fab.wcx-fab, .wc-ph .wc-ph__bar > .wc-ph__pin, .wc-ph-nav .wc-ph__pin):not(#wc-x):not(#wc-y) { display: none; }
  [data-theme].wcsh-on body:has(#navV2) .wc-ph-nav:not(#wc-x):not(#wc-y) { right: calc(var(--wcs-gutter) + var(--wcs-h-touch) + var(--wcs-space-2)); }
  [data-theme].wcsh-on body:has(#navV2):has(.wctm-fab-lesson) .wc-ph .wc-ph__bar > .wc-ph__crumbs:not(#wc-x):not(#wc-y) { display: flex; }
  /* the crumb reads as the page's place: muted parent, ink current page, one line */
  [data-theme].wcsh-on body:has(#navV2) :is(.wc-ph, .wc-ph-nav) .wc-ph__crumbs:not(#wc-x) { font: var(--wcs-font-small-m); }
}
@media (max-width: 640px) {
  /* With the bar cleared there is room for both crumbs, so it reads "Daily / Bookings" instead of a bare "Daily"
     (a door name, not a place). The current page keeps the ink and takes the ellipsis when it is long. */
  [data-theme].wcsh-on body:has(#navV2) :is(.wc-ph, .wc-ph-nav) .wc-ph__crumbs li:last-child:not(:first-child):not(#wc-x):not(#wc-y) { display: inline-flex; }
  [data-theme].wcsh-on body:has(#navV2) :is(.wc-ph, .wc-ph-nav) .wc-ph__crumbs li:nth-last-child(2):not(:first-child):not(#wc-x) { flex: none; }
  [data-theme].wcsh-on body:has(#navV2) :is(.wc-ph, .wc-ph-nav) .wc-ph__crumbs li:not(:last-child):not(#wc-x) { color: var(--wcs-muted); flex: none; }
}

/* W2.2 The sheet. Phones: a bottom sheet in thumb reach. Tablets: a panel under the More button. */
[data-theme] .wcsh-scrim {
  position: fixed; inset: 0; z-index: var(--wcs-z-backdrop); background: var(--wcs-backdrop);
  opacity: 0; transition: opacity var(--wcs-dur) var(--wcs-ease);
}
[data-theme] .wcsh-scrim.is-in { opacity: 1; }
[data-theme] .wcsh-scrim[hidden], [data-theme] .wcsh-sheet[hidden] { display: none; }
[data-theme] .wcsh-sheet {
  position: fixed; z-index: var(--wcs-z-modal); box-sizing: border-box; overflow: hidden auto;
  left: 0; right: 0; bottom: 0; max-height: min(80vh, calc(100vh - var(--wcs-topbar-h)));
  padding: 0 0 calc(var(--wcs-space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--wcs-raised); color: var(--wcs-ink); font: var(--wcs-font-body);
  border: var(--wcs-hairline) solid var(--wcs-line); border-bottom: 0; border-radius: var(--wcs-radius) var(--wcs-radius) 0 0;
  box-shadow: var(--wcs-shadow-lifted);
  transform: translateY(100%); transition: transform var(--wcs-dur) var(--wcs-ease);
}
[data-theme] .wcsh-sheet.is-in { transform: translateY(0); }
/* the signature band: sage into gold, the same line the Learn card and Start's day panel wear */
[data-theme] .wcsh-sheet::before {
  content: ""; position: sticky; top: 0; display: block; height: calc(var(--wcs-space-1) - var(--wcs-hairline));
  background: linear-gradient(90deg, var(--wcs-sage-deep) 0%, var(--wcs-sage) 55%, var(--wcs-gold) 100%);
}
[data-theme] .wcsh-sheet__head { position: relative; padding: var(--wcs-space-3) calc(var(--wcs-h-touch) + var(--wcs-space-6)) var(--wcs-space-3) var(--wcs-space-5); }
[data-theme] .wcsh-sheet__grip {
  position: absolute; top: var(--wcs-space-2); left: 50%; transform: translateX(-50%);
  width: var(--wcs-space-10); height: var(--wcs-space-1); border-radius: var(--wcs-radius-pill); background: var(--wcs-line);
}
[data-theme] .wcsh-sheet__eyebrow { margin: var(--wcs-space-3) 0 var(--wcs-space-1); font: var(--wcs-font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--wcs-sage-deep); }
[data-theme] .wcsh-sheet__title {
  margin: 0; font: var(--wcs-font-title); font-size: var(--wcs-space-6); line-height: 1.15; color: var(--wcs-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: lining-nums;
}
[data-theme] .wcsh-sheet__x {
  position: absolute; top: var(--wcs-space-4); right: var(--wcs-space-3); display: grid; place-items: center;
  width: var(--wcs-h-touch); height: var(--wcs-h-touch); padding: 0; border: var(--wcs-hairline) solid transparent; border-radius: var(--wcs-radius-sm);
  background: transparent; color: var(--wcs-muted); cursor: pointer;
}
[data-theme] .wcsh-sheet__x:hover { background: var(--wcs-sage-wash); color: var(--wcs-ink); }
[data-theme] .wcsh-sheet__list { display: grid; gap: var(--wcs-space-1); padding: 0 var(--wcs-space-3); }
[data-theme] .wcsh-sheet__item {
  display: grid; grid-template-columns: var(--wcs-h-md) minmax(0, 1fr) auto; align-items: center; gap: var(--wcs-space-3);
  width: 100%; min-height: calc(var(--wcs-h-touch) + var(--wcs-space-4)); padding: var(--wcs-space-2) var(--wcs-space-3);
  border: var(--wcs-hairline) solid transparent; border-radius: var(--wcs-radius-sm); background: transparent;
  color: var(--wcs-ink); text-align: left; cursor: pointer; font: inherit;
  transition: background-color var(--wcs-dur-fast) var(--wcs-ease), border-color var(--wcs-dur-fast) var(--wcs-ease);
}
[data-theme] .wcsh-sheet__item:hover { background: var(--wcs-row-hover); border-color: var(--wcs-line); }
[data-theme] .wcsh-sheet__item:focus-visible { outline: none; box-shadow: var(--wcs-focus); border-color: var(--wcs-sage-deep); }
[data-theme] .wcsh-sheet__item > .wcsh-sheet__ico {
  box-sizing: border-box; width: var(--wcs-h-md); height: var(--wcs-h-md); padding: var(--wcs-space-2);
  border-radius: var(--wcs-radius-pill); background: var(--wcs-sage-wash); color: var(--wcs-sage-deep);
}
[data-theme] .wcsh-sheet__item[data-more="ask"] > .wcsh-sheet__ico { background: var(--wcs-gold-wash); color: var(--wcs-gold-ink); }
[data-theme] .wcsh-sheet__txt { display: grid; gap: calc(var(--wcs-space-1) / 2); min-width: 0; }
[data-theme] .wcsh-sheet__label { font: var(--wcs-font-touch-m); color: var(--wcs-ink); }
[data-theme] .wcsh-sheet__sub { font: var(--wcs-font-small); color: var(--wcs-muted); }
[data-theme] .wcsh-sheet__state:empty { display: none; }
[data-theme] .wcsh-sheet__state:not(.wcsh-sheet__switch) {
  padding: calc(var(--wcs-space-1) / 2) var(--wcs-space-2); border-radius: var(--wcs-radius-pill);
  background: var(--wcs-sage-wash); color: var(--wcs-sage-deep); font: var(--wcs-font-label);
}
[data-theme] .wcsh-sheet__switch {
  position: relative; box-sizing: border-box; width: calc(var(--wcs-h-md) + var(--wcs-space-1)); height: calc(var(--wcs-space-6) + var(--wcs-space-1) / 2);
  border-radius: var(--wcs-radius-pill); background: var(--wcs-line); transition: background-color var(--wcs-dur) var(--wcs-ease);
}
[data-theme] .wcsh-sheet__knob {
  position: absolute; top: calc(var(--wcs-space-1) / 2); left: calc(var(--wcs-space-1) / 2);
  width: calc(var(--wcs-space-5) + var(--wcs-space-1) / 2); height: calc(var(--wcs-space-5) + var(--wcs-space-1) / 2);
  border-radius: var(--wcs-radius-pill); background: var(--wcs-raised); box-shadow: var(--wcs-shadow);
  transition: transform var(--wcs-dur) var(--wcs-ease);
}
[data-theme] .wcsh-sheet__item[aria-checked="true"] .wcsh-sheet__switch { background: var(--wcs-sage-fill); }
[data-theme] .wcsh-sheet__item[aria-checked="true"] .wcsh-sheet__knob { transform: translateX(calc(var(--wcs-space-4) - var(--wcs-space-1) / 2)); }
[data-theme] .wcsh-sheet__item.is-new .wcsh-sheet__label::after {
  content: "New"; margin-left: var(--wcs-space-2); padding: 0 var(--wcs-space-2); border-radius: var(--wcs-radius-pill);
  background: var(--wcs-gold-wash); color: var(--wcs-gold-ink); font: var(--wcs-font-label); vertical-align: middle;
}
@media (min-width: 641px) {
  [data-theme] .wcsh-sheet {
    left: auto; right: var(--wcs-gutter); bottom: auto; top: calc(env(safe-area-inset-top, 0px) + var(--wcs-topbar-h) + var(--wcs-space-2));
    width: min(calc(var(--wcs-modal-sm) - var(--wcs-space-10) * 3), calc(100vw - 2 * var(--wcs-gutter)));
    padding-bottom: var(--wcs-space-3); border-bottom: var(--wcs-hairline) solid var(--wcs-line); border-radius: var(--wcs-radius);
    transform: translateY(calc(-1 * var(--wcs-space-2))); opacity: 0; transition: transform var(--wcs-dur) var(--wcs-ease), opacity var(--wcs-dur) var(--wcs-ease);
  }
  [data-theme] .wcsh-sheet.is-in { transform: none; opacity: 1; }
  [data-theme] .wcsh-sheet__grip { display: none; }
}
/* while the sheet is open nothing floats over it */
[data-theme].wcsh-open :is(.ask-fab, #wcIssueFab, .wcx-fab, .wcx-hint) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  [data-theme] :is(.wcsh-sheet, .wcsh-scrim, .wcsh-sheet__switch, .wcsh-sheet__knob, .wcsh-sheet__item) { transition: none; }
}

/* W2.3 Floating buttons keep a lane. On scroll down they slide away; on the way up they return (wc-layout.js sets
   html.wc-fabs-tucked). A button with keyboard focus never hides. */
[data-theme] body :is(#wcIssueFab, .wcx-fab.wcx-fab):not(#wc-x) {
  transition: transform var(--wcs-dur) var(--wcs-ease), opacity var(--wcs-dur) var(--wcs-ease), background-color var(--wcs-dur-fast) var(--wcs-ease), border-color var(--wcs-dur-fast) var(--wcs-ease);
}
[data-theme].wc-fabs-tucked body :is(#wcIssueFab, .wcx-fab.wcx-fab):not(:focus-visible):not(#wc-x):not(#wc-y) {
  transform: translateY(calc(100% + var(--wcs-space-8) * 3)); opacity: 0; pointer-events: none;
}
@media (max-width: 1023px) {
  /* on phones the round help buttons live in the More sheet; the foot of every page leaves room for Ask anything */
  [data-theme] body:has(#navV2) > main:not(#wc-x) { padding-bottom: calc(var(--wcs-h-touch) + var(--wcs-space-2) + 2 * var(--wcs-space-4) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  /* a page with a docked primary (New booking, Add staff) keeps the bottom edge for it: Ask anything is in More */
  [data-theme] body:has(#navV2):has(.wc-ph__primary) .ask-fab:not(#wc-x) { display: none; }
  [data-theme] body:has(#navV2):has(.wc-ph__primary) > main:not(#wc-x):not(#wc-y) { padding-bottom: calc(var(--wcs-h-touch) + 3 * var(--wcs-space-4) + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1024px) {
  /* desktop, narrow lane (html.wc-lane-tight): the medal joins the column of round help buttons, on top of it and
     centred on it, instead of standing beside them over the content */
  [data-theme] body:has(#navV2):has(#wcIssueFab) { --wcsh-stack: 1; }
  [data-theme] body:has(#navV2):has(#wcIssueFab):has(button.wcx-fab) { --wcsh-stack: 2; }
  [data-theme] body:has(#navV2):has(#wcIssueFab):has(button.wcx-fab):has(.wctm-fab-lesson) { --wcsh-stack: 3; }
  [data-theme].wc-lane-tight body:has(#navV2) .ask-fab:not(#wc-x) {
    right: calc(var(--wcs-space-4) - (var(--wcs-h-touch) + var(--wcs-space-2) - var(--wcs-h-md)) / 2);
    bottom: calc(var(--wcs-space-4) + var(--wcsh-stack, 0) * (var(--wcs-h-md) + var(--wcs-space-2)));
  }
  /* desktop: the last card can scroll clear of the Ask anything pill */
  [data-theme] body:has(#navV2) > main:not(#wc-x) { padding-bottom: calc(var(--wcs-h-touch) + var(--wcs-space-2) + 2 * var(--wcs-space-6)); }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme].wc-fabs-tucked body :is(#wcIssueFab, .wcx-fab.wcx-fab):not(:focus-visible):not(#wc-x):not(#wc-y) { transform: none; }
}

/* W2.4 The system strip reads one clean line on a phone: "Digest: 1 low-priority notice", or "3 notices · 125
   changes" (admin-flag-banner.php writes .wc-strip__sum). Wider screens keep the full clauses on one line. */
[data-theme] .wc-strip__sum { display: none; }
@media (max-width: 640px) {
  [data-theme] .wc-strip .wc-strip__text:not(#wc-x) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
  [data-theme] .wc-strip .wc-strip__text:has(> .wc-strip__sum) > :not(.wc-strip__sum) { display: none; }
  [data-theme] .wc-strip .wc-strip__text > .wc-strip__sum { display: inline; }
}

/* W2.5 Tab strips that scroll sideways never squeeze a tab: Work queue's "All queues" shrank to 70px under its own
   words and printed over "Checks" (flex 0 1 auto, min-width 24px, nowrap). Each tab keeps its width; the strip scrolls. */
[data-theme] .wq-tabs .wq-tabs__in:not(#wc-x) { flex: none; }
[data-theme] .wq-tabs .wq-tabs__in > a:not(#wc-x) { flex: none; min-width: max-content; }

/* W2.5b A sideways-scrolling table box never widens the card it sits in. In a grid or flex card the box's content
   width used to size the track (Cleaner agreements: a 484px table made its card 522px wide on a 390px phone, so the
   whole page slid sideways). width 0 + min-width 100% gives the box no say in the card's width and fills it. */
@media (max-width: 900px) {
  [data-theme] main .wc-tscroll:not(#wc-x) { width: 0; min-width: 100%; box-sizing: border-box; }
}

/* W2.6 Phone layouts (640px and below) for the pages the office opens most, built for a thumb rather than shrunk
   from the desktop: one reading line per fact, the facts that matter first, equal-width actions on a grid. */
@media (max-width: 640px) {
  /* Bookings list (admin/bookings.php renderBookingCard): an agenda card. When and status lead, then where and
     who; the service tile and the repeated service line go (the booking line already names the service). */
  [data-theme] .booking-card.selectable-booking:not(#wc-x) { padding: var(--wcs-space-4) var(--wcs-space-4) var(--wcs-space-3); }
  [data-theme] .booking-card > .flex.flex-col:not(#wc-x) { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--wcs-space-2); margin-bottom: var(--wcs-space-3); padding-left: 0; }
  [data-theme] .booking-card > .flex.flex-col > .flex.items-start:not(#wc-x) { align-items: center; gap: var(--wcs-space-3); flex-wrap: nowrap; }
  [data-theme] .booking-card > .flex.flex-col > .flex.items-start > .flex:not(#wc-x) { min-width: 0; flex: 1 1 auto; flex-wrap: nowrap; }
  [data-theme] .booking-card > .flex.flex-col > .flex.items-start > * + *:not(#wc-x) { margin-left: 0; }
  [data-theme] .booking-card > .flex.flex-col > .flex.items-start .booking-checkbox:not(#wc-x) { margin-top: 0; flex: none; }
  [data-theme] .booking-card > .flex.flex-col .w-11.h-11:not(#wc-x) { display: none; }
  [data-theme] .booking-card > .flex.flex-col > .flex.flex-wrap:not(#wc-x) { gap: var(--wcs-space-2); align-items: center; }
  [data-theme] .booking-card > .flex.flex-col > .flex.flex-wrap > div.text-sm:not(#wc-x) {
    order: -1; flex: 1 0 100%; font: var(--wcs-font-strong); color: var(--wcs-ink); font-variant-numeric: tabular-nums;
  }
  [data-theme] .booking-card > .flex.flex-col > .flex.flex-wrap > label:not(#wc-x) { margin-left: auto; min-height: var(--wcs-h-touch); }
  [data-theme] .booking-card > .grid:not(#wc-x) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: var(--wcs-space-2) var(--wcs-space-3); margin-bottom: var(--wcs-space-3); padding-left: 0;
  }
  [data-theme] .booking-card > .grid > div:not(#wc-x) { min-width: 0; margin: 0; font: var(--wcs-font-small); flex-wrap: nowrap; }
  [data-theme] .booking-card > .grid > div > :last-child:not(#wc-x) { min-width: 0; }
  [data-theme] .booking-card > :not(.flex):not(.grid):not(.wc-actions):not(.booking-card-status-strip):not(#wc-x) { margin-left: 0; padding-left: 0; }
  [data-theme] .booking-card > .grid > div > * + *:not(#wc-x) { margin-left: var(--wcs-space-2); }
  [data-theme] .booking-card > .grid > div:nth-child(3):not(#wc-x) { grid-column: 1 / -1; order: 1; align-items: flex-start; }
  [data-theme] .booking-card > .grid > div:nth-child(5):not(#wc-x) { grid-column: 1 / -1; order: 2; }
  [data-theme] .booking-card > .grid > div:nth-child(1):not(#wc-x) { order: 3; }
  [data-theme] .booking-card > .grid > div:nth-child(6):not(#wc-x) { order: 4; }
  [data-theme] .booking-card > .grid > div:nth-child(2):not(#wc-x) { grid-column: 1 / -1; order: 5; }
  [data-theme] .booking-card > .grid > div:nth-child(2) > span:not(#wc-x) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
  [data-theme] .booking-card > .grid > div:nth-child(4):not(#wc-x) { display: none; }
  [data-theme] .booking-card > .wc-actions:not(#wc-x) { padding-top: var(--wcs-space-3); padding-left: 0; gap: var(--wcs-space-2); }
  [data-theme] .booking-card > .wc-actions > a:first-child:not(#wc-x) { flex: 1 1 auto; justify-content: center; }

  /* Customers (admin/js/customer-manager.js cards): name and plan, then phone and email on one line each, the
     address, and last order beside total orders. Equal actions. */
  [data-theme] .customer-card .customer-card-info:not(#wc-x) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wcs-space-3); }
  [data-theme] .customer-card .customer-card-field:not(#wc-x) { min-width: 0; margin: 0; }
  [data-theme] .customer-card .customer-card-field:nth-child(1):not(#wc-x) { grid-column: 1 / -1; order: 2; }
  [data-theme] .customer-card .customer-card-field:nth-child(2):not(#wc-x) { grid-column: 1 / -1; order: 1; }
  [data-theme] .customer-card .customer-card-field:nth-child(3):not(#wc-x) { grid-column: 1 / -1; order: 3; }
  [data-theme] .customer-card .customer-card-field:nth-child(4):not(#wc-x) { order: 4; }
  [data-theme] .customer-card .customer-card-field:nth-child(5):not(#wc-x) { order: 5; }
  [data-theme] .customer-card .customer-card-value:not(#wc-x) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
  [data-theme] .customer-card .customer-card-field:nth-child(3) .customer-card-value:not(#wc-x) { white-space: normal; }
  [data-theme] .customer-card .customer-card-actions:not(#wc-x) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wcs-space-2); }
  [data-theme] .customer-card .customer-card-actions > .card-action-btn:not(#wc-x) { width: 100%; min-height: var(--wcs-h-touch); justify-content: center; margin: 0; }

  /* Staff (admin/js/staff-manager.js cards): the face beside the name, contact under it, then the actions on a
     three-across grid so the six buttons line up instead of wrapping ragged. */
  [data-theme] .staff-card:not(#wc-x) { display: grid; grid-template-columns: var(--wcs-h-touch) minmax(0, 1fr); column-gap: var(--wcs-space-3); row-gap: 0; align-items: start; text-align: left; }
  [data-theme] .staff-card > .staff-initials:not(#wc-x) { grid-row: 1 / span 2; grid-column: 1; width: var(--wcs-h-touch); height: var(--wcs-h-touch); margin: 0; }
  [data-theme] .staff-card > :is(h3, p):not(#wc-x) { grid-column: 2; min-width: 0; }
  [data-theme] .staff-card > h3:not(#wc-x) { margin: 0; }
  [data-theme] .staff-card > p:not(#wc-x) { overflow: hidden; text-overflow: ellipsis; }
  [data-theme] .staff-card > p:empty:not(#wc-x) { display: none; }
  [data-theme] .staff-card > .flex.justify-between:not(#wc-x) { grid-column: 1 / -1; margin: var(--wcs-space-2) 0 var(--wcs-space-3); }
  [data-theme] .staff-card > .flex.flex-wrap:not(#wc-x) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--wcs-space-2); }
  [data-theme] .staff-card > .flex.flex-wrap > button:not(#wc-x) { width: 100%; min-width: 0; min-height: var(--wcs-h-touch); padding-inline: var(--wcs-space-2); justify-content: center; margin: 0; }

  /* Booking detail (admin/booking-detail.php, Appointment card): the short facts pair up two across (Duration beside
     Service, Property beside Beds and baths); When keeps the full row. */
  [data-theme] .detail-card:has(> h2 > .fa-calendar-check) > .grid:not(#wc-x) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: var(--wcs-space-4) var(--wcs-space-3); }
  [data-theme] .detail-card:has(> h2 > .fa-calendar-check) > .grid > div:first-child:not(#wc-x) { grid-column: 1 / -1; }

  /* Leads, Waiting on us (admin/leads.php .wl-reply): Copy is the move, full width; Replied and Open lead share
     the row under it. */
  [data-theme] .wl-reply .wl-reply__actions:not(#wc-x) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wcs-space-2); }
  [data-theme] .wl-reply .wl-reply__actions > .wl-btn:not(#wc-x) { width: 100%; min-height: var(--wcs-h-touch); justify-content: center; margin: 0; }
  [data-theme] .wl-reply .wl-reply__actions > .wl-btn:first-child:not(#wc-x) { grid-column: 1 / -1; }
  [data-theme] .wl-reply .wl-reply__actions > .wl-logged:not(#wc-x) { grid-column: 1 / -1; }
}

/* W2.7 [w2-shell verify] 9 Oct 2026. css/wc-ui.css section 23 makes every summary a flex row, so a summary that is a
   sentence (Start's "Shared overflow (211 items, 59 h 19 min). One list for the whole team...") split into three
   squeezed columns on a phone. A sentence summary reads as one paragraph. */
[data-theme] #shift-overflow > summary:not(#wc-x) { display: block; }
