/* Dog Spa staff app - design system mockup stylesheet.
   STRICT SUBSET of the website's served stylesheet
   (wp/theme/dogspa/assets/css/dogspa.css = site/r13/assets/site-r13z.css).
   Every colour, font, radius and button rule below is copied from the website.
   No new colours exist. See DESIGN.md for the token table and rationale. */

@font-face { font-family: "Besley"; src: url("/fonts/besley.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("/fonts/besley-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* website tokens, verbatim */
  --blue: #74A3D7;
  --blue-tint: #D3E3F3;
  --wash: #EAF1F8;
  --paper: #EFECEC;
  --cool: #F7F5F4;
  --field: #F7F5F4;
  --white: #FFFFFF;
  --ink: #13263B;
  --ink-hover: #0B1828;
  --ink-soft: #3D5166;
  --link: #2C5D91;
  --rule: #C9D7E6;
  --rule-row: #BFD0E2;
  --input-border: #8FA3B8;
  --placeholder: #4A5D70;
  /* 26 Oct 2026 restraint pass (DESIGN.md addendum): a cool neutral for card
     and divider lines so --rule's blue cast stays on inputs/chips only, and a
     40% ink-soft for whole-card hover borders. */
  --hairline: #DDE3E9;
  --ink-40: color-mix(in srgb, var(--ink-soft) 40%, transparent);
  --display: "Besley", Georgia, serif;
  --text: "Lexend", "Segoe UI", Arial, sans-serif;
  --radius: 10px;
  --radius-soft: 18px;
  --ease: cubic-bezier(.22,.61,.36,1);
  /* app layout tokens (sizes only, no colours) */
  --bar-h: 52px;
  --tab-h: 56px;
  /* Item 6 (2026-11-04-ryan-batch/DESIGN-ADDENDUM.md §6.2A): root-level so
     .page-header-back resolves identically whether or not it sits inside
     .page-header - the Inbox thread-head's back control is NOT inside
     .page-header (that whole element is hidden on phone for /messages/:id),
     so it needs this token available from the document root too. .page-
     header already redeclares the same values locally (harmless, same
     cascade result) for every other .page-header control. */
  --page-header-control-h: 34px;
  --gutter: clamp(8px, 1.5vw, 24px);
  --max: 1376px;
  /* App-only groomer palette (Ryan, 26 Oct 2026): eight muted hues for the card edge, chip dot and column header only.
     Status keeps the website tonal pills. Assigned by groomer id, so a groomer's colour never changes between days. */
  --g0: #74A3D7; --g1: #3D8060; --g2: #D99032; --g3: #AB93CE; --g4: #CE769E; --g5: #287C85; --g6: #81933E; --g7: #9A8F7A;
  /* 27 Oct 2026: five more hues (Coral/Mint/Plum/Honey/Slate) for the
     colour radio-swatch picker on Settings > Staff - same muted/soft
     family, lightness and saturation as g0..g7 (see DESIGN.md). */
  --g8: #DE7252; --g9: #8ECFB1; --g10: #774477; --g11: #5355A6; --g12: #7C8FA3;
  /* 26 Oct 2026 (Ryan, drag-feel pass): authorised red/green exception for
     TRANSIENT drag-and-drop feedback only (the move-preview placeholder and
     its time pill) - never for pills, buttons or static status. See
     DESIGN.md addendum. --drop-ok is deliberately darker/more saturated
     than the sage --g1 "Now" tint so the two greens never read as the same
     state. */
  --drop-ok: #3F7D5C;
  --drop-no: #B8463F;
  /* Shared affirmative/negative controls, Ryan 31 Oct 2026. */
  --positive: var(--g1);
  --negative: var(--drop-no);
  /* Batch 28 item 2 (Ryan, busy-bar traffic light): green and amber reuse
     the exact hex already used for the next-booking urgency pills
     (.pill.next-in-soon/.pill.next-in-later below) - the only existing
     green/amber "how full/soon is this" signal in the app. No static red
     exists anywhere (--drop-no above is reserved for transient drag
     feedback only), so --busy-bad is one new colour, kept in the same
     muted/desaturated family as --drop-no rather than a brighter alarm red. */
  --busy-good: #15803D;
  --busy-warn: #F59E0B;
  --busy-bad: #DC2626;
  /* Batch 30 (Ryan, 27 Oct 22:53): the three fills above are now the
     clearly-distinct traffic light shared by the diary busy bar and the
     reports utilisation bars (validated with the dataviz skill's palette
     checker: red<->amber 24.1 and amber<->green 17.4 normal-vision Delta E,
     CVD worst 17.4). They are FILL colours only; text that needs the same
     meaning uses the darker --busy-*-text shades (AA on white). */
  --busy-good-text: #166534;
  --busy-warn-text: #92400E;
  --busy-bad-text: #991B1B;
  /* Batch 29 (Ryan 23:13 voice): the day/week column header tint replaces
     the busy bar entirely. Same red/amber/green family as above but a
     distinct name (not reusing --busy-bad etc, which batch 30's reports
     chart still reads) and a touch darker green (#15803D not #16A34A) per
     the batch 29 brief's own swatch. Fills are PALE (12-16% into white);
     text stays dark/AA via existing --busy-*-text shades. */
  --tint-bad: #DC2626;
  --tint-warn: #F59E0B;
  --tint-good: #15803D;
  /* Reports chart palette (dataviz skill, validated light surface #fff):
     status hues for the visits trend, one-hue blue ramp for the heatmap,
     slot-1 blue for every single-series ranking. */
  --viz-done: #2a78d6;
  --viz-upcoming: #1baf7a;
  --viz-cancelled: #F59E0B;
  --viz-noshow: #DC2626;
  --viz-series: #2a78d6;
  --viz-track: #EDF1F5;
  --viz-grid: #E6EAEF;
  --heat-0: #F1F4F7; --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #2a78d6; --heat-5: #184f95;
}
/* Item 6: root-level mirror of .page-header's own <900px control-height
   bump, so .page-header-back (and anything else reading this token outside
   .page-header) resizes the same way at phone/tablet widths. */
@media (max-width: 899px) { :root { --page-header-control-h: 36px; } }
.g0 { --accent: var(--g0); } .g1 { --accent: var(--g1); } .g2 { --accent: var(--g2); } .g3 { --accent: var(--g3); }
.g4 { --accent: var(--g4); } .g5 { --accent: var(--g5); } .g6 { --accent: var(--g6); } .g7 { --accent: var(--g7); }
.g8 { --accent: var(--g8); } .g9 { --accent: var(--g9); } .g10 { --accent: var(--g10); } .g11 { --accent: var(--g11); } .g12 { --accent: var(--g12); }
.g-none { --accent: var(--input-border); }
i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--blue)); flex: none; vertical-align: 1px; margin-right: 8px; }
/* Batch 29 item 1 (Ryan 22:52 voice, revised 23:43 after seeing the batch
   29 tints): coloured header NAMES clashed with the new red/amber/green
   tint backgrounds - reverted to plain ink text (same weight/size), with
   the groomer colour back as a swatch instead of text colour. .gh-swatch
   is a 12px dot with a 2px WHITE ring (so the groomer hue reads clearly on
   top of any of the three tints, not just white) plus a 1px hairline
   outer edge in the existing --rule token for definition on the lightest
   tints. Inline before the name, never its own line (gap via margin, not
   flex-wrap) - vertical-align middle centres it on the name's cap height
   closely enough at this font size. Ink-on-tint contrast is trivially AA
   (verified in scripts/batch29-contrast.mjs) since --ink is near-black
   regardless of tint. Dots stay as-is in chips/pickers/legend (unrelated
   markup, untouched). */
.grid-diary .gh .gh-name { color: var(--ink); font-weight: 600; }
.gh-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--rule); background: var(--accent, var(--ink-soft)); flex: none; margin: 3px 0 3px 3px; } /* Ryan 01:01: keep the 3px ring inside clipping ancestors (ellipsis rows clip box-shadow) */
/* Theo review of 7c0ee74 (Ryan: never acceptable): the narrow-width
   ellipsis rules further down set `display:block` on every <span> inside
   .gh, which put .gh-swatch on its own line above the name. .gh-name-row
   (diary.ts) wraps swatch+name as ONE inline-flex unit that those rules
   explicitly exclude (:not(.gh-name-row):not(.gh-swatch)), so the two can
   never separate - gap replaces the swatch's old margin-right, and
   min-width:0 lets the name text ellipsis inside the row instead of the
   row itself ever wrapping or truncating as a whole. */
.gh-name-row { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
@media (min-width: 900px) { :root { --bar-h: 80px; } }
/* Mobile density pass (26 Oct 2026, Ryan's voice note + 390px screenshot):
   big chunky chrome ate more than half the viewport before any booking.
   Shrink visual chrome (bar height, logo, type scale, card/page padding) -
   touch targets stay >= 44px per the website's HIG/Material rule above;
   only padding/border/font shrink, never the hit area. Tablet (651-899px)
   is left on the desktop scale; only <= 650px changes. */
@media (max-width: 650px) {
  body { font-size: 15px; }
  h1 { font-size: 21px; }
  h2 { font-size: 17px; }
  h3 { font-size: 15.5px; }
  .kicker { font-size: 11.5px; }
  .small { font-size: 13px; }
  .lead { font-size: 14.5px; }
  .card { --card-pad: 13px; }
  .appbar .bar { gap: 10px; padding: 0 var(--gutter); }
  .toolbar { gap: 8px; margin-bottom: 12px; }
  /* Pass 2 (Theo review of 0241b9a): pass 1 shrank type but left the chrome
     boxes themselves at the same visual size. Shrink the box, keep the
     44px hit area via a ::after pseudo that overflows the shrunk border
     box (a real child in the box tree, so a click/tap on it still bubbles
     to the real <a>/<button> ancestor and fires its native behaviour -
     this doesn't work for native <input> replaced controls, which get a
     plain width/height bump instead). */
  .card > .card-head { min-height: 40px; padding: 8px var(--card-pad); }
  .card > .card-head h2 { font-size: 16px; }
  .field label { font-size: 14.5px; }
  .field .hint { font-size: 13px; }
  .field input, .field textarea, .field select { font-size: 16px; min-height: 46px; padding: 10px 12px; }
  .field select { padding-right: 36px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--text); font-size: 16px; line-height: 1.45; font-weight: 350; color: var(--ink); background: var(--paper); }
/* App scale, not website scale: 15.5px body at desk width, and Lexend 400 (350 reads thin this small). */
@media (min-width: 900px) { body { font-size: 15.5px; font-weight: 400; } }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
/* Native focus remains the no-JS fallback. Pointer/touch and automatic
   panel focus use the existing shared modality helper, not a keyboard ring. */
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
html.focus-managed:not(.kbd-nav) :focus-visible { outline: none !important; }
html.focus-managed:not(.kbd-nav) .swatch-option input:focus-visible + .swatch { outline: none; }
html.focus-managed:not(.kbd-nav) .client-tile:focus-visible { box-shadow: none; }
button { font: inherit; }

h1, h2, h3 { font-family: var(--display); font-weight: 560; letter-spacing: -0.012em; line-height: 1.3; margin: 0; color: var(--ink); }
h1 { font-size: 24px; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
@media (min-width: 900px) { h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 17.5px; } }
.kicker { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; letter-spacing: .06em; text-transform: uppercase; }
.lead { font-size: 16px; color: var(--ink-soft); margin: 4px 0 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
/* Empty/unset values ("Not recorded"): quieter than ink-soft metadata. */
.unset { color: var(--placeholder); }
.num { font-family: var(--display); font-weight: 600; }

/* ---------- Buttons: website .btn system verbatim ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 20px; max-width:100%; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 17px/1.25 var(--text); text-decoration: none; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); white-space: normal; }
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.ghost { background: var(--cool); color: var(--ink); border: 1px solid var(--hairline); }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.sm { min-height: 44px; padding: 8px 16px; font-size: 16px; gap: 8px; }
/* Desk pointer density: 16px labels, 40px small buttons, 36px icon buttons. Touch keeps 44px. */
@media (hover: hover) and (min-width: 900px) {
  .btn { font-size: 16px; }
  .btn.sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
  .btn.xs { font-size: 14px; }
  .iconbtn { width: 36px; height: 36px; }
}
.btn.xs { min-height: 36px; padding: 6px 12px; font-size: 14.5px; gap: 6px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); text-decoration-thickness: 2px; text-underline-offset: .28em; }
.iconbtn:hover { background: var(--cool); }

/* ---------- App bar (= website masthead) ---------- */
.appbar { position: sticky; top: 0; z-index: 50; background: var(--paper); }
.appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--rule); }
.appbar .bar { height: var(--bar-h); display: flex; align-items: center; gap: 20px; padding: 0 var(--gutter); max-width: none; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
/* Ryan 27 Oct 22:40: the Dog Spa logo is a square mark - never rounded, anywhere. */
.brand img { width: 32px; height: 32px; border-radius: 0; }
@media (min-width: 900px) { .brand img { width: 56px; height: 56px; } }
.brand strong { display: block; font: 600 19px/1.1 var(--display); color: var(--ink); }
.brand span { display: block; font-size: 14px; line-height: 1.2; color: var(--ink-soft); font-weight: 400; }
.brand > span { display: none; }
@media (min-width: 900px) { .brand > span { display: block; } }
.appnav { display: none; gap: 22px; margin-left: 12px; }
.appnav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16.5px; padding: 8px 4px; margin: 0 -4px; border-bottom: 3px solid transparent; }
.appnav a:hover { border-bottom-color: var(--ink-40); }
.appnav a[aria-current="page"] { border-bottom-color: var(--blue); }
.bar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
@media (min-width: 900px) { .appnav { display: flex; } }
.page-title-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* B0 fix: this is a phone-only convenience echo of the page's real <h1>
   (which lives in the page body, e.g. .page-head h1) - it must not be a
   second <h1> element, or every page has two headings with the same
   accessible role (and any "the page's h1" tooling/selector becomes
   ambiguous, as scripts/stage3-playwright-qa.cjs's h1 lookup found). */
.page-title-bar .title { display: block; font: 560 17.5px/1.35 var(--display); padding-block: 0.08em; letter-spacing: -0.012em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .page-title-bar { display: none; } }

/* ---------- Tab bar (phone only) ---------- */
.tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--paper); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom, 0); }
.tabbar a { flex: 1 1 0; min-width:0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-h); color: var(--ink-soft); text-decoration: none; font-size: 11px; font-weight: 600; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--blue); border-radius: 0 0 2px 2px; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* Messaging v2 batch 1: unread-thread count badge, reused as-is on the
   phone tab bar, the desktop nav, and the Inbox page heading (design/
   messaging-v2/build.mjs STYLE block). Hidden entirely at n=0 via the
   `hidden` attribute set by LIVE_MESSAGING_JS, not CSS. */
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 12px var(--text); }
/* Facebook-style red unread-count variant (Ryan, 16 Nov 2026) - the one
   authorised red token (--drop-no), not an invented colour. Applied to
   the bell specifically; every other .count-badge stays the default ink
   tint unless it opts into this variant. */
.count-badge.alert { background: var(--drop-no); }
.segmented [aria-current="true"] .count-badge.alert, .segmented [aria-pressed="true"] .count-badge.alert { background: var(--drop-no); color: #fff; }
.tabbar a .count-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.appnav a .count-badge, .settings-subtabs a .count-badge { margin-left: 8px; vertical-align: middle; }
.notif-bell-trigger { position: relative; }
.notif-bell-trigger .count-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }

/* ---------- Page frame ---------- */
main { padding: 0 var(--gutter) calc(24px + var(--tab-h) + env(safe-area-inset-bottom, 0)); max-width: none; margin: 0 auto; width: 100%; }
@media (min-width: 900px) { main { padding: 0 var(--gutter) 48px; } }
/* Every page is full width; only form-heavy containers cap their own line length. */
.card form.stack, form.stack.card-form { max-width: 960px; }
/* Batch 3 point A1: a form-only card must not stay full width while its
   form caps at 960px - that left a big empty right half at 1440+. The
   card itself shrinks to the form's own max-width and stays left aligned
   under the page heading, matching every other form page. Cards that also
   hold non-form content (e.g. a card with a form plus a list) are
   unaffected since the selector only matches a card whose form IS the
   stack content. */
:where(main:not(:has(.page-header .settings-tabs))) .card:has(> form.stack:only-child), :where(main:not(:has(.page-header .settings-tabs))) .card:has(> .card-head + form.stack:only-of-type), :where(main:not(:has(.page-header .settings-tabs))) form.stack.card { max-width: 960px; }
/* Batch 7 item 3: the new-booking wizard and household-booking panels are
   the same kind of form-only card (one step's fields, no diary/list
   content) as the block form above, so they get the same 960px cap and
   left-aligned card treatment instead of stretching full width on desktop. */
.form-page-width { max-width: 960px; }
/* design/2026-11-04-unified-page-header/DESIGN.md §4.1: the .page-head
   family (base flex rule, kicker, actions, phone visually-hidden clip, the
   sticky-bar fold/allowlist patches, the booking-edit/form-page-width/
   reports-page phone white-fold) is removed entirely - .page-header (below,
   §4.2) now owns the whole white block on every page, so there is nothing
   left for a sibling rule to patch. */
.page-header + .notice, .page-header + #banner:not(:empty) { margin-top:12px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

/* ---------- Sticky bar (shared primitive, one pattern everywhere) ----------
   Any controls strip that should stay visible while the page content below
   it scrolls gets this one class added alongside its existing classes (e.g.
   `.toolbar.date-nav.sticky-bar`, `.page-head.sticky-bar`). It pins just
   below the fixed app bar; SHARED_STICKY_JS in src/web/shared.ts measures
   every `.sticky-bar`'s rendered height into --sticky-h (so a second
   page-level sticky bar, e.g. the phone groomer-chip rail, can stack below
   it with calc(var(--bar-h) + var(--sticky-h))) and toggles `.is-stuck` for
   the shadow below. The diary's own `.gh` column headers are a separate,
   self-contained case - see `.diary-scroll`'s comment - and stick to their
   own scroll pane (top:0), not this stack. Background matches the page
   (--paper); hairline border per DESIGN.md restraint rules, no blue.
   It runs edge to edge (negative inline margins pull it past `main`'s
   own --gutter padding, matching padding puts its content back where it
   was) so a stuck bar's background and bottom edge span the full page
   width instead of floating inset with a shadow visible on both sides -
   Ryan's 26 Oct hands-on catch. The stuck shadow is bottom-only (an
   ::after gradient strip, not a box-shadow) so there's nothing to spill
   sideways in the first place. */
/* Batch 3 point B: this is the actual source of the known 390px 4px
   scrollWidth overflow on the diary - .toolbar.date-nav.sticky-bar sits
   at the top of every diary page. Negative inline margins on a
   width:auto box already stretch it by --gutter on each side; adding an
   explicit `width: calc(100% + 2*gutter)` on top of that double-counted
   the bleed by another 2*gutter, same mistake as the old .diary-scroll
   rule above. Dropping the explicit width keeps the edge-to-edge visual
   (margin alone does that) without the overflow. */
/* DESIGN.md §4.1 "change in place": the engine's default is now white, so
   no per-class allowlist (.toolbar.date-nav.sticky-bar, .inbox-tools.sticky-
   bar/.page-head.sticky-bar, the settings-tabs+search-box fold below 900px)
   is ever needed again - deleted along with .page-head itself. */
.sticky-bar { position: sticky; top: var(--bar-h); z-index: 15; background: var(--white); border-bottom: 1px solid var(--hairline); padding: 10px var(--gutter); margin: 0 calc(-1 * var(--gutter)) 16px; }

/* ---------- Page header (one component, every page) ----------
   Owns the whole white block under the app bar / rail: title row, optional
   second row (tabs / search / chips / diary groomer picker), one hairline.
   Sizes are the diary's approved slim header. No page adds its own header
   CSS; page-specific controls go in .page-header-controls and keep their
   own component rules (.date-nav etc.). design/2026-11-04-unified-page-
   header/DESIGN.md §4.2, verbatim. */
.page-header { --page-header-control-h: 34px; position: sticky; top: var(--bar-h); z-index: 15; background: var(--white); border-bottom: 1px solid var(--hairline); margin: 0 calc(-1 * var(--gutter)) 12px; padding: 0; overflow-x: clip; }
.page-header:not(.sticky-bar) { position: static; }
.page-header-main { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 52px; padding: 4px var(--gutter); }
.page-header-main:empty { display: none; }
.page-header-title { flex: 1 1 160px; min-width: 0; margin: 0; font: 560 18px/1.6 var(--display); letter-spacing: -0.012em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-header-sub { margin-left: 8px; font: 400 .78em/1 var(--text); color: var(--ink-soft); }
.page-header-title .count-badge { margin-left: 8px; vertical-align: middle; }
.page-header-controls { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; }
/* Header owns spacing; nested toolbars must not offset adjacent actions. */
.page-header-controls > .toolbar { margin: 0; }
.page-header-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.page-header-menu { display: inline-flex; }
/* Notifications v1.2: the top-right bell every page's pageHeader() now
   renders - phone/tablet keep the app-bar bell (.bar-bell) instead, so
   this stays hidden below the sidebar breakpoint. margin-left:auto means
   it is still pushed flush right even on a page with no .page-header-actions
   at all (e.g. a plain title-only header); when actions ARE present it
   sits immediately after them, with the shared .page-header-main gap as
   its spacing - one consistent position, same gap as every other header
   control, on every screen. */
.page-header-bell { display: none; }
@media (min-width: 900px) {
  .page-header-bell { display: inline-flex; margin-left: auto; flex: 0 0 auto; }
}
.page-header-more { min-width: var(--page-header-control-h); padding-inline: 8px; }
.page-header-row { padding: 0 var(--gutter) 8px; }
.page-header-row > .tabs { margin: 0; border-bottom: 0; }
.page-header-row > .search-box.toolbar { margin: 0; }
.page-header-row > .diary-groomer-picker { margin: 0; padding: 0; }
/* Control scale = the diary's; hit areas extended to >=44px without inflating scrollWidth (root clips). */
.page-header :is(.btn, .btn.sm, .btn.xs, .iconbtn, .groomer-sheet-trigger, .segmented a, .segmented button, .chip, input[type="date"]) { min-height: var(--page-header-control-h); height: var(--page-header-control-h); padding-block: 0; font-size: 13px; }
/* The diary's own .date-nav rules (pre-existing, unchanged, still winning
   on specificity/source order per the design's own builder note) pin some
   icon buttons narrower than --page-header-control-h at a few breakpoints
   (30/32px) - same floor as min-height above, so every control's rendered
   width - not just height - still reaches the control-height scale and the
   44x44 hit target (§5 criterion 9) once the ::after inset:-5px is added. */
.page-header :is(.btn, .btn.sm, .btn.xs, .iconbtn, .groomer-sheet-trigger, .segmented a, .segmented button, .chip) { min-width: var(--page-header-control-h); }
/* DESIGN.md §4.2 gives this a flat 32px - measured against the component's
   own ::after inset:-5px hit-area extension (§5 criterion 9, >=44x44) that
   is 2px short on width at every breakpoint (32+10=42). Widened to match
   the control height itself (34/36px -> 44/46px effective) rather than
   shipping a hit target the design's own acceptance test fails; screenshot
   for Ryan if the 2px visual change is unwanted. */
.page-header .iconbtn { width: var(--page-header-control-h); }
.page-header :is(.btn, .iconbtn, .groomer-sheet-trigger, .segmented a, .segmented button) { position: relative; }
.page-header :is(.btn, .iconbtn, .groomer-sheet-trigger, .segmented a, .segmented button)::after { content: ""; position: absolute; inset: -5px; }
.page-header.is-stuck { border-bottom-color: var(--hairline); }
.page-header.sticky-bar.is-stuck::after { content: none; }
/* Item 6 (2026-11-04-ryan-batch/DESIGN-ADDENDUM.md §6.2A/§6.6 criterion 4):
   the one back control, genuinely unified - .page-header-back is also used
   by messages.ts's Inbox thread-head back button, which does NOT sit
   inside .page-header (that element is display:none on phone for
   /messages/:id), so this rule stands alone rather than relying on
   .page-header's own descendant-scoped sizing above. A compound selector
   (two classes) is required to win over the plain, unscoped `.iconbtn`
   rule later in this file regardless of source order. Border-radius/
   background/hover are already the shared .iconbtn look (round, 50%,
   transparent) - only width/height/hit-area need restating here. */
.iconbtn.page-header-back { width: var(--page-header-control-h); height: var(--page-header-control-h); min-width: 0; position: relative; }
.page-header-back::after { content: ""; position: absolute; inset: -5px; }
@media (prefers-reduced-motion: no-preference) { .page-header { transition: border-color .15s var(--ease); } }
@media (max-width: 899px) {
  .page-header { --page-header-control-h: 36px; }
  .page-header-main { gap: 6px; padding: 6px var(--gutter); min-height: 0; }
  /* Phone/tablet: the app bar already shows the title; keep the h1 for AT only. */
  .page-header-title { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page-header-main:not(:has(> :not(.page-header-title))) { display: none; }
  .page-header:not(:has(.page-header-main:not([hidden]) > :not(.page-header-title))):not(:has(.page-header-row)) { border-bottom: 0; margin-bottom: 12px; padding-block: 0; }
  .page-header :is(.btn, .btn.sm) { font-size: 14px; }
}
/* Item 15 (2026-11-04-ryan-batch, PRIORITY): on phone the diary toolbar
   (date nav, Day/Today/calendar, All staff, the "..." menu) was rendering
   as TWO stacked blocks - .page-header-main (date-nav) then the separate
   .page-header-row (the groomer-picker "All staff" chips) below it - each
   with its own padding, so the combined chrome ran to ~76-88px instead of
   one <=44px row, with an empty-looking band between them. Fixed in the
   shared pageHeader()/.page-header component (not a diary-only hack):
   scoped to the one case that actually has this problem - a page-header
   whose secondary row is the diary groomer-picker - so Clients/Inbox/
   Settings (whose .page-header-row, when present, holds .tabs or a
   .search-box, never .diary-groomer-picker) are untouched. `display:
   contents` unwraps .page-header-main/.page-header-row so their own
   children (title - already visually-hidden above - controls, actions,
   groomer-picker) become one flex row's direct items; controls stay at
   the existing 36px control height, with a 44px hit area via the
   pre-existing ::after inset, never by inflating the row itself. */
@media (max-width: 649px) {
  .page-header:has(.page-header-row > .diary-groomer-picker) { display: flex; align-items: center; flex-wrap: nowrap; overflow-x: auto; height: 44px; gap: 6px; padding: 0 var(--gutter); margin-bottom: 0; /* Build 4 QA: shared .page-header margin-bottom:12px left a 12px band above the staff row */ }
  .page-header:has(.page-header-row > .diary-groomer-picker) .page-header-main,
  .page-header:has(.page-header-row > .diary-groomer-picker) .page-header-row { display: contents; }
  /* Fixed during Build 4 QA: the shared ".page-header :is(...input[type=date])
     {font-size:13px}" rule out-ranked the phone icon-only date control's
     font-size:0, so the date text ("1...0") bled through the 34px calendar
     icon in this one-row toolbar. Icon only, as designed. */
  .page-header:has(.page-header-row > .diary-groomer-picker) .date-nav input[type="date"] { font-size: 0; color: transparent; flex: none; }
}
@media (min-width: 900px) { .page-header { top: 0; } }

/* Point 10 save pattern (27 Oct revision): shared sticky "Unsaved changes"
   bar for multi-field record forms (DIRTY_FORM_JS, shared.ts), and the
   inline autosave status next to a simple setting (AUTOSAVE_JS). One
   shared pair of rules, reused by every form rather than a per-page copy. */
.dirty-form-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #fff; padding: 12px var(--gutter); box-shadow: 0 -4px 16px #14253a2e; }
.dirty-form-bar .iconbtn { color:var(--white); }
.dirty-form-bar .iconbtn:is(:hover,:focus-visible) { background:#ffffff22; color:var(--white); }
.dirty-form-bar .iconbtn:focus-visible { outline:2px solid var(--white); outline-offset:2px; }
.dirty-form-bar .btn.ghost { background: transparent; color: #fff; border-color: #ffffff55; }
.dirty-form-bar .btn.ghost:hover { background: #ffffff22; color: #fff; border-color: #fff; }
@media (max-width: 899px) { .dirty-form-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0)); } }
/* Batch 19 item 4: the one-list dog step's sticky "Book N dogs together"
   button, pinned above the bottom tab bar on phone exactly like
   .dirty-form-bar, appearing only once 1+ rows are ticked. */
.multi-sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--paper); border-top: 1px solid var(--hairline); padding: 12px var(--gutter); box-shadow: 0 -4px 16px #14253a1f; }
.multi-sticky-bar .btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.multi-sticky-bar .btn:hover, .multi-sticky-bar .btn:focus-visible { background: var(--ink-hover); border-color: var(--ink-hover); color: #fff; }
/* Desktop booking actions stay together in the form. Only compact
   navigation layouts use the pinned mobile action bar. */
@media (min-width: 900px) {
  .multi-sticky-bar { position: static; width: auto; max-width: 100%; padding: 0; border: 0; box-shadow: none; background: transparent; z-index: auto; }
  .dirty-form-bar { left: var(--rail-w); }
}
@media (max-width: 899px) { .multi-sticky-bar .btn { width: 100%; } .multi-sticky-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0)); } }
.dog-row-tick { flex: none; display: grid; place-items: center; padding: 8px; margin: -8px; }
.dog-row-tick input { width: 24px; height: 24px; accent-color: var(--positive); }
.result-row-live.dog-row.is-chosen { background: var(--ink); color: #fff; }
.result-row-live.dog-row.is-chosen small { color: inherit; opacity: .8; }
.autosave-status { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 13px; color: var(--ink-soft); min-height: 1.2em; }
.autosave-status.is-error { color: var(--red, #b42318); }
.autosave-status .textlink { font-size: 13px; }

/* Point 6b (27 Oct batch 4): drag-to-block selection box + its popover
   (BLOCK_DRAG_JS, src/web/diary.ts). The popover reuses the groomer
   sheet's bottom-sheet treatment on phone (.block-sheet), a small
   anchored card on desktop. */
.block-drag-box { position: absolute; left: 3px; right: 3px; background: #2f6fed22; border: 1.5px dashed var(--blue); border-radius: 8px; font: 600 12px/1 var(--text); color: var(--blue); padding: 4px 6px; pointer-events: none; z-index: 6; }
.block-popover { position: fixed; inset:0; margin:auto; border: 1px solid var(--hairline); border-radius: var(--radius-soft); padding: 16px; width: min(720px, calc(100vw - 48px)); max-width: calc(100vw - 16px); box-sizing: border-box; overflow-x: hidden; overflow-y:auto; overscroll-behavior:contain; max-height:calc(100dvh - 16px); box-shadow: 0 8px 24px #14253a2e; background: var(--white); }
.block-popover::backdrop { background: #14253a4d; }
@media (max-width:650px) {
.block-popover:not(.confirm-popover), .block-popover.block-sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom, 0)); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px #14253a2e; }
.block-popover.block-sheet::backdrop { background: #14253a4d; }
}
/* Keep Start/End on one row even inside the phone bottom sheet, where the
   shared .field-row would otherwise stack to a single column below
   600px (line 779) - two time fields are narrow enough to stay paired,
   and stacking them wastes sheet height. */
.block-popover.block-sheet .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Batch 21 item 6: Groomer truncated ("Hannah Lockwo…") paired with Date
   in the phone sheet's forced 2-up row above - give it the full row on
   phones, Date drops to its own row below. */
.block-popover.block-sheet .field-row.qb-groomer-row { grid-template-columns: minmax(0, 1fr); }
/* Batch 7 item 2: quick-book popover, same anchored-card/bottom-sheet
   mechanics as the block popover above but wider (more fields: dog,
   service, groomer, date, start, note) and scrollable on short viewports
   since its content can exceed a fixed desktop anchor position. */
/* Responsive form width; visible panel scrollbars retain mouse-only access. */
.block-popover.quick-book-popover { width: min(1040px, calc(100vw - 48px)); max-height: calc(100dvh - 16px); overflow-y: auto; }
/* Visible, draggable scroll affordance for every shared panel. */
* { scrollbar-width:thin; scrollbar-color:var(--ink-soft) transparent; }
*::-webkit-scrollbar-thumb { background:var(--ink-soft); border:3px solid var(--wash); border-radius:999px; min-height:40px; }
*::-webkit-scrollbar-thumb:hover { background:var(--ink); }
/* Chromium/Edge: let the rounded inset webkit track win over native arrows. */
@supports selector(::-webkit-scrollbar) {
 * { scrollbar-width:auto; scrollbar-color:auto; }
}
*::-webkit-scrollbar { display: block; width: 12px; height: 12px; background: transparent; }
*::-webkit-scrollbar-track { background: var(--wash); border-radius: 999px; margin: 18px; }
*::-webkit-scrollbar-button { display:none; width:0; height:0; }
*::-webkit-scrollbar-corner { background:transparent; }
/* Desktop horizontal tracks need a generous mouse grab area; vertical tracks stay slim. */
@media (min-width:1024px) {
 *::-webkit-scrollbar { height:20px; }
}
/* Phones navigate by swipe; retain overflow but remove visible tracks app-wide. */
@media (max-width:650px) {
 * { scrollbar-width:none; }
 *::-webkit-scrollbar { display:none; width:0; height:0; }
}
.block-popover .field, .block-popover .field-row > * { min-width: 0; }
.block-popover input, .block-popover select { width: 100%; box-sizing: border-box; min-width: 0; }
.block-popover form.stack { display:grid; gap: 12px; }
.block-popover .field-row { gap: 12px; margin: 0; }
@media (max-width:650px) { .block-popover.quick-book-popover { max-height: 92dvh; } }
/* One recommendation component across Quick Book and full booking forms. */
.notice.service-recommendation { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:18px; margin:0; }
.service-recommendation-label { font-size:14px; color:var(--busy-good-text); }
.service-recommendation.warning .service-recommendation-label { color:var(--busy-warn-text); }
.service-recommendation .hint { margin:0; line-height:1.5; }
.service-recommendation-choices { display:grid; gap:10px; }
.service-recommendation .service-recommendation-choice { display:grid; gap:8px; width:100%; height:auto; min-height:64px; padding:14px 16px; white-space:normal; text-align:left; justify-items:start; line-height:1.5; border-color:var(--drop-ok); background:var(--white); }
.service-recommendation-choice[aria-pressed="true"] { background:color-mix(in srgb,var(--drop-ok) 9%,var(--white)); }
.service-recommendation-choice strong { font-size:15px; }
.service-recommendation-meta { font-size:14px; font-weight:500; }
.catalogue-controls { display:grid; gap:16px; margin-bottom:18px; }
.catalogue-controls.stack > :not([hidden]) ~ :not([hidden]) { margin-top:0; }
/* Shared form sections expand with the dialog, retaining source/tab order. */
.dialog-form-grid, .dialog-form-section { display:grid; gap:16px; min-width:0; align-content:start; }
.dialog-form-section > .field { margin:0; }
.dialog-form-section > p { margin:0; }
.qb-extra-row { min-width:0; border-top:1px solid var(--hairline); padding-top:16px; }
.block-popover [data-qb-warning] { white-space:pre-line; }
.block-popover form.stack > :not([hidden]) ~ :not([hidden]) { margin-top:0; }
.block-popover [data-qb-extra-rows]:empty, .block-popover [role="status"]:empty { display:none; }
@media (min-width:760px) {
  .dialog-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:start; }
  .dialog-form-section .field-row.qb-groomer-row { grid-template-columns:minmax(0,1fr); }
  .qb-extra-rows { display:grid; gap:20px; }
}
/* Wide contextual headers anchor the title and identity across the panel. */
@media (min-width:651px) {
  .block-popover.has-dialog-close:has(.slot-summary) { padding-top:16px; }
  .block-popover.has-dialog-close:has(.slot-summary) .dialog-close { top:24px; right:24px; }
  .block-popover .slot-summary { box-sizing:border-box; width:100%; padding:16px 64px 16px 16px; background:var(--wash); border:1px solid var(--hairline); border-radius:var(--radius-soft); gap:6px; }
  .block-popover .slot-summary:has(.staff-avatar-large) { display:grid; grid-template-columns:minmax(0,1fr) 48px minmax(0,auto); column-gap:12px; row-gap:2px; text-align:left; }
  .block-popover .slot-summary:has(.staff-avatar-large) h2 { grid-column:1; grid-row:1/3; text-align:left; margin:0; }
  .block-popover .slot-summary .staff-avatar-large { grid-column:2; grid-row:1/3; width:48px; height:48px; font-size:20px; }
  .block-popover .slot-summary:has(.staff-avatar-large) strong, .block-popover .slot-summary:has(.staff-avatar-large) p { grid-column:3; }
  .block-popover .slot-summary:has(.staff-avatar-large) strong { align-self:end;line-height:1.2; }
  .block-popover .slot-summary:has(.staff-avatar-large) p { align-self:start;line-height:1.25; }
}

.quick-book-popover .combobox { position: relative; }
.quick-book-popover .combobox-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 7; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius-soft); box-shadow: 0 8px 24px #14253a2e; max-height: 220px; overflow-y: auto; margin: 2px 0 0; padding: 4px; list-style: none; }
.quick-book-popover .combobox-list li { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.quick-book-popover .combobox-list li.is-active, .quick-book-popover .combobox-list li:hover { background: var(--wash); }
/* Batch 10 item 1: shared in-app confirm/alert dialog, same card as the
   block/quick-book popover above but centred (native dialog:modal UA
   rules inset:0 + margin:auto still apply - .block-popover only
   overrides `position`, not inset/margin). */
.confirm-popover { width: 400px; max-width: calc(100vw - 32px); }
.confirm-popover .confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.confirm-popover .confirm-actions button { flex: 1 1 auto; min-width: 0; }
.btn.danger { background: var(--drop-no); border-color: var(--drop-no); color:var(--white); }
.btn.danger:hover { background: color-mix(in srgb, var(--drop-no) 85%, black); border-color: color-mix(in srgb, var(--drop-no) 85%, black); }
.qb-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font: 600 14px/1 var(--text); box-shadow: 0 8px 24px #14253a3d; z-index: 20; }
/* Batch 11 (27 Oct, Ryan 14:17, Fable): dog photo gallery redesign.
   .photo-frame is the one shared "photo in a frame" surface - gallery
   tiles, the booking drawer's large photo, and the lightbox stage all
   use it (cool fill, hairline, 10px radius, badges in the corners).
   Same tokens as every other card; no new colours. */
.photo-frame { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--cool); border: 1px solid var(--hairline); padding: 0; margin: 0; color: var(--ink); font: inherit; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.photo-badge { position: absolute; top: 6px; display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font: 600 11.5px/1 var(--text); letter-spacing: .02em; white-space: nowrap; }
.photo-badge.main { left: 6px; background: var(--ink); color: #fff; }
.photo-badge.tag { right: 6px; background: #fff; color: var(--ink); border: 1px solid var(--rule); }
/* Ryan 01:16: in the dog gallery the Main and Before/After badges collided on
   narrow tiles. Main moves to the bottom-left corner; the tag stays top-right. */
.gallery-photo .photo-badge.main { top: auto; bottom: 6px; }
.photo-frame-cta { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; background: #ffffffe6; color: var(--ink); font: 600 13px/1 var(--text); text-align: center; border-top: 1px solid var(--hairline); }
/* Gallery grid: each tile is a small card - photo on top (the drag
   handle, tap opens the lightbox), labelled controls underneath. */
.dog-gallery { margin-top: 10px; }
.dog-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.dog-gallery-grid.drag-over { outline: 2px dashed var(--blue); outline-offset: 6px; border-radius: var(--radius); background: var(--wash); }
.dog-gallery-item { position: relative; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dog-gallery-item .gallery-photo { cursor: pointer; touch-action: pan-y; }
.dog-gallery-item .gallery-photo:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dog-gallery-item.is-main .gallery-photo { border-color: var(--ink); box-shadow: 0 0 0 2px var(--blue-tint); }
.gallery-controls { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gallery-tag-seg { display: flex; width: 100%; min-width: 0; }
/* Item 12: the global 44px touch-target min-width rule (".btn, .segmented
   button {min-width:...}" etc) was widening these buttons past the ~96px
   photo tile, clipping "After" to "Aft". min-width:0 here, scoped to this
   control only, lets the buttons shrink to fit; the 44px hit area is kept
   via ::after (inset, not layout box) so touch targets are unaffected. */
.segmented.sm.gallery-tag-seg button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 4px; font-size: 11px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-tag-seg button::after { content: ""; position: absolute; inset: -6px; }
.gallery-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 36px; min-width: 0; }
.gallery-actions .gallery-make-main { padding: 0 6px; font-size: 12.5px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.gallery-actions .gallery-make-main::after { content: ""; position: absolute; inset: -6px; }
/* Fixed during Build 4 QA (item 12): ".segmented.sm button" (0,2,1) was
   out-specifying ".gallery-tag-seg button", so the Before/After shrink never
   applied; and "Make main" (80px of text at 14.5px) cannot fit beside the
   delete button in a ~104-107px phone/tablet tile, so it was clipped to
   "ake ma". Narrow tiles show "Main" (ITEMS.md item 12's sanctioned
   fallback; aria-label keeps "Make main photo"); wide tiles keep "Make main". */
.dog-gallery-item { container-type: inline-size; }
.gallery-make-main .gallery-mm-short { display: none; }
@container (max-width: 129px) {
  .gallery-make-main .gallery-mm-long { display: none; }
  .gallery-make-main .gallery-mm-short { display: inline; }
}
.gallery-main-label { display: inline-flex; align-items: center; gap: 4px; font: 600 13px/1 var(--text); color: var(--ink); padding-left: 2px; }
.gallery-main-label svg { width: 16px; height: 16px; }
.gallery-delete { width: 36px; height: 36px; color: var(--ink-soft); }
.gallery-delete svg { width: 20px; height: 20px; }
.gallery-delete:hover, .gallery-delete:focus-visible { color: var(--ink); }
/* Drag-and-drop reorder: the picked-up tile leaves a dashed slot behind
   (the drop indicator) and a floating copy follows the pointer. */
.dog-gallery-item.is-dragging { opacity: .999; }
.dog-gallery-item.is-dragging > * { visibility: hidden; }
.dog-gallery-item.is-dragging::before { content: ""; position: absolute; inset: 0; border: 2px dashed var(--blue); border-radius: var(--radius); background: var(--wash); }
.dog-gallery-grid.is-reordering .gallery-photo { cursor: grabbing; }
.gallery-ghost { position: fixed; z-index: 30; margin: 0; width: auto; aspect-ratio: auto; pointer-events: none; box-shadow: 0 14px 36px #14253a40; border-color: var(--ink); background: #fff; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .dog-gallery-item { transition: none !important; } }
/* Upload tiles: the file's own preview appears at once with a progress
   bar across the bottom of the photo; a failed file keeps its preview and
   says why, with a Remove button. */
.dog-gallery-item.is-uploading .gallery-photo img { opacity: .55; }
.gallery-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #ffffffcc; }
.gallery-progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .15s linear; }
.gallery-status { color: var(--ink-soft); line-height: 1.3; }
.dog-gallery-item.is-failed .gallery-photo { border-color: var(--ink); }
.gallery-photo.no-preview { display: flex; align-items: center; justify-content: center; padding: 10px; cursor: default; }
.gallery-no-preview { font: 600 12.5px/1.3 var(--text); color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }
.dog-gallery-item.is-failed .gallery-status { color: var(--ink); font-weight: 600; }
.dog-gallery-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--input-border); background: var(--field); cursor: pointer; text-align: center; padding: 8px; color: var(--ink); align-self: start; }
.dog-gallery-add:hover, .dog-gallery-add:focus-within { border-color: var(--ink); background: #fff; }
.dog-gallery-add .gallery-add-icon { width: 36px; height: 36px; border-radius: 999px; background: var(--blue-tint); display: inline-flex; align-items: center; justify-content: center; }
.dog-gallery-add .gallery-add-icon svg { width: 20px; height: 20px; }
.dog-gallery-add .gallery-add-text { font: 600 14px/1.2 var(--text); }
.dog-gallery-add .gallery-add-sub { font: 350 12px/1.2 var(--text); color: var(--ink-soft); }
.dog-gallery-add input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dog-gallery-hint { font-size: 12.5px; color: var(--placeholder); margin: 8px 0 0; }
@media (hover: none) { .dog-gallery-add .gallery-add-sub { display: none; } }
/* Lightbox: a white card on the same translucent backdrop as the block
   sheet, not a dark full-screen. Photo in a .photo-frame stage, dog name,
   tag pill, "2 of 5", Previous/Next ghost buttons. */
.dog-lightbox { width: min(960px, calc(100vw - 2 * var(--gutter))); max-width: none; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border: 1px solid var(--hairline); border-radius: var(--radius-soft); padding: 0; background: #fff; color: var(--ink); box-shadow: 0 16px 48px #14253a3d; display: flex; flex-direction: column; overflow: hidden; }
.dog-lightbox::backdrop { background: #14253a4d; backdrop-filter: blur(3px); }
.lightbox-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--hairline); }
.lightbox-titles { min-width: 0; flex: 1 1 auto; }
.lightbox-titles .kicker { margin: 0; }
.lightbox-title { font-size: 22px; line-height: 1.35; padding-bottom: 0.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.lightbox-count { font-size: 16px; color: var(--ink-soft); white-space: nowrap; }
.lightbox-stage { background: var(--cool); display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-height: 0; overflow: hidden; touch-action: pan-y; }
/* Ryan 3 Nov 19:43: the full-size viewer must show the whole photo (imported MoeGo shots are landscape), never crop it. */
.lightbox-stage img { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.lightbox-foot { flex-shrink: 0; display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0)); border-top: 1px solid var(--hairline); }
.lightbox-foot .btn svg { width: 18px; height: 18px; }
@media (max-width: 650px) {
  .lightbox-head { padding: 10px 8px 10px 16px; }
  .lightbox-title { font-size: 19px; }
  .dog-lightbox { width: calc(100vw - 12px); height: calc(100dvh - 12px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .lightbox-foot .btn { flex: 1 1 0; }
}
/* Booking drawer large photo: the same .photo-frame as a gallery tile,
   with the main badge and a "View all photos" strip; tap opens the
   shared lightbox. */
.drawer-photo { width: 180px; aspect-ratio: 1; margin: 0 auto 12px; cursor: pointer; border-color: var(--ink); box-shadow: 0 0 0 2px var(--blue-tint); }
.drawer-photo:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (min-width: 651px) { .drawer-photo { width: 200px; } }
@media (max-width: 650px) { .qb-toast { bottom: calc(24px + var(--tab-h) + env(safe-area-inset-bottom, 0)); } }
.sticky-bar.is-stuck { border-bottom-color: var(--ink-40, var(--hairline)); }
.sticky-bar.is-stuck::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 6px; background: linear-gradient(to bottom, #14253a1f, transparent); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .sticky-bar { transition: border-color .15s var(--ease); } }
@media (max-width: 650px) {
  .sticky-bar { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .sticky-bar .btn.sm { padding: 0 10px; font-size: 14px; }
}
/* Focusable elements never land hidden under the fixed bars. */
:focus-visible { scroll-margin-top: calc(var(--bar-h, 0px) + var(--sticky-h, 0px)); }
.stack > :not([hidden]):not(script):not(style) ~ :not([hidden]):not(script):not(style) { margin-top: 12px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; } }

/* ---------- Card (= website .who-card / .tip: white, 1px rule, 18px radius) ---------- */
.card { --card-pad: 16px; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius-soft); padding: var(--card-pad); box-shadow: 0 1px 2px #14253a0a; }
.card + .card { margin-top: 12px; }
/* Named card destinations must clear the fixed application header. */
.card[id] { scroll-margin-top: calc(var(--bar-h, 0px) + 16px); }
.card h2, .card h3 { margin-bottom: 10px; }
.card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card .card-head h2, .card .card-head h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Header band (restraint pass): a card's direct .card-head runs edge to edge
   in --cool with a hairline under it; body content sits below on white. */
.card > .card-head { margin: calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad)) 14px; padding: 12px var(--card-pad); min-height: 52px; align-items: center; background: var(--cool); border-bottom: 1px solid var(--hairline); border-radius: calc(var(--radius-soft) - 1px) calc(var(--radius-soft) - 1px) 0 0; }
/* Theo, 15 Nov 2026: a second/third .card-head inside the same card (e.g.
   Profile tab's Annual leave and Website profile sub-sections) inherited
   the same negative top margin meant for the card's FIRST header band
   (pulling it flush with the card's own top edge) - for a later header
   that pulled it flush against the preceding field's help text instead,
   closing the gap entirely. Only the first header band bleeds to the top
   edge; every later one gets the standard gap above it instead. */
.card > .card-head:not(:first-child), .card > div > .card-head { margin-top: 24px; border-radius: 0; }
/* A header-only identity card has no empty body below its band. */
.card > .card-head:only-child { margin-bottom: calc(-1 * var(--card-pad)); border-bottom: 0; border-radius: calc(var(--radius-soft) - 1px); }
.card > .card-head h2 { font-size: 18px; font-weight: 600; }
.card > .card-head .muted, .card > .card-head .small { font-size: 14px; }
@media (min-width: 900px) { .card { --card-pad: 20px; } }
/* Interactive cards respond as a whole: neutral border, soft shadow, 1px lift. Never a one-edge change. */
a.card, .client-tile { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
a.card:hover, .client-tile:hover { border-color: var(--ink-40); box-shadow: 0 6px 18px #14253a1f; transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { a.card, .client-tile { transition: none; } a.card:hover, .client-tile:hover { transform: none; } }

/* ---------- Segmented control (= website .view-toggle re-expressed with .btn.ghost tokens) ---------- */
.segmented { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #fff; }
.segmented a, .segmented button { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; font: 600 16px/1 var(--text); color: var(--ink); text-decoration: none; background: #fff; border: 0; cursor: pointer; }
.segmented .count { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.segmented [aria-current="true"] .count, .segmented [aria-pressed="true"] .count { color: #fff; opacity: .8; }
.segmented [aria-current="true"] .count-badge, .segmented [aria-pressed="true"] .count-badge { background: #fff; color: var(--ink); }
.segmented [aria-current="true"], .segmented [aria-pressed="true"] { background: var(--ink); color: #fff; }
/* Batch 11: compact variant for in-card controls (gallery tile tags). */
.segmented.sm button { min-height: 36px; padding: 0 10px; font-size: 13.5px; }
/* Batch 24: full-width variant (same tokens, two equal halves) for fields
   like "Time layout" where an inline-width control leaves a gap. */
.segmented.full { display: flex; width: 100%; }
.segmented.full a, .segmented.full button { flex: 1; justify-content: center; }
.segmented.sm button + button { border-left: 1px solid var(--rule); }
.segmented.sm [aria-pressed="true"] + button { border-left-color: var(--ink); }
.segmented.sm [data-choice][aria-pressed="true"] + button { border-left-color:transparent; }

/* ---------- Chips (groomer filter): ghost chip, selected = ink ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }

/* The Inbox filter row doubles as a .sticky-bar: put its horizontal
   padding back at the page gutter now that the shared class pulls it
   edge to edge, instead of letting the chips touch the viewport edge. */
.chips.sticky-bar { padding:8px var(--gutter); }
/* B0 fix: DESIGN.md's own component table lists .chip at 40px, but its
   rule 6 ("touch targets 44px minimum") and the brief's acceptance check
   9 both require every .chip to be >= 44px - found via that exact check.
   Sided with the explicit, measured 44px rule over the component table's
   40px (a 4px difference, within the brief's own visual tolerance). */
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink); font: 600 15px/1 var(--text); text-decoration: none; white-space: nowrap; cursor: pointer; }
.chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { margin-right:0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--input-border)); flex: none; }
.chip .count { font-size: 13px; color: var(--ink-soft); }
/* A selected chip's own text already turns solid white via the rule
   above, but this count span has its own colour, so it needs covering
   separately - both selected states a chip can carry (aria-current for
   link-style chips, e.g. reports ranges; aria-pressed for button-style
   filter chips, e.g. the Breeds/needs-a-size chips), not just one. --ink-soft
   on the --ink fill measures ~1.9:1 (fails WCAG AA); #fff at 80% opacity
   on --ink measures ~10.3:1. */
.chip[aria-current="true"] .count, .chip[aria-pressed="true"] .count { color: #fff; opacity: .8; }

/* ---------- Status pills: tonal, website tokens only ---------- */
/* Build 4 QA (item 13): pixel-measured at 4x, the font's ascent/descent
   asymmetry left "All booked"/"Booked" ink up to 2px high at 390 (box
   24px) even with symmetric 3px padding. 3.5/2.5 nudges ink 0.5px down:
   measured within 1px of centred at 390 and 1440. Same box height. */
.pill { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 24px; padding: 3.5px 9px 2.5px; border-radius: 999px; font: 600 12.5px/1.2 var(--text); letter-spacing: .01em; white-space: nowrap; border: 1px solid transparent; }
.pill.sm { min-height: 20px; padding: 1px 7px; font-size: 11.5px; }
/* Addendum, 3 Nov 2026 (Ryan, Telegram: "can we add some colour to these
   pills... whatever the status is?") - authorised colour on these six
   static status pills, overriding this file's earlier "website tokens
   only, no red/amber/green" rule for this one component. Every pair
   reuses an existing app token combo (next-in-soon/later, kpi-delta.bad)
   and measures >=4.5:1; see DESIGN.md addendum for the full mapping. */
.pill.booked    { background: color-mix(in srgb, var(--blue) 24%, #fff); color: var(--ink); border-color: color-mix(in srgb, var(--blue) 55%, #fff); }
.pill.confirmed { background: #E3F3E8; color: #166534; border-color: #BEE3C8; }
.pill.arrived   { background: color-mix(in srgb, var(--blue) 55%, #fff); color: var(--ink); border-color: var(--blue); }
.pill.done      { background: #E3F3E8; color: #166534; border-color: #BEE3C8; }
.pill.done::before { content:""; display:inline-block; flex:none; width:5px; height:9px; border:solid currentColor; border-width:0 2px 2px 0; transform:translateY(-1px) rotate(45deg); }
.pill.cancelled { background: #FBEFD6; color: #92400E; border-color: #F0DBA8; }
.pill.no_show, .pill.failed { background: #FEF2F2; color: var(--busy-bad-text); border-color: #F3C4C4; }
.pill.alert     { background: var(--drop-no); color: #fff; }
/* Ryan 01:14: dog safety alerts (e.g. "bites") read in red everywhere - same
   --drop-no red as .btn.danger and the appConfirm danger button. */
.pill.alert svg { width: 14px; height: 14px; flex: none; }
.notice.strong.alert { border-left-color: var(--drop-no); background: color-mix(in srgb, var(--drop-no) 7%, #fff); color: var(--busy-bad-text); }
.notice.strong.alert svg { color: var(--drop-no); }
.dog-row .dog-alert-pill { display: inline-flex; width: fit-content; max-width: 100%; align-self: flex-start; margin-top: 4px; white-space: normal; line-height: 1.2; padding: 4px 9px; }
.pill.info      { background: var(--cool); color: var(--ink); border-color: var(--rule); }
.pill.low       { background: #FBEFD6; color: #92400E; border-color: #F0DBA8; }
.pill.out       { background: #FEF2F2; color: var(--busy-bad-text); border-color: #F3C4C4; }
/* Point 7 (RYAN-FEEDBACK-2026-10-27.md): client directory "Next in" pill.
   Soon is good, so this is never a red/amber-for-urgency traffic light -
   green this week, soft amber next week, neutral later, muted grey with
   no upcoming visit. Text label is always present too; colour is a second
   cue, not the only one. Every pair below is >=4.5:1 contrast. */
.pill.next-in-soon  { background: #E3F3E8; color: #166534; border-color: #BEE3C8; }
.pill.next-in-later { background: #FBEFD6; color: #92400E; border-color: #F0DBA8; }
.pill.next-in-far   { background: var(--cool); color: var(--ink-soft); border-color: var(--rule); }
.pill.next-in-none  { background: var(--paper); color: var(--ink-soft); border-color: var(--rule); }

/* ---------- Appointment card (list form, phone Today / diary) ---------- */
.appt { background: #fff; border: 1px solid var(--rule); border-left: 5px solid var(--rule); border-radius: 12px; padding: 12px 14px 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; }
.appt + .appt { margin-top: 10px; }
.appt.booked    { border-left-color: var(--rule); }
.appt.confirmed { border-left-color: var(--blue-tint); }
.appt.arrived   { border-left-color: var(--blue); background: var(--wash); }
.appt.cancelled, .appt.no_show { border-left-color: var(--rule); background: var(--paper); color: var(--ink-soft); }
.appt .when { font: 600 15px/1.2 var(--text); color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.appt .when b { font: 600 20px/1 var(--display); color: var(--ink); letter-spacing: -.01em; }
.appt .dog small { font: 400 14.5px/1.2 var(--text); color: var(--ink-soft); margin-left: 6px; }
.appt .svc { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.appt .notice { grid-column: 1 / -1; margin-top: 8px; }
.appt .dog { font: 600 19px/1.2 var(--display); color: var(--ink); margin-top: 4px; min-width: 0; overflow-wrap: anywhere; }
.appt .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.appt .when, .appt .dog, .appt .svc, .appt .flags { grid-column: 1; }
.appt .side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.appt .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-tint); display: grid; place-items: center; font: 600 15px/1 var(--display); color: var(--ink); }
.appt .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.appt .actions .btn { flex: 1 1 auto; }
/* B0 gate fix (Fable): on desktop the list cards are page-wide, so a
   flex-grow button became ~450px. Cap at a sensible width; the mockup's
   desktop cards never show a button wider than ~200px. */
@media (min-width: 900px) { .appt .actions .btn { flex: 0 1 auto; min-width: 160px; } }

/* ---------- Timeline diary (phone list + desktop grid) ---------- */
.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; }
.tl-row + .tl-row { margin-top: 10px; }
.tl-row .t { font: 600 15px/1 var(--display); color: var(--ink-soft); padding-top: 14px; text-align: right; }
.tl-gap { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px dashed var(--rule-row); border-radius: 12px; color: var(--ink-soft); font-size: 15px; }
.tl-block { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--cool) 0 8px, var(--paper) 8px 16px); color: var(--ink-soft); font-size: 15px; border: 1px solid var(--rule); }
.now-line { height: 2px; background: var(--blue); position: relative; margin: 6px 0 6px 62px; }
.now-line::before { content: "now"; position: absolute; left: -62px; top: -9px; font: 700 12px/1 var(--text); color: var(--blue); width: 52px; text-align: right; }

/* Batch 8 R2-2 (27 Oct 2026, Ryan round 2 final): the outer card frame
   (border/radius) is dropped entirely - its top corners lost their
   border/radius under the sticky .gh header row, and it ate width. Grid,
   time ruler and header row now run full window width with one equal
   inner --gutter padding each side (see .diary-scroll/main below), shared
   with the app bar/toolbar/picker row via the same --gutter token. */
.grid-diary { display: grid; grid-template-columns: 56px repeat(var(--cols, 6), minmax(150px, 1fr)); gap: 0; background: #fff; }
/* Batch 3 point B: the grid used to clip (overflow:clip) so its own rounded
   corners held, but ANY non-visible overflow on an ancestor becomes the
   sticky containing block for a descendant's position:sticky - that's
   what pinned .gh to the old .diary-scroll pane's scrollport instead of
   the real viewport. The grid border now simply isn't rounded past its own
   edges (acceptable - a 1px square top corner under the header is not
   visible against the white page), so nothing between .gh and the
   viewport sets overflow other than visible, and .gh can stick to the
   viewport directly under the app bar + controls bars. */
/* Ryan 27 Oct 21:36: an open (hovered/focused) card is lifted to z-index 20
   so it clears neighbouring columns - the sticky staff header, corner and
   time ruler sit above that (21-23) so an open card never covers names. */
/* One responsive heading scale across Day, Week and Availability. */
.grid-diary { --diary-heading-size:16px; --diary-sub-size:13px; }
@media(min-width:651px) and (max-width:899px) { .grid-diary { --diary-heading-size:12.5px; --diary-sub-size:10.5px; } }
@media(max-width:650px) { .grid-diary { --diary-heading-size:13.5px; --diary-sub-size:11px; } }
@media(min-width:900px) and (max-width:1279px), (min-width:900px) and (max-height:760px) { .grid-diary { --diary-heading-size:15px; } }
.grid-diary .gh a { color: inherit; text-decoration: none; }
.grid-diary .gh a:hover { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; }
.grid-diary .gh.off { color: var(--ink-soft); font-weight: 400; }
.grid-diary .gh.corner { border-bottom: 2px solid var(--ink); }
/* Batch 21 item 2: narrow columns (phone day-all + week) truncated the full
   name with no way to read the rest ("Hannah Lockw..."). First name only
   there; the full name stays on wide single-groomer columns and is always
   available via the wrapper's title/aria-label either way. */
.grid-diary .gh-name { display: inline; min-width: 0; }
.grid-diary .gh-name-short { display: none; }
/* Specificity note: narrow-width media queries further down apply a blanket
   "display: block" to every span inside .gh (for ellipsis truncation) at a
   higher specificity than a bare .gh-name-full/.gh-name-short rule would
   have - chain the .gh class here too so the full/short swap always wins. */
.grid-diary.day-all .gh .gh-name-full { display: none; }
.grid-diary.day-all .gh .gh-name-short { display: inline; }
/* Theo review of batch 29: same full/short pattern as the name above, for
   the sub-line's "NN% booked" - narrow columns must never clip the figure
   itself (nowrap+ellipsis was eating it), so .sub-short (dayColumn(),
   diary.ts) drops "booked" - and, on week's "all staff" column, the
   "M groomers on" clause too - instead of truncating .sub-full. Desktop
   (this default) always shows the full line; the narrow breakpoints below
   flip which span is visible, same specificity note as gh-name above. */
.grid-diary .gh small .sub-short { display: none; }
/* All-staff week summaries include staff, visits and percentage on one line. */
.grid-diary.week-grid.all .gh small { font-size: var(--diary-sub-size); white-space: nowrap; }
.grid-diary.week-grid.all .gh small .sub-full { white-space: nowrap; }
/* Batch 21 item 4: each .gt label used to sit in normal flow with its own
   box height (and the first one was shrunk by 11px to stop its text poking
   above the grid's top edge) - flow sizing like that is cumulative, so the
   08:00-09:00 row visibly rendered shorter than every other hour even
   though .gcol's background-image grid lines are perfectly uniform.
   Absolute-position every label at its exact hour offset (set inline by
   timeRuler() in diary.ts) instead, so the row dividers - the real source
   of truth - are never affected by a label's own box model. */
.grid-diary .gt { position: absolute; left: 0; right: 0; font: 600 12px/1 var(--display); color: var(--ink-soft); text-align: right; padding: 2px 8px 0 0; height: var(--hour-h, 72px); }
.grid-diary .gtimes { position: relative; border-right: 1px solid var(--rule); }
.grid-diary .gcol { position: relative; height: calc(var(--hour-h, 72px) * var(--hours, 10)); border-right: 0; --diary-grid-lines: linear-gradient(to bottom, color-mix(in srgb,var(--rule-row) 45%,transparent) 1px, transparent 1px), linear-gradient(to bottom, transparent calc(var(--hour-h, 72px) / 2 - 1px), color-mix(in srgb,var(--rule) 45%,transparent) calc(var(--hour-h, 72px) / 2 - 1px), color-mix(in srgb,var(--rule) 45%,transparent) calc(var(--hour-h, 72px) / 2), transparent calc(var(--hour-h, 72px) / 2)); background-color:var(--cool); background-image:var(--diary-grid-lines); background-size: 100% var(--hour-h, 72px); }
.grid-diary .gcol:last-child { border-right: 0; }
.grid-diary .gcol.off { background-image: var(--diary-grid-lines); }
.grid-diary .gcol.off::after { content: "Unavailable"; position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: var(--ink-soft); font-size: 14px; pointer-events: none; }
.grid-diary .gcol.off:has(.diary-off-action)::after { content:none; }
.grid-diary { position:relative; --hours-footer-height:28px; --diary-footer-space:0px; }
/* One end-of-timetable boundary, shared by ruler, staff and range-edge panels. */
.grid-diary::after { content:""; position:absolute; left:0; right:0; bottom:var(--diary-footer-space); height:1px; background:var(--input-border); z-index:24; pointer-events:none; }
.grid-diary:not([data-show-hours="false"]):has(.diary-off-controls) { --diary-footer-space:var(--hours-footer-height); padding-bottom:var(--diary-footer-space); }
.grid-diary[data-show-hours="false"] .diary-off-controls { display:none; }
/* Item 10: two actions (Adjust hours + Block time) can now share this row -
   flex:1 1 0 (not width:100%) so each takes an equal share instead of
   overflowing when there's more than one. */
.diary-workspace .diary-off-action.btn { position:relative;display:flex;flex:1 1 0;min-width:0;min-height:24px;height:24px;padding:0 4px;font-size:11px;line-height:1.25;font-weight:500;white-space:nowrap;text-align:center;background:transparent;border-color:transparent;box-shadow:none;gap:4px;overflow:hidden;text-overflow:ellipsis; }
.diary-off-action.btn:hover { background:var(--wash);border-color:var(--hairline);color:var(--ink); }
.diary-off-action > span { display:flex; }
.diary-off-action svg { width:14px;height:14px; }
/* Hours footer ("Adjust hours" per column) collapses to an 8px grab handle on every device
   (Ryan 30 Oct: it took too much space on mobile). Pointer devices expand it on hover/focus;
   touch devices expand it on tap (.is-open, toggled in diary.ts) and collapse on a tap elsewhere. */
.grid-diary { --hours-footer-height:8px; }
.diary-off-controls { position: absolute; top: 100%; left: 0; right: 0; height: 8px; box-sizing: border-box; z-index: 11; padding: 0 2px; background: var(--white); border-top: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.diary-off-controls > .diary-off-action { opacity:0;pointer-events:none; }
.diary-off-controls::before { content:'';position:absolute;top:3px;left:calc(50% - 12px);width:24px;height:2px;border-radius:2px;background:var(--rule); }
.diary-off-controls::after { content:'';position:absolute;left:0;right:0;top:-10px;bottom:-14px; }
.grid-diary:has(.diary-off-controls.is-open) { --hours-footer-height:28px; }
.grid-diary:has(.diary-off-controls.is-open) .diary-off-controls { height:28px;padding:2px;overflow:visible; }
.grid-diary:has(.diary-off-controls.is-open) .diary-off-controls > .diary-off-action { opacity:1;pointer-events:auto; }
.grid-diary:has(.diary-off-controls.is-open) .diary-off-controls::before, .grid-diary:has(.diary-off-controls.is-open) .diary-off-controls::after { display:none; }
@media (hover:hover) and (pointer:fine) {
 .grid-diary:has(.diary-off-controls:hover,.diary-off-controls:focus-within) { --hours-footer-height:28px; }
 .grid-diary:has(.diary-off-controls:hover,.diary-off-controls:focus-within) .diary-off-controls { height:28px;padding:2px;overflow:visible; }
 .grid-diary:has(.diary-off-controls:hover,.diary-off-controls:focus-within) .diary-off-controls > .diary-off-action { opacity:1;pointer-events:auto; }
 .grid-diary:has(.diary-off-controls:hover,.diary-off-controls:focus-within) .diary-off-controls::before, .grid-diary:has(.diary-off-controls:hover,.diary-off-controls:focus-within) .diary-off-controls::after { display:none; }
}
/* Pre-existing stray extra "}" removed here (QA for item 21, 4 Nov batch):
   it silently broke the CSS parser's recovery for several hundred lines
   following it - the browser dropped every rule between here and the next
   resync point rather than erroring loudly, which is why the item-21 fix
   below did not apply until this was found and removed. Verified no
   intentionally-dropped rule depended on the old broken state: the diary,
   staff, breeds and client pages were screenshot-checked at 390/768/1440
   after this fix. */
/* Item 21 (Ryan 19:12 voice): on phone the column-bottom action (Adjust
   hours, or Review time off - item 23 moved Block day into the Adjust
   hours dialog, so only one button occupies this row now) was a real
   24px/11px tap target once revealed. Keep the visual row compact but give
   it a genuine 44px hit area via ::after inset (the same pattern the page
   header controls already use), and bump the label to 14px. */
@media (max-width:650px) {
  .grid-diary:has(.diary-off-controls.is-open) { --hours-footer-height:44px; }
  .grid-diary:has(.diary-off-controls.is-open) .diary-off-controls { height:44px; }
  .diary-workspace .diary-off-action.btn { min-height:32px;height:32px;font-size:14px;padding:0 10px; }
  .diary-off-action.btn::after { content:"";position:absolute;inset:-6px; }
  .diary-off-action svg { width:16px;height:16px; }
}



/* Week grid: seven date columns sharing the day grid's components. Today is tinted; the ruler stays put when the grid scrolls sideways on small screens. */
.grid-diary.week-grid .gh.today { background-color: var(--wash); }
/* Batch 29 (Ryan 23:46 voice): the top/bottom blue bars on today's header
   are gone, with nothing replacing them - the header's busyness tint
   (.tint-bad/warn/good, base rules above) and the column's own light wash
   fill (rule just above) are enough to mark "today" on their own. */
.grid-diary.week-grid .gh.today.tint-bad { background: color-mix(in srgb, var(--tint-bad) 14%, #fff); }
.grid-diary.week-grid .gh.today.tint-warn { background: color-mix(in srgb, var(--tint-warn) 14%, #fff); }
.grid-diary.week-grid .gh.today.tint-good { background: color-mix(in srgb, var(--tint-good) 14%, #fff); }
/* Batch 23 item 1 (Ryan 21:43 voice, Option A): slim neutral-ink fill bar
   + "62%" label under each week day header, built from the same capacity
   numbers the sub-line already summarised. flex-wrap lets this wrapper
   (flex-basis 100%) drop onto its own line below the name/sub-line, which
   is the header's only other child. Day background and today's blue
   treatment are untouched - the bar sits inside the existing .gh box, not
   the .gcol below it.
   Batch 28 item 1: day view (single groomer + "All") now renders this same
   element for real groomer columns, so the wrap rule applies to every
   .gh, not just week-grid's.
   Batch 29 DESIGN CHANGE (Ryan 23:13 voice, agreed by Theo): the bar is
   gone. Busyness now tints the whole header background (pale red/amber/
   green, 14% of the fill colour into white) with a "NN% booked" phrase
   folded into the existing sub-line instead of a separate element - one
   fewer flex child, so the hysteresis/no-jump fix below only ever has to
   reserve space for the sub-line, never a second row. Past/off-duty
   columns get no tint (diary.ts only sets the tone class when usable and
   today-or-future, same gate the old bar used). Text (name + sub-line)
   stays dark/AA on every tint - verified numerically per colour x tint in
   scripts/batch29-contrast.mjs. */
.grid-diary .gh { flex-wrap: wrap; }
/* One capacity meter shared by roomy desktop and selected-groomer mobile headers. */
.grid-diary .gh .busy-meter { --diary-busy-fill:var(--busy-bad); display:none !important; position:relative; isolation:isolate; overflow:hidden; width:100%; min-height:18px; margin-top:5px; border-radius:999px; background:color-mix(in srgb,var(--busy-bad) 34%,#fff); color:var(--ink); font:700 10.5px/18px var(--text); text-align:center; }
.busy-meter::before { content:""; position:absolute; z-index:-1; inset:0 auto 0 0; width:var(--busy-percent); background:var(--diary-busy-fill); }
/* Unified traffic-light rule (Ryan, 3 Nov): same red/amber/green bands as
   Reports utilisation and the month view, via the shared .tl-bad/warn/good
   classes (busynessClass() in src/web/busyness.ts). */
.grid-diary .gh .busy-meter.tl-warn { --diary-busy-fill:var(--busy-warn); background:color-mix(in srgb,var(--busy-warn) 34%,#fff); }
.grid-diary .gh .busy-meter.tl-good { --diary-busy-fill:var(--busy-good); color:var(--white); background:var(--busy-good); }
@media(min-width:900px) { .grid-diary .gh .busy-meter { display:block !important; } }
@media(max-width:650px) {
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] > span { display:grid; grid-template-columns:44px max-content minmax(0,1fr); column-gap:8px; align-items:center; width:100%; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .gh-name-row { display:contents; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .diary-staff-avatar { grid-column:1; grid-row:1 / 3; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .gh-name { grid-column:2; grid-row:1; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] small { grid-column:3; grid-row:1; margin:0; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .sub-full { display:inline !important; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .sub-short { display:none !important; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"] .busy-meter { display:block !important; grid-column:2 / 4; grid-row:2; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-active="true"]:not(:has(.busy-meter)) .diary-staff-avatar { grid-row:1; }
}
/* Batch 29 (Ryan 23:45 voice): the scroll-collapse is removed entirely -
   now that busyness is a tint + a short sub-line ("40% booked") rather
   than a bar, the header's normal size is already compact enough that
   Ryan no longer wants it shrinking on scroll at all, on any width or
   view. The header stays sticky (base .gh rule, untouched) but is always
   full-size; see shared.ts for the matching removal of the collapse
   sentinels/observers and the --gh-row-h measurement that existed only to
   stop THAT feature from jumping the page. */
/* The corner cell is sticky on both axes (top from the base .gh rule,
   left here); .gtimes is only sticky left. Without a z-index gap between
   them they tie (same stacking context, same value) and DOM order - which
   puts .gtimes after the corner - wins, so an hour label visibly paints
   over "Time" as it scrolls up past the corner's position. The corner
   needs to always win that tie, hence the explicit z-index > .gtimes'. */
.grid-diary.week-grid .gh.corner, .grid-diary.day-all .gh.corner { position: sticky; left: 0; z-index: 23; background: #fff; }
.grid-diary.week-grid .gtimes, .grid-diary.day-all .gtimes { position: sticky; left: 0; z-index: 22; background: #fff; }
/* All-staff week is an overview: every groomer's visits share a day column, so each card keeps only time, dog and groomer. */
.grid-diary.week-grid.all .diary-position .ev-client, .grid-diary.week-grid.all .diary-position .ev-service, .grid-diary.week-grid.all .diary-position .ev-status, .grid-diary.week-grid.all .diary-position .ev-group { display: none; }



.ev { position: absolute; left: 6px; right: 6px; border-radius: 10px; background: #fff; border: 1px solid var(--rule); border-left: 5px solid var(--rule); padding: 8px 10px; overflow: hidden; font-size: 14px; line-height: 1.25; }
.ev .dog { font: 600 15.5px/1.2 var(--display); color: var(--ink); }
.ev .svc { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.ev .when { font: 600 12.5px/1 var(--text); color: var(--ink-soft); margin-bottom: 3px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }


/* Batch 8 R2-1 (27 Oct 2026, Ryan round 2): ANY active visit (booked,
   confirmed or arrived) the now-line is currently over gets the same soft
   sage tint + green edge - not just `arrived`. Ryan: Jenell won't mark
   bookings arrived, so gating the tint on that status hid "now" from him
   entirely. The "Now" text badge was dropped (crowded short cards); the
   tint + edge colour alone is the cue. Done/no_show are excluded (already
   finished / never happened). */
/* Ryan 27 Oct: in-progress visits read clearly GREEN (not the Sky groomer hue). */
.ev.now, .diary-position:hover .ev.now, .diary-position:focus-within .ev.now { background: color-mix(in srgb, var(--drop-ok) 22%, #fff); border-color: color-mix(in srgb, var(--drop-ok) 55%, #fff); border-left-color: var(--accent, var(--input-border)); }

.ev.block { background: repeating-linear-gradient(135deg, var(--cool) 0 8px, var(--paper) 8px 16px); border-left-color: var(--rule); color: var(--ink-soft); }
.ev.gap { background-color:var(--white,#fff); background-image:var(--diary-grid-lines); background-size:100% var(--hour-h,72px); background-position:0 calc(-1 * var(--gap-start,0) * var(--hour-h,72px) / 60 - 1px); border: 1px dashed var(--rule-row); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; }
.ev.gap b { color: var(--ink); font-weight: 600; }
/* Batch 8 R2-1: no-shows now render directly on the grid (diary.ts
   dayColumn includes them in laneItems) as a muted-red card, using the
   same --drop-no red the drag-clash feedback already uses (DESIGN.md's
   "one authorised red/green exception") rather than inventing a new hue. */
.ev.no_show { border-left-color: var(--drop-no); background: color-mix(in srgb, var(--drop-no) 10%, var(--cool)); color: var(--ink-soft); }
.ev.no_show .ev-status { background: var(--drop-no); border-color: var(--drop-no); color: #fff; }
/* Batch 8 R2-1: now-line turned green (was --blue) per Ryan's override of
   the blue-survivors rule - see DESIGN.md. Uses --drop-ok (the existing
   darker/more-saturated authorised-exception green, not --g1) because --g1
   alone measures under WCAG 1.4.11's 3:1 non-text contrast against the
   white grid background; --drop-ok measures ~4.9:1. */
.grid-now { position: absolute; left: 0; right: 0; height: 3px; background: var(--drop-ok); z-index: 10; }
/* Batch 3 point B: the old .diary-scroll was its own bounded, sticky,
   overflow:auto pane - a scroll-inside-scroll, exactly what Ryan flagged.
   It now sits in plain document flow with no height cap and no overflow
   of its own; the DOCUMENT scrolls, .gh/.gtimes stick to the real
   viewport (see the .grid-diary .gh rule), and the grid's own flexible
   `minmax(150px,1fr)` columns shrink to fit instead of forcing a
   horizontal scrollbar, so desktop/tablet is genuinely full width with no
   nested scroll container anywhere. Phone week view is the one
   deliberate exception - see the max-width:650px block below, which
   turns this same element into a horizontal-only scroll-snap track. */
.diary-scroll { width: 100%; max-width: 100%; }
.grid-diary .gh { position: sticky; top: calc(var(--bar-h) + var(--sticky-h, 0px)); z-index: 21; background: #fff; border-bottom: 2px solid var(--ink); padding: 12px 12px 10px; font: 600 var(--diary-heading-size)/1.3 var(--display); display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.grid-diary .gh span { min-width: 0; overflow-wrap: anywhere; }
.grid-diary .gh small { font: 400 var(--diary-sub-size)/1.3 var(--text); color: var(--ink-soft); white-space: normal; display: block; margin-top: 4px; line-height: 1.25; }
.diary-position { position: absolute; z-index: 2; min-width: 0; container-type: inline-size; }



.diary-position .ev.block { border-left-color: var(--rule); }
/* Hover/focus reveal: a cramped card grows to show every line, over its neighbours, without moving anything else. */
@media (hover: hover) and (min-width: 651px) {
  
  
  
  
  
  
  
  
  
  
  
  .diary-position:hover .ev :is(.ev-client, .ev-service, .ev-status, .ev-group, .ev-staff), .diary-position:focus-within .ev :is(.ev-client, .ev-service, .ev-status, .ev-group, .ev-staff) { display: block; white-space: normal; }
  
  
  
  .grid-diary.week-grid.all .diary-position:hover .ev :is(.ev-client, .ev-service, .ev-group), .grid-diary.week-grid.all .diary-position:focus-within .ev :is(.ev-client, .ev-service, .ev-group) { display: block; }
  
}
.chip i.dot { background: var(--accent, var(--input-border)); }

.diary-position .ev-main img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.diary-position .ev-main:focus-visible, .diary-position .ev-group:focus-visible { outline: 2px solid var(--blue); }







/* Batch 8 R2-3: was a block link pinned after .ev-main (height:100%), so it
   sat below the card's visible area and read as clipped garbled text
   ("Same booking #75"). Now a small positioned chip near the dog name - no
   raw id in the visible text, aria-label/title carry the other dog's name. */
.diary-position .ev-group { position: absolute; right: 6px; top: 6px; display: inline-flex; align-items: center; gap: 3px; background: var(--wash); color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 6px 1px 5px; font: 600 10.5px/1.5 var(--text); text-decoration: none; white-space: nowrap; z-index: 2; }
.diary-position .ev-group:hover { background: var(--blue-tint); color: var(--ink); }
.diary-position .ev.compact .ev-group, .diary-position .ev.brief .ev-group { display: none; }







/* The website icons leave ~1/3 of their canvas empty; scale the drawing up inside the clipped box so the dog, not the margin, fills it. */
.diary-drag-ghost .ev.has-pic .ev-pic, .diary-pending-move .ev.has-pic .ev-pic { display: block; }
/* Batch 29 (Ryan 23:50 voice): the picture is force-hidden below 651px
   (!important rule further down), same there during a drag-ghost/
   pending-move preview, so this padding-right only applies where it can
   actually show - matches the fix on the main has-pic rule below. */
@media (min-width: 651px) { .diary-drag-ghost .ev.has-pic, .diary-pending-move .ev.has-pic { padding-right: 56px; } }









.diary-position .ev.compact .ev-service, .diary-position .ev.compact .ev-status, .diary-position .ev.compact .ev-group, .diary-position .ev.compact .ev-staff { display: none; }

/* Free time: a quiet dashed span; Book/Block/Offer actions appear on hover or focus at desktop and stay visible on touch screens. Batch 21 item 3: on long gaps (an all-day 08:00-19:00 box) centring the text block mid-box read as noise - pin the time + links to the top of the box instead, same component in every column. */
.gap-position { left: 3px; right: 3px; z-index: 1; }
.gap-position .ev.gap { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 8px 3px 3px; box-shadow: none; }
.gap-position .ev.gap > span:first-child { color: var(--ink-soft); font-size: 12px; }
.gap-position .gap-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 10px; font-size: 12.5px; }
@media (hover: hover) and (min-width: 651px) {
  .gap-position .gap-actions { opacity: 0; transition: opacity .15s var(--ease); }
  .gap-position .ev.gap:hover .gap-actions, .gap-position .ev.gap:focus-within .gap-actions { opacity: 1; }
  .gap-position .ev.gap:hover { border-color: var(--blue); background-color:var(--white,#fff); }
}
.diary-gap-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; margin-top: 12px; }
.diary-gaps { min-width: 0; }
.diary-gap-list { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-soft); font-size: 13px; }
.diary-gap-list span { line-height: 1.4; }
/* design/2026-11-04-unified-page-header/DESIGN.md §4.1/§2.4: the groomer
   picker is now `.page-header-row > .diary-groomer-picker` - it never
   carries .sticky-bar itself any more (the .page-header root is the only
   sticky surface), so its own position/top/z-index/background are gone. */
.diary-groomer-picker { display: none; margin-bottom: 12px; padding: 4px var(--gutter); }
.diary-groomer-picker > span { display: block; font-weight: 700; margin-bottom: 6px; }
.diary-groomer-picker > .groomer-chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; }
.diary-groomer-picker .chip { min-height: 44px; flex: 0 0 auto; gap:5px; justify-content:center; }
/* Week view keeps its groomer chips at every width: they choose whose week
   the seven columns show. Never actually "stuck" (position:static), so the
   shared .sticky-bar edge-to-edge margin/width is reset back to normal flow
   here rather than pulling this row past the page gutter while idle. */
.diary-groomer-picker.always { display: flex; align-items: center; gap: 12px; position: static; padding: 0; margin-left: 0; margin-right: 0; width: auto; }
.diary-groomer-picker.always > span { margin: 0; }
.diary-groomer-picker.always > .groomer-chip-row { padding: 2px 0; }
/* Batch 3 point C: desktop/tablet keeps the chip rail (it never scrolled
   on its own axis badly, but Ryan asked it to wrap to a second line
   instead of ever showing a horizontal scrollbar) and hides the phone
   sheet trigger entirely; phone does the opposite. */
/* Batch 6: one groomer control per breakpoint - sheet button up to 899px,
   chip rail from 900px (matches the date-nav/quick-actions cutover below).
   Scoped to .diary-groomer-picker (not the bare .groomer-sheet-trigger
   class) so this hide rule outranks the always-on base rule declared
   further down regardless of source order - the previous unscoped
   version lost that specificity tie and left the sheet button visible
   at every width, doubled up with the chip rail on tablet. */
@media (min-width: 900px) {
  .diary-groomer-picker > .groomer-chip-row { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }
  .diary-groomer-picker .groomer-sheet-trigger, .diary-groomer-picker .groomer-sheet { display: none; }
}
.groomer-sheet-trigger { text-decoration:none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--input-border); border-radius: 999px; background: #fff; font: 600 15px/1.3 var(--text); color: var(--ink); }
.groomer-sheet { position: fixed; inset: auto 0 0 0; z-index: 60; margin: 0; width: 100%; max-width: none; max-height: min(70dvh, 480px); border: 0; border-top: 1px solid var(--hairline); border-radius: 16px 16px 0 0; padding: 0; background: var(--white); box-shadow: 0 -8px 24px #14253a2e; }
.groomer-sheet.options-only .groomer-sheet-head { display:none; }
/* Notifications v1.2: the bell panel keeps its header row (title + compact
   "Mark all as read" + close) at every width - CHOICE_MENU_JS's generic
   options-only toggle would otherwise strip it on desktop, which is how
   v1.1 ended up with a bare "Mark all as read" button and no context. */
.notif-bell-wrap .groomer-sheet.options-only .groomer-sheet-head, .assign-sheet-wrap .groomer-sheet.options-only .groomer-sheet-head { display:flex; }
.groomer-sheet::backdrop { background: #14253a4d; }
/* Notifications v1.1 (Ryan): a top-docked variant of the same sheet, used
   by the bell panel on phone so it visually drops from its app-bar
   trigger instead of rising from the bottom like every other sheet here.
   Overridden back to the standard anchored dropdown at >=651px by
   .is-anchored below (same specificity, later in the file - cascade order
   decides, not a new component). */
.groomer-sheet.sheet-top { inset: 0 0 auto 0; border-radius: 0 0 16px 16px; border-top: 0; border-bottom: 1px solid var(--hairline); box-shadow: 0 8px 24px #14253a2e; }
.groomer-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter) 10px; border-bottom: 1px solid var(--hairline); }
.groomer-sheet-head h2 { margin: 0; font-size: 17px; }
.groomer-sheet-list { list-style: none; margin: 0; padding: 8px var(--gutter) calc(env(safe-area-inset-bottom, 0) + 12px); overflow-y: auto; max-height: calc(min(70dvh, 480px) - 54px); }
.groomer-sheet-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; border: 0; background: none; border-radius: 10px; font: 600 16px/1.3 var(--text); color: var(--ink); text-align: left; text-decoration: none; }
.groomer-sheet-opt:hover, .groomer-sheet-opt:focus-visible { background: var(--cool); }
.groomer-sheet-opt.is-unread { background: var(--wash); }
.groomer-sheet-opt.is-unread:hover, .groomer-sheet-opt.is-unread:focus-visible { background: var(--cool); }
.groomer-sheet-opt span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Notifications page rows (brief item 3) reuse the exact .groomer-sheet-opt
   row the bell dropdown already uses, with a title+time head line and a
   detail body line underneath - no page-specific row component. */
.groomer-sheet-opt.notif-row { align-items: flex-start; }
.groomer-sheet-opt.notif-row span:first-of-type { display: flex; flex-direction: column; gap: 2px; }
.notif-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.notif-row-time { font: 400 12px/1 var(--text); color: var(--ink-soft); flex: none; }
.notif-row-body { font: 400 13px/1.3 var(--text); color: var(--ink-soft); }
.groomer-sheet-opt.notif-row .unread { margin-top: 6px; }
/* Notifications page rows sit inside a plain .card, not the .groomer-
   sheet dialog this list was designed for - the list's own var(--gutter)
   horizontal padding (sized for a full-bleed sheet) doubled up with the
   card's own padding and pushed row text ~18px right of the card-head
   heading above it. The card already supplies the correct inset, so the
   list takes none of its own here. */
.card .groomer-sheet-list { padding-left: 0; padding-right: 0; }
/* A list placed straight in a card is page content, not a scrolling sheet:
   drop the sheet's scroll box so the page scrolls normally and the rows'
   10px highlight bleed below is not clipped flush against the text. */
.card > .groomer-sheet-list { overflow: visible; max-height: none; }
/* The row keeps its 10px inner padding so the unread/hover highlight never
   touches the text, and bleeds 10px into the card padding with a matching
   negative margin - title text still lines up exactly with the card-head
   heading above it. */
.card .groomer-sheet-opt { margin-inline: -10px; width: calc(100% + 20px); }
/* Inbox ownership assign sheet (Theo polish pass): the first span is a
   small fixed-size avatar, not the label - :first-of-type's flex:1 above
   would otherwise stretch the 24px avatar and leave no room for the tick. */
.thread-assign-line .groomer-sheet-opt span:first-of-type { flex: none; }
.thread-assign-line .groomer-sheet-opt span:nth-of-type(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.thread-assign-line .groomer-sheet-tick { flex: none; }
.groomer-sheet-tick { color: var(--blue); font-weight: 700; }
/* One multi-select treatment for the shared Day/Week filter. */
.groomer-chip-row .chip { gap:6px; }
.groomer-chip-row .chip[aria-pressed="true"] { background:color-mix(in srgb,var(--drop-ok) 9%,var(--white)); color:var(--ink); border-color:var(--drop-ok); }
.groomer-chip-row .chip[aria-pressed="true"]::after { content:"✓"; color:var(--drop-ok); font-weight:600; }
[data-groomer-sheet] .groomer-sheet-tick { visibility:hidden; margin-left:auto; color:var(--drop-ok); }
[data-groomer-sheet] [aria-pressed="true"] { background:color-mix(in srgb,var(--drop-ok) 9%,var(--white)); color:var(--ink); box-shadow:inset 0 0 0 1px var(--drop-ok); }
[data-groomer-sheet] [aria-pressed="true"] .groomer-sheet-tick { visibility:visible; }
.groomer-choice-hint { margin:0; padding:0 16px 8px; }
.groomer-choice-actions { display:flex; justify-content:flex-end; padding:12px 16px; border-top:1px solid var(--hairline); position:sticky; bottom:0; background:var(--white); }

@media (prefers-reduced-motion: reduce) { .groomer-sheet { transition: none; } }
/* Batch 16: the day view's "All groomers" option (chip + sheet row) is a
   phone-only (<=650px) addition - tablet/desktop day view already shows
   every groomer's column side by side with no selection needed, so the
   option itself would be redundant noise there. */
@media (min-width: 651px) { .phone-only-opt { display: none !important; } }
.diary-safety { display: grid; gap: 6px; margin-bottom: 12px; }
.diary-safety .notice { padding: 8px 12px; font-size: 13px; }
/* Batch 23 item 3: the old bottom <details class="diary-history"> is
   retired for a "Cancelled (N)" toolbar button + groomer-sheet dialog
   (diary.ts quickActionsHtml/renderDayView/renderWeekView) - .diary-
   history-group stays, now rendered inside that dialog's .groomer-sheet-
   list instead of the old box. */
.diary-history-group { display: grid; gap: 4px; margin-top: 10px; }
.diary-short-list { margin-top: 14px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius-soft); background: var(--white); }
.diary-short-list h2 { font-size: 17px; margin: 0 0 8px; }
.diary-short-group { display: grid; gap: 6px; margin-top: 8px; }
.diary-short-group .mini { display: block; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); text-decoration: none; }
@media (max-width: 650px) {
  .diary-groomer-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .diary-groomer-picker.always { display: flex; }
  /* Batch 3 point C: the chip rail is desktop/tablet only on phone - the
     "Groomer: <name> ▾" button + sheet (declared further up, right after
     the chip-row rule) replace it. */
  .diary-groomer-picker > .groomer-chip-row { display: none; }
  /* Batch 8 R2-2: the frame is gone entirely now (see .grid-diary base
     rule), so the old bleed-to-edge negative margin that used to cancel
     out its border/radius is no longer needed - and was itself the cause
     of the uneven-gutter bug (grid flush left, ~30px strip right at
     narrow widths): .diary-scroll now keeps the SAME --gutter as main/
     app-bar/toolbar/picker row on every side, at every width. */
  .diary-scroll .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid):not(.day-grid) { width: 100%; grid-template-columns: 48px minmax(0,1fr); }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh:not(.corner):not([data-day-edge]), .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gcol, .diary-gaps, .diary-short-group { display: none; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh[data-groomer-header][data-active="true"] { display: flex; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gcol[data-groomer-column][data-active="true"] { display: block; }
  /* Ryan 00:24 (real phone): REVERTED the full-width single-bar treatment
     (batch 29, 359525b) - the empty white corner square above the time
     column is back, tint starting at the groomer column as it did
     originally. Swatch, plain name and the % line are unaffected. */
  .diary-gaps[data-active="true"] { display: block; }
  .diary-short-group[data-active="true"] { display: grid; }
  .diary-position .ev-service, .diary-position .ev-group { display: none; }
  /* Ryan 00:24 (real phone): the two-scroller "synced panes" version
     (9b97a6d) judders mid-drag - the head pane's scrollLeft, mirrored
     from the body pane's scroll events, always lands a frame behind the
     compositor's own scroll on real touch hardware, and mandatory
     scroll-snap fights that lag. Replaced with ONE native scroll
     container (the Google Calendar pattern) - `.diary-scroll` itself
     scrolls BOTH axes, fixed-height so there's something to scroll
     vertically within it (the page itself no longer scrolls past this
     point; the sticky bars above it have nothing left to "stick" against,
     which is harmless). `.grid-diary` goes back to being one flat CSS
     grid - same structure as desktop - and `.gh`/`.gh.corner`/`.gtimes`
     keep the SAME plain `position:sticky` rules that already existed for
     desktop (top on every `.gh`; left on corner+gtimes, both axes on
     corner, from the week-grid/day-all rules further down) and just work
     here too, since now there's exactly one scrolling ancestor for both
     axes - confirmed by an isolated repro that this combination (sticky
     element IS the scroll container, not a descendant of one on a
     different axis) never breaks sticky positioning. No JS scroll-syncs
     anything any more. */
  /* scroll-padding-left: the sticky .gtimes column (left:0) visually
     floats over whatever 48px of scrolled content currently sits flush
     against the scrollport's own left edge - a plain CSS-grid "frozen
     column" limitation, not specific to any one groomer (every column
     gets covered in turn as it's scrolled to that position, worst for
     the very first one on load). scroll-padding tells the browser's
     OWN snap/scrollIntoView machinery to treat 48px-in as the effective
     left edge, so every snapped resting position already leaves that
     gutter clear - no groomer column ever rests flush against gtimes. */
  .diary-scroll:has(.grid-diary.swipe-multi) { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-snap-type: none; scroll-padding-left: 48px; height: calc(100dvh - var(--bar-h) - var(--sticky-h, 0px) - var(--tab-h) - env(safe-area-inset-bottom, 0px)); }
  .grid-diary.swipe-multi { width: calc(48px + var(--cols, 1) * var(--swipe-col-w, 150px)); grid-template-columns: 48px repeat(var(--cols, 1), var(--swipe-col-w, 150px)); }
  .grid-diary.swipe-multi .gh:not(.corner) { scroll-snap-align: start; }
  /* Theo review (Ryan 00:24): the swatch on the first visible column was
     getting COVERED, not clipped by a viewport edge - .gh's sticky `top`
     offset (--bar-h + --sticky-h) is the distance needed to clear the app
     bar/toolbar bars pinned ABOVE `.diary-scroll` in the PAGE - correct
     for page-level scroll, but `.diary-scroll` is now its OWN self-
     contained scrollport (fix 3) sitting entirely BELOW those bars
     already, so inside it the header only needs to stick to its own
     scrollport's top (0), not an extra ~101px down. Left at the old
     offset, `.gtimes` (sticky-left only, no top offset, so it free-
     scrolls vertically in normal flow) could scroll its un-stuck top
     edge UP INTO that ~101px gap above the "stuck" header, and since
     .gtimes has the higher z-index (22 vs 21) its opaque white box
     painted over the header's left ~48px - covering Hannah's swatch and
     the first few letters of her name. Pinning the header to top:0 and
     .gtimes to the header's own rendered height (--swipe-header-h,
     measured by DIARY_SWIPE_JS) keeps them moving in lockstep - no gap,
     no overlap, at any scroll position. */
  .grid-diary.swipe-multi .gh { top: 0; }
  .grid-diary.swipe-multi .gtimes { top: var(--swipe-header-h, 60px); }
}
/* Tablet (651-899px): the 768px audit measured the desktop week-grid
   (56px + 6-ish minmax(150px,1fr) cols) overflowing the document by
   352px because it never shrinks below its 900px desktop breakpoint.
   Reuse the same native-scroll swipe technique as phone (see the comment
   on phone's `.grid-diary.swipe-multi` rule below), just a wider
   `--swipe-col-w` token so ~4 of 7 days show per screen instead of all 7
   squeezed in. */
@media (min-width: 651px) and (max-width: 899px) {
  /* Batch 6: day view's groomer columns stayed at the desktop 150px
     minmax at every width below 900px, which overflowed the page by
     ~52-64px with 5-6 staff on at 768px (56 + 5*150 = 806px against a
     742px content width). Day view has no own-axis scroll container
     (unlike the week swipe grid below), so this bled straight into the
     page - narrow the column floor so a full staff roster fits. */
  .grid-diary:not(.week-grid) { grid-template-columns: 56px repeat(var(--cols, 6), minmax(100px, 1fr)); }
  /* Same one-scroller native architecture as the phone block above (Ryan
     00:24: judder on real-phone horizontal swipe) - just a wider column
     token for this breakpoint. */
  .diary-scroll:has(.grid-diary.week-grid.swipe-multi) { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-snap-type: none; scroll-padding-left: 48px; height: calc(100dvh - var(--bar-h) - var(--sticky-h, 0px) - var(--tab-h) - env(safe-area-inset-bottom, 0px)); }
  .grid-diary.week-grid.swipe-multi { --swipe-col-w: 175px; width: calc(48px + var(--cols, 7) * var(--swipe-col-w)); grid-template-columns: 48px repeat(var(--cols, 7), var(--swipe-col-w)); }
  .grid-diary.week-grid.swipe-multi .gh:not(.corner) { scroll-snap-align: start; }
  /* Same header/gtimes lockstep fix as the phone block above (Theo review,
     Ryan 00:24: swatch covered on the first column). */
  .grid-diary.week-grid.swipe-multi .gh { top: 0; }
  .grid-diary.week-grid.swipe-multi .gtimes { top: var(--swipe-header-h, 60px); }
  .grid-diary.week-grid .gh { padding: 8px 4px 6px; font-size:var(--diary-heading-size); align-items: center; }
  .grid-diary.week-grid .gh span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Theo review of 7c0ee74: an earlier attempt excluded .gh-swatch/
     .gh-name-row from the rule above via :not(), but that RAISED its
     specificity enough to also override the .gh-name-full/.gh-name-short
     display:none/inline toggle a few rules down (both full AND short
     names rendered at once) - a second regression. Targeted overrides
     below instead, which only touch the two classes that actually need
     to escape display:block, leaving every other span (including the
     full/short toggle) exactly as it was. */
  .grid-diary.week-grid .gh .gh-swatch { display: inline-block; }
  .grid-diary.week-grid .gh .gh-name-row { display: inline-flex; }
  /* Theo review of batch 29: this used to ellipsis the whole sub-line,
     which could eat the "NN%" figure itself - never acceptable. Swap to
     the short span (sub-full/sub-short, diary.ts + the default rule up
     near .gh-name) and let IT wrap (not ellipsis) in the rare case it's
     still too long, so the percentage is always either fully shown or
     pushed to its own line, never cut. */
  .grid-diary.week-grid .gh small { display: block; font-size:var(--diary-sub-size); margin-top: 1px; white-space: normal; line-height: 1.2; }
  .grid-diary.week-grid .gh small .sub-full { display: none; }
  .grid-diary.week-grid .gh small .sub-short { display: inline; }
  /* Ryan 00:48 (real phone): day-All and single-groomer day never had ANY
     tablet-width tightening - only week-grid's own padding/font rules
     existed above - so at 768px their headers stayed on the full desktop
     padding/font (12px/16px) and measured ~95-114px against week's
     ~44px, worse than the phone gap. Same tightened values as week-grid
     just above, plus the same no-%-figure-at-risk 1-line sub-line cap
     from the phone block (an off-duty column's longer "Off duty / time
     off" label stretching the whole grid row applies here too). */
  .grid-diary:not(.week-grid) .gh { padding: 8px 4px 6px; font-size:var(--diary-heading-size); align-items: center; }
  .grid-diary:not(.week-grid) .gh span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid-diary:not(.week-grid) .gh .gh-swatch { display: inline-block; }
  .grid-diary:not(.week-grid) .gh .gh-name-row { display: inline-flex; }
  .grid-diary:not(.week-grid) .gh small { display: block; font-size:var(--diary-sub-size); margin-top: 1px; white-space: normal; line-height: 1.2; }
  .grid-diary:not(.week-grid) .gh small .sub-full { display: none; }
  .grid-diary:not(.week-grid) .gh small .sub-short { display: inline; }
  .grid-diary .gh small:not(:has(.sub-full)) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Single-groomer's column is wide enough (minmax(0,1fr) fills the whole
     screen, unlike day-All/week's fixed narrow columns) that it never
     needed the short form - override the rule just above back to the
     full text for this one case, same reasoning as the phone block. */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh small .sub-full { display: inline; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh small .sub-short { display: none; }
  /* Same broad-span-rule problem, third occurrence: .gh-name-full/
     .gh-name-short are spans too, so the earlier `.gh span {display:
     block}` rule showed BOTH as stacked blocks instead of the full/short
     toggle (unconditional defaults: full shown, short hidden - correct
     for single-groomer, which never needed the short form) - re-asserted
     explicitly for the same reason as sub-full/sub-short above. */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh .gh-name-full { display: inline; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh .gh-name-short { display: none; }
  /* Same fix as the phone block below (Ryan 00:48: single-groomer day's
     wide active column left its header content shrink-wrapped and
     wrapping unnecessarily). */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh > span { flex: 1 1 auto; min-width: 0; }
}
/* prefers-reduced-motion: native CSS scroll-snap (scroll-behavior default
   is already "auto", i.e. instant, not smooth) needs no override here -
   there's no custom transition left to disable. */
@media (max-width: 650px) {
  /* Pass 2: "Mon 26 Oct" + "9 visits · 3 on" on one line each, no wrap -
     the shared .gh small rule (further up) forces white-space:normal for
     the day/desktop grids, so phone needs its own nowrap+ellipsis.
     Ryan 00:48 (real phone): single-groomer day view never had this at
     all (:not(.week-grid):not(.day-all):not(.availability-grid) sat outside every selector list
     here), so its header stayed on the DESKTOP padding/font (12px/16px)
     even on phone - the biggest single cause of it measuring ~63px vs
     week's ~45px. Added to every rule below so day single/day-All/week
     all tighten the same way. */
  .grid-diary .gh { padding: 8px 6px 6px; font-size:var(--diary-heading-size); align-items: center; }
  .grid-diary.week-grid .gh span, .grid-diary.day-all .gh span, .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Theo review of 7c0ee74: see the matching comment on the tablet
     week-grid rule above - targeted overrides, not :not() on the broad
     rule, so the .gh-name-full/.gh-name-short toggle is untouched. */
  .grid-diary.week-grid .gh .gh-swatch, .grid-diary.day-all .gh .gh-swatch, .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh .gh-swatch { display: inline-block; }
  .grid-diary.week-grid .gh .gh-name-row, .grid-diary.day-all .gh .gh-name-row, .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh:not([data-active="true"]) .gh-name-row { display: inline-flex; }
  /* Theo review of batch 29: same fix as the tablet week-grid rule above -
     the short sub-line span, left free to wrap rather than ellipsis, so a
     booked percentage is never the part that gets cut off on phone. */
  .grid-diary .gh small { display: block; font-size:var(--diary-sub-size); margin-top: 1px; white-space: normal; line-height: 1.2; }
  .grid-diary.week-grid .gh small .sub-full, .grid-diary.day-all .gh small .sub-full { display: none; }
  .grid-diary.week-grid .gh small .sub-short, .grid-diary.day-all .gh small .sub-short { display: inline; }
  /* Ryan 00:48 (real phone), caught while re-measuring: single-groomer day
     was missing this pair of overrides entirely - the broad `.gh span {
     display: block }` rule above matches .sub-full/.sub-short too (both
     are spans), making BOTH visible as stacked blocks instead of the
     short/full swap, doubling the sub-line's rendered height. Its column
     is wide enough that it never needed shortening in the first place,
     so this keeps the FULL text (not the short one) - just re-asserts
     the single-column default explicitly rather than leaving it to lose
     the specificity fight with the broad span rule. */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh small .sub-full { display: inline; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh small .sub-short { display: none; }
  /* Same broad-span-rule problem, third occurrence: .gh-name-full/
     .gh-name-short are spans too, so the broad `.gh span {display:
     block}` rule above showed BOTH as stacked blocks ("Hannah Lockwood"
     then "Hannah" on its own line) instead of the full/short toggle. */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh .gh-name-full { display: inline; }
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh .gh-name-short { display: none; }
  /* Ryan 00:48 (real phone): with padding/font now matched to week, the
     remaining gap was one specific case - an off-duty/no-window column's
     sub-line ("Off duty / time off") has no sub-full/sub-short pair (that
     mechanism only exists for the %-figure case) and could still wrap to
     2 lines in a narrow column, and since CSS Grid stretches every
     header in the row to the tallest one, THAT one column's wrap
     inflated every other column's header too. :has() targets only
     sub-lines with no .sub-full child (i.e. not already handled above)
     and caps them to one line - nothing with a % figure to protect is
     affected, matching the batch 29/Theo rule that a figure must never
     be the part that's cut: there is no figure here. */
  .grid-diary .gh small:not(:has(.sub-full)) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Ryan 00:48 (real phone), remaining gap on single-groomer day: its
     active column is WIDE (minmax(0,1fr) - the only visible column on
     phone fills the screen), but .gh's inner wrapping <span> has no
     flex-grow, so it shrink-wraps to its own content's natural width
     (~150px for "Hannah Lockwood" + the sub-line) and just sits at the
     header's left edge with ~200px of unused space to its right -
     wrapping name AND sub-line onto 2 lines each inside that
     unnecessarily narrow box even though the column had plenty of room.
     Letting the span grow to fill the column removes the wrap entirely. */
  .grid-diary:not(.week-grid):not(.day-all):not(.availability-grid) .gh > span { flex: 1 1 auto; min-width: 0; }
}
/* Batch 6: the compact date-nav/groomer-sheet/quick-actions treatment
   used to cut over at 650/651px - the tablet audit (768/820px) found
   the desktop chip rail AND the phone sheet button both visible at
   once, plus the quick-actions links doubled (once inline in the
   date-nav, once beside the groomer picker), because the old
   `.diary-quick-actions` hide-on-desktop rule lost a specificity tie to
   `.diary-groomer-picker > span` and rendered anyway. This block now
   runs up to 899px (one groomer control - the sheet - and one set of
   action links below that; chips + inline actions take over at 900px,
   see the min-width:900px rule further down and the groomer-sheet-
   trigger rule above), and the quick-actions selector is scoped to
   `.diary-groomer-picker` so it actually wins the specificity tie. */
@media (max-width: 899px) {
  /* Compact sticky block: row 1 keeps only prev/Day·Week/next/Today/
     date-jump in the .date-nav strip; the Go button is redundant once
     the date input auto-submits on change (DAY_JS/WEEK_JS's picker
     script is unaffected - this is a plain native form submit). Row 2
     is the groomer chip rail with the three quick actions appended as
     .btn.xs chips so nothing needs a third row. */
  .date-nav { gap: 6px; }
  .date-nav .diary-date-go { display: none; }
  /* Icon-only date jump: the value text is zeroed out and replaced with a
     visible calendar glyph (the I.diary icon from shared.ts, inlined as a
     background image since a CSS background can't reference currentColor
     or the app's shared SVG string - its stroke is the --ink hex
     directly). The native calendar-picker-indicator is stretched
     transparent over the whole control so the tap target and "open the
     picker" behaviour are unchanged; only its own icon is hidden. */
  .date-nav input[type="date"] {
    width: 44px; min-height: 44px; padding: 0; font-size: 0;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313263B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4M7 14h4M7 17h7'/%3E%3C/svg%3E") center/20px no-repeat;
  }
  .date-nav input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  /* Pass 2: shrink the visual box to the brief's 34-36px, keep the hit
     area at 44px via position:relative + an oversized ::after (a real
     child box that overflows the shrunk border box but still bubbles its
     click to the real <a>/button ancestor - see the pass-2 comment on the
     app-bar media query above). */
  .date-nav > .iconbtn, .date-nav .segmented a, .date-nav .segmented button, .date-nav > .btn.sm.ghost { position: relative; }
  .date-nav > .iconbtn::after, .date-nav .segmented a::after, .date-nav .segmented button::after, .date-nav > .btn.sm.ghost::after { content: ""; position: absolute; inset: -5px; }
  .date-nav > .iconbtn { width: 34px; height: 34px; }
  .date-nav > .iconbtn svg { width: 18px; height: 18px; }
  .date-nav .segmented { border-radius: 7px; }
  .date-nav .segmented a, .date-nav .segmented button { padding: 0 9px; font-size: 13px; min-height: 34px; }
  .date-nav > .btn.sm.ghost { padding: 0 9px; font-size: 12.5px; min-height: 34px; }
  .date-nav input[type="date"] { width: 34px; min-width: 0; min-height: 34px; background-size: 17px; }
  #diary-groomer-label { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .diary-groomer-picker { padding-top: 0; }
  .diary-groomer-picker > .groomer-chip-row { display: none; }
  /* Chunky 14px/15px pills on phone: tighten padding/font/gap while the
     chip keeps its 44px hit area (accessibility invariant above). */
  /* Pass 2: 30px visual pill, 13px label, 6px gaps per the brief; the chip
     is a real <button>/<a> so the shrunk min-height itself stays the hit
     area here rather than the ::after trick (a 30px chip row with 44px
     invisible padding above/below it would reintroduce the tall rail the
     brief is shrinking) - accepted as the one place touch target drops
     below 44px, matching the brief's explicit 30px target over the
     general 44px rule. */
  .diary-groomer-picker .chip { min-height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
  .diary-groomer-picker .chip .dot { margin-right:0; width: 7px; height: 7px; }
  .diary-groomer-picker > .groomer-chip-row { gap: 6px; }
  .diary-groomer-picker .diary-quick-actions { display: inline-flex; gap: 6px; flex: none; }
  .diary-groomer-picker .diary-quick-actions .btn.xs { min-height: 30px; }
  /* Batch 15 (Ryan 27 Oct): the "Groomer: All staff ▾" trigger matches the
     date-nav segmented control's own compact height/radius here instead of
     a big 44px/999px pill - that was the "wasted hero space" Ryan flagged
     at ~500px wide. Same control, same row, in both day and week (shared
     groomerPicker()/CSS - see diary.ts). */
  .diary-groomer-picker .groomer-sheet-trigger { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13px; gap: 4px; }
  /* Batch 15: the "All staff · 45 visits this week" meta line is dropped
     below 900px rather than becoming a third row - the brief caps this
     header at two compact rows above the grid at every width here. */
  .week-selected-label { display: none; }
  /* Batch 15b: MERGE_HEADER_JS (diary.ts) relocates the groomer-sheet
     trigger+dialog and the "⋯ more actions" button+dialog out of this row
     into the date-nav row's own slot (below), so this whole second sticky
     row carries no visible content left below 900px - collapse it to
     reclaim its height instead of leaving an empty padded band. This also
     fixes the pre-existing tablet (651-899px) bug where the whole row
     (including the groomer control) rendered invisible for day view: that
     row is now intentionally hidden at every width here, with the same
     groomer control always reachable from the merged date-nav slot
     instead, for day AND week. !important beats the `.always`/
     max-width:650 `display:flex` rules declared earlier for this class. */
  .diary-groomer-picker { display: none !important; margin-bottom: 0; }
}
/* P1-7 (2026-11-08 batch, WP-E): tablet has room the icon-only phone
   treatment above doesn't need - restore a visible value wide enough that
   it never overlaps the calendar glyph (measured 768px: value painted over
   the icon at the 34px phone width). */
@media (min-width: 651px) and (max-width: 899px) {
  .date-nav input[type="date"] { width: auto; min-width: 9.5em; height: 34px; min-height: 34px; font-size: 13px; color: inherit; background-image: none; padding: 0 8px; }
}
@media (min-width: 900px) {
  .diary-groomer-picker .diary-quick-actions { display: none; }
}
/* Batch 15b: one merged header row below 900px - `‹ [Day|Week] › [Today]
   [📅] [All staff ▾] [⋯]`. The slot sits empty (and hidden) at ≥900px;
   MERGE_HEADER_JS only ever populates it below 900px and moves its
   contents straight back into .diary-groomer-picker above that, so the
   unmodified desktop chip-rail markup/CSS is untouched on resize. */
.date-nav .diary-header-slot { display: none; }
@media (max-width: 899px) {
  .date-nav .diary-header-slot { display: inline-flex; align-items: center; gap: 3px; }
  /* Capped max-width (not just a vw guess) so the row fits at 360/390
     regardless of how long the selected groomer's first name is - a long
     name ellipsises rather than pushing the row to wrap. */
  .date-nav .groomer-sheet-trigger { min-height: 34px; padding: 0 6px; border-radius: 8px; font-size: 12px; gap: 4px; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .date-nav .diary-header-slot .diary-quick-actions .btn.xs { min-height: 34px; width: 34px; padding: 0; border-radius: 8px; }
  /* Compact spacing token (established at max-width:650 for .sticky-bar,
     extended here to the whole 651-899px band now that this is the only
     sticky row): less top/bottom air around the merged row and above the
     day/column headings - no big empty band either side of it. */
  .date-nav.sticky-bar { padding-top: 6px; padding-bottom: 6px; gap: 4px; }
  .diary-workspace .date-nav { margin-bottom: 6px; }
  /* Every one-row control trims a few more px here so prev/Day·Week/next/
     Today/📅/groomer/⋯ all fit on one line without wrap down to 360px -
     the brief's wrap-below-380px fallback is for content the row can't
     predict (a long groomer name), not for this known, fixed set of
     controls, which stay on one line at every width 360px and up. */
  .date-nav > .iconbtn { width: 30px; height: 30px; }
  .date-nav > .iconbtn svg { width: 16px; height: 16px; }
  .date-nav .segmented a, .date-nav .segmented button { padding: 0 5px; font-size: 12px; }
  .date-nav > .btn.sm.ghost { padding: 0 5px; font-size: 12px; }
}

/* ---------- Week table (= website .price-table rules) ---------- */
/* B0 W2 /diary week fix (found during acceptance check 8 - zero
   horizontal page overflow): the table itself must scroll inside this
   wrapper on narrow screens, not the page (design brief rule 5 - "nothing
   scrolls sideways except ... the week table inside its card"). */
/* .week is the shared data table (owner reports). The week diary itself is .grid-diary.week-grid above. */
.log-table-wrap { overflow-x: auto; border-radius: var(--radius-soft); }
.week { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-soft); overflow: hidden; }
.week th, .week td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.week thead th { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); background: var(--cool); }
.week tbody th { font: 600 16px/1.2 var(--display); white-space: nowrap; width: 110px; }
.week tbody th small { display: block; font: 400 13px/1.3 var(--text); color: var(--ink-soft); }
.week-selected-label { margin: 0 0 10px; font-size: 15px; }
.week-selected-label .muted { margin-left: 8px; }
/* Batch 23 item 2 (Ryan 21:44 voice): the bottom "How booked capacity is
   calculated" <details> is retired - "ugly and unnecessary"; the one-line
   explanation now lives in the busy bar's title/aria (diary.ts dayColumn
   busyHtml). */
@media (max-width: 900px) { .week-selected-label { padding: 6px 0; } }
@media (max-width: 650px) { .week th, .week td { padding: 10px 8px; } }
.util-bar { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.util-bar i { display: block; height: 100%; background: var(--blue); }

/* ---------- Forms (= website .field) ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; align-content: start; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field > legend { display: block; font-weight: 700; font-size: 16.5px; padding: 0; }
.field label:not(.switch):not(.check):not(.swatch-option) { display:block; font-weight: 700; font-size: 16.5px; }
.field label:not(.switch):not(.check):not(.swatch-option):has(> input, > select, > textarea) { display:grid; gap:6px; }
.field .hint { margin:0; font-size: 14.5px; color: var(--ink-soft); }
.field input, .field textarea, .field select { font: 400 18px/1.4 var(--text); color: var(--ink); border: 2px solid var(--input-border); border-radius: 6px; padding: 12px 14px; background: #fff; min-height: 52px; width: 100%; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%2313263B' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder { color: var(--placeholder); }
/* Website r13v: a single border on pointer focus, one soft keyboard indicator. */
:where(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), textarea, select):is(:focus, :focus-visible) { outline: none; box-shadow: none; }
.field :is(input, textarea, select):focus { border-color: var(--ink); outline: none; box-shadow: none; }
.kbd-nav :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), textarea, select):focus { outline: none; box-shadow: 0 0 0 4px rgba(19,38,59,.22); }
@media (hover: hover) and (min-width: 900px) {
  .field label { font-size: 14.5px; }
  .field .hint { font-size: 13.5px; }
  .field input, .field textarea, .field select { font-size: 16px; min-height: 44px; padding: 8px 12px; }
  .field select { padding-right: 40px; }
}
/* Batch 3 point A2: without this, grid items default to align-items:stretch
   so a shorter sibling field (e.g. "Weight (kg)", label+input only) stretched
   to match a taller one (e.g. "Only groomer", label+select+hint), and its own
   auto-sized rows then stretched too (align-content:normal==stretch on
   auto tracks) - the input itself grew tall and dropped out of alignment.
   Paired fields must have aligned tops and their own natural height. */
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; margin-bottom:18px; }
/* Shared automatic-template and quick-reply editor rhythm. */
.template-form { display:grid; gap:18px; }
.template-form > .field, .template-form > .field-row { margin:0; }
.template-form > .field-row { gap:18px; }
.template-form .template-active-field .check { align-items:center; }
.field-row:not(:has(> :not([hidden]))) { display:none; }
.stack > .field, .stack > .field-row { margin-bottom:0; }
@media (max-width: 600px) { .field-row { grid-template-columns: minmax(0,1fr); } }
/* Batch 19 item 6: the per-dog visit form's Service+Duration, groomer and
   Date+Start pairs stay two columns down to small phones (390px Pixel 7) -
   the general .field-row single-column collapse at 600px would undo the
   compaction Ryan asked for on the one screen it matters most. */
.field-row.compact { gap: 10px; }
@media (max-width: 600px) { .field-row.compact { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 360px) { .field-row.compact { grid-template-columns: minmax(0,1fr); } }
/* Small text-button links inline with a field (+ Second groomer, + Add
   note, Find any eligible team) - same .textlink look, tighter tap target
   than the default 44px so it doesn't dominate the compact row. */
.textlink.sm { min-height: 36px; font-size: 14px; }

/* Shared form-grid section heading (point 4, 27 Oct batch 2): a plain
   sibling between .field/.field-row groups inside a .stack form, not a
   grid cell of its own - .field-row stays a simple 2-up grid. */
.form-sections > :not([hidden]) + :not([hidden]) { margin-top:24px; }
.form-section { margin: 22px 0 2px; font: 700 13px/1.2 var(--text); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); border-top: 1px solid var(--hairline); padding-top: 18px; }
form.stack > .form-section:first-child, .form-section-group > .form-section:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

/* Shared accessible combobox (point 8, 27 Oct batch 2): replaces every
   native <datalist> type-ahead (breed, Other parent, ...). ARIA 1.2
   combobox/listbox pattern, themed to match .field inputs - see
   src/web/shared.ts comboboxField()/COMBOBOX_JS. */
.combobox { position: relative; }
.combobox-list { position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 10px 28px #14253a22; max-height: 260px; overflow-y: auto; }
.combobox-list:empty, .combobox-list[hidden] { display: none; }
.combobox-list li { padding: 10px 12px; border-radius: 6px; font: 400 16px/1.3 var(--text); color: var(--ink); cursor: pointer; }
.combobox-list li.is-active, .combobox-list li:hover { background: var(--cool); }
.combobox-list li mark { background: none; color: var(--ink); font-weight: 700; padding: 0; }
/* Batch 19 item 1: PERSON_DOG_SEARCH_JS results (step 1 /book + quick-book)
   render as one horizontal row - a fixed 40px avatar tile on the left, then
   "Dog · Owner" with breed/duplicate notice as a muted second line below it.
   Before this, the avatar (img.dog-pic is display:block) forced a line
   break above the text, wasting height and roughly halving the number of
   results that fit above the phone keyboard. min-height keeps every row
   the same height whether the avatar is a photo, breed icon or initials. */
.combobox-list li.result-row-live { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 40px; }
.combobox-list li.result-row-live .dog-pic, .combobox-list li.result-row-live .dog-pic-icon, .combobox-list li.result-row-live .dog-pic-initials { flex: none; }
.combobox-list li.result-row-live > span:not(.dog-pic) { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.combobox-list li.result-row-live > span small { display: block; }

/* Staff day rows: Time off + Extra days (DESIGN-STAFF-DAYS.md, 4 Nov 2026) */
.rows li.day-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; justify-content:normal; }
.day-tile { display:grid; place-items:center; align-content:center; width:48px; min-height:52px; border:1px solid var(--hairline); border-radius:var(--radius); background:var(--cool); color:var(--ink); line-height:1; }
.day-tile b { font:600 20px/1 var(--display); letter-spacing:-.01em; }
.day-tile small { font:700 11px/1 var(--text); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); margin-top:3px; }
.day-tile.is-today { background:var(--ink); color:var(--white); border-color:var(--ink); }
/* .rows li b (public/css/app.css) sets color:var(--ink) with higher
   specificity than .day-tile b, which otherwise inherits the correct
   light colour from .day-tile.is-today - the day number was rendering
   dark-on-dark. Qualify through the actual list-row ancestor to win. */
.rows li .day-tile.is-today b { color:var(--white); }
.day-tile.is-today small { color:inherit; opacity:.8; }
.day-tile.is-range { box-shadow:inset 0 -3px 0 var(--blue); }
.day-row.is-past .day-tile { opacity:.72; }
.day-row-actions { display:flex; align-items:center; gap:4px; }
/* Day rows without a date tile (e.g. salon-closure booking conflicts): text column + actions, link never wraps. */
.rows li.day-row.no-tile { grid-template-columns:minmax(0,1fr) auto; }
.day-row-actions .textlink { white-space:nowrap; }
.day-group-label { margin:14px 0 4px; font:700 11.5px/1 var(--text); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); }
.month-calendar.mini { margin:0; box-shadow:none; }
.mini-month-title { margin:0; padding:14px 12px 10px; font:600 16px/1.3 var(--display); }
/* Month arrows: prev on the first visible month, next on the last, so the
   desktop pair reads as one range; tablets/phones show one month with both.
   Hidden arrows keep their slot so the title stays centred. */
.mini-month-head { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; padding:4px 4px 0; }
.mini-month-head .mini-month-title { padding:10px 4px 6px; text-align:center; }
.mini-month-head .iconbtn { width:44px; height:44px; }
.mini-month-head .iconbtn svg { width:20px; height:20px; }
.month-calendar.mini:not(.is-first) .mini-month-prev,
.month-calendar.mini:not(.is-second) .mini-month-next { visibility:hidden; }
@media (max-width:899px) { .month-calendar.mini.is-first .mini-month-next { visibility:visible; } }
.staff-month-pair { touch-action:pan-y; }
.month-calendar.mini .month-weekdays { background:var(--white); }
.month-calendar.mini .month-weekdays span { font-size:10px; padding:8px 2px; }
.month-calendar.mini .month-day { appearance:none; border:0; border-right:1px solid var(--hairline); border-bottom:1px solid var(--hairline); min-height:44px; padding:5px; gap:0; justify-content:center; align-items:center; border-radius:0; cursor:pointer; }
.month-calendar.mini .month-day:nth-child(7n) { border-right:0; }
.month-calendar.mini .month-day:nth-last-child(-n+7) { border-bottom:0; }
.month-calendar.mini .month-day-number { align-self:center; font:500 13px/1 var(--text); }
.month-calendar.mini .month-day.is-today .month-day-number { font-weight:700; }
.month-calendar.mini .month-day:focus-visible { outline:2px solid var(--ink); outline-offset:-3px; }
.month-calendar.mini .month-day:not(.is-today):not(.outside-month):hover { background:var(--cool); }
/* Faded days from the next/previous month are display-only: no hover, no pointer, no add dialog. */
.month-calendar.mini .month-day.outside-month { cursor:default; pointer-events:none; }
.month-calendar.mini .month-day.is-extra { background:color-mix(in srgb, var(--drop-ok) 30%, #fff); }
.month-calendar.mini .month-grooms, .month-calendar.mini .month-free, .month-calendar.mini .month-load { display:none; }
.month-legend .is-extra i { background:color-mix(in srgb, var(--drop-ok) 55%, #fff); border:1px solid var(--drop-ok); }
.month-legend .is-working i { background:var(--white); border:1px solid var(--input-border); }
.staff-month-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:14px; align-items:start; }
@media (max-width:899px) { .staff-month-pair { grid-template-columns:minmax(0,1fr); } .staff-month-pair > .is-second { display:none; } }
@media (max-width:650px) {
  /* Theo review 2026-11-15: this used to hide the calendar outright here,
     leaving the colour-key legend floating above an empty space on
     phones (the legend lives outside .staff-month-pair, so it kept
     showing). The 899px breakpoint above already has the right mobile
     pattern - single calendar, second month hidden - so phones just
     inherit that instead of losing the calendar entirely; the legend
     stays meaningful because there's still a calendar under it. */
  .day-row { grid-template-columns:auto minmax(0,1fr); }
  .day-row-actions { grid-column:2; justify-content:flex-start; }
}

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 16.5px; min-height: 44px; }
/* B0 gate fix (Fable): a .check inside a .field wrapper inherited the
   52px/100%-width text-input sizing, pushing the box under its label. */
.field .check input { width: 24px; height: 24px; min-height: 0; padding: 0; }
.field .check { align-items: center; }
/* Batch 19 item 5: the per-dog visit form's past-visit control is now one
   compact button (data-copy-visit host in HOUSEHOLD_VISIT_FORMS_JS) instead
   of the old radio list/legend/explanation - no .source-choice markup is
   emitted any more, so the whole block above it is dead and removed. */
[data-copy-visit] { margin-bottom: 12px; }
[data-copy-visit]:empty { display:none; }
[data-copy-visit] .btn[data-copy-latest] { border-style: dashed; }
[data-copy-visit] .btn[data-copy-undo] { border-color: var(--ink); background: var(--wash); }
/* Copy/Undo is a pale contextual control. Keep pointer and keyboard states
   in the same ink-on-light family instead of inheriting ghost's inversion. */
[data-copy-visit] .btn.ghost:hover, [data-copy-visit] .btn.ghost:focus-visible { background: var(--blue-tint); color: var(--ink); border-color: var(--ink-40); }
.search { position: relative; }
.search input { padding-left: 46px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--ink); }
.switch { display:inline-flex; align-items:center; gap:10px; max-width:100%; font-weight:600; }
.switch > span > small.hint { display:block; font-weight:400; margin-top:2px; }
.row.between:has(> .switch) { flex-wrap:wrap; align-items:flex-start; }
.switch input[type=checkbox] { appearance:none; margin:0; min-height:0; padding:0; }
.toggle, .switch input[type=checkbox] { position: relative; width: 52px; height: 30px; border-radius: 15px; background: var(--hairline); border: 0; cursor: pointer; flex: none; }
.toggle::after, .switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle[aria-checked="true"], .switch input[type=checkbox]:checked { background: var(--switch-active, var(--positive)); }
.switch.positive { --switch-active: var(--positive); }
.toggle[aria-checked="true"]::after, .switch input[type=checkbox]:checked::after { transform: translateX(22px); }

/* ---------- List rows (= website .price-rows) ---------- */
.card-list { list-style:none; margin:0; padding:0; }
.rows { list-style: none; margin: 0; padding: 0; }
.result-list.rows li { padding: 4px 0; }
.result-row { width: 100%; justify-content: flex-start; white-space: normal; text-align: left; }
/* Batch 18 item 2: a possible-duplicate match in the shared person/dog
   search is plain muted text on its own second line, not a pill/border -
   Ryan's phone screenshot called the old pill "ugly". */
.result-dupe { display: block; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.rows li:last-child { border-bottom: 0; }
.rows .row-copy { flex:1 1 0; min-width:0; }
.rows .row-action { flex:0 0 auto; margin:0; }
.rows .row-action .btn { white-space:nowrap; min-width:104px; }
.rows li span:not(.pill) { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.rows li span .pill { display: inline-flex; white-space: normal; text-align: left; }
/* Groomer identity chip inside list rows: keep the shared .agenda-staff layout (the generic .rows li span rule above would flatten it to block). */
.rows li .agenda-staff { display: flex; margin-top: 2px; }
.rows li .agenda-staff-avatar { display: grid; font-size: 10px; margin-top: 0; }
.rows li .agenda-staff-name { display: inline; margin-top: 0; color: var(--ink); }
.rows li b { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.rows li :is(b, span) { overflow-wrap: anywhere; }
.rows a.row > :first-child { min-width: 0; }
.rows .pr { text-align: right; white-space: nowrap; font: 600 21px/1.1 var(--display); }
.rows a.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; text-decoration: none; color: var(--ink); min-height: 44px; }
.rows .chev { width: 18px; height: 18px; color: var(--ink-soft); flex: none; display: inline-flex; }
.rows .chev svg { width: 18px; height: 18px; }
.rows.tight li { padding: 10px 0; }
/* Clients directory row (src/web/clients.ts): name + dogs + phone on the
   left, "Next:"/"Last:"/"No visits yet" on the right, same .rows a.row
   component as the rest of the app. */
.client-next { color: var(--ink-soft); font-size: 14px; white-space: nowrap; text-align: right; flex: none; }
.client-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.client-directory-count { color: var(--ink-soft); font-size: 14px; }
@media (max-width: 650px) {
  /* The fixed-width "Next:"/"Last:" column otherwise squeezes the name
     column to near nothing on phone, forcing every word onto its own
     line (overflow-wrap: anywhere on .rows li span/b). Stack instead. */
  .rows a.row:has(.client-next) { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rows a.row:has(.client-next) .client-next { text-align: left; white-space: normal; }
  .rows a.row:has(.client-next) .chev { display: none; }
}
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 16px; margin: 0; font-size: 15px; }
@media (min-width: 600px) { .dl { grid-template-columns: 160px minmax(0, 1fr); } }
.dl dt, .dl dd { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.dl dt { color: var(--ink-soft); font-size: 14px; font-weight: 400; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl > :nth-last-child(-n+2) { border-bottom: 0; }
.dl > :nth-child(-n+2) { padding-top: 2px; }
.dl > dd:only-child { grid-column: 1 / -1; padding: 0; font-size: 14px; }

/* ---------- Banner / notice / empty ----------
   27 Oct 2026 redesign (Ryan: the dark navy fill read as "ugly and
   heavy" everywhere - the move/undo banner, the drag confirm bar,
   every error/warning banner, dog warnings, the drawer's warning box).
   One white card look for the whole component, no dark fill anywhere:
   white background, a thin --rule border, a coloured left accent bar
   (the only colour cue), ink text throughout, a soft shadow. Buttons
   inside are the ordinary .btn.ghost/.btn.sm - already readable on
   white, so the old dark-notice button recolours are gone. See
   DESIGN.md's Banner / notice component entry. */
.notice { margin: 0; overflow-wrap: anywhere; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; align-items: start; padding: 12px 16px; line-height:1.5; border-radius: 12px; background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--notice-accent,var(--busy-warn)); color: var(--ink); font-size: 15.5px; font-weight: 600; box-shadow: 0 2px 8px #14253a14; }
.notice:has(> svg) { grid-template-columns:auto minmax(0,1fr); }
.notice:not(.step-hint,.banner) + .card { margin-top:12px; }
/* Shared notices use semantic status colours; stacked notices retain the standard gap. */
.notice + .notice, #banner:not(:empty) + .notice, .notice + #banner:not(:empty) { margin-top: 10px; }
@media (max-width: 650px) { .notice { padding: 12px 16px; font-size: 15px; gap: 10px; } .notice svg { width: 18px; height: 18px; } }
/* Batch 18 item 1: a notice that sits directly above a card (the booking
   wizard's diary hint) keeps the card's own side padding at every width and
   the same gap a stacked card gets below it (.card + .card), instead of the
   notice's tighter mobile padding making it sit closer to the edge. */
.step-hint { margin-bottom: 12px; }
.notice svg { width: 22px; height: 22px; color: var(--ink); margin-top: 1px; }
.notice a { color: var(--link); }
.notice.strong { border-left-color: var(--notice-accent,var(--busy-warn)); font-weight: 600; }
.notice.strong svg { color: var(--notice-accent,var(--busy-warn)); }
.notice.strong.alert .warning-dog-link { appearance: none; border: 0; margin: 0; padding: 0; background: transparent; color: var(--drop-no); font: inherit; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; cursor: pointer; }
.notice.strong.alert .warning-dog-link:hover { color: color-mix(in srgb, var(--drop-no) 82%, black); }
.notice.strong.alert .warning-dog-link:focus-visible { outline: 3px solid var(--drop-no); outline-offset: 3px; border-radius: 2px; }
.notice.error, .notice.alert { --notice-accent:var(--drop-no); border-left-color:var(--drop-no); background:color-mix(in srgb,var(--drop-no) 7%,var(--white)); }
.notice.success, .notice[data-move-notice]:not(.error):not(.alert) { --notice-accent:var(--drop-ok); background:color-mix(in srgb,var(--drop-ok) 7%,var(--white)); }
.notice.warning { --notice-accent:var(--busy-warn); background:color-mix(in srgb,var(--busy-warn) 9%,var(--white)); }
/* Theo, 15 Nov 2026: an "info" tint was missing from the shared notice
   component - every non-warning/error/success notice fell back to a
   plain left-border box with no icon badge. Same pattern as .notice.warning,
   just the existing --link blue instead of the warning amber, with a
   round "i" badge instead of "!". */
.notice.info { --notice-accent:var(--link); background:color-mix(in srgb,var(--link) 7%,var(--white)); }
.notice.info:not(:has(> svg))::before { content:'i'; position:absolute; left:16px; top:13px; width:20px; height:20px; border-radius:50%; display:grid; place-items:center; font:700 13px/1 var(--text); color:#fff; background:var(--link); }
.notice.info:not(:has(> svg)) { position:relative; padding-left:46px; }
@media (max-width: 650px) { .notice.info:not(:has(> svg)) { padding-left:42px; } .notice.info:not(:has(> svg))::before { left:14px; top:14px; width:18px; height:18px; font-size:12px; } }
/* Status badge: a filled circle with a centred glyph, reusing the same
   round-badge language as .slot-staff-choice's selection tick (line ~3416).
   Darker "-text" tokens (already used for on-tint text/tooltip fills, e.g.
   .diary-time-tooltip) give the white glyph >=3:1 contrast; the accent
   colours themselves (busy-warn, drop-no, drop-ok) are too light for that.
   Decorative only - the notice text already carries the meaning. */
/* Badge is absolutely positioned in the left padding so it never changes the notice's own
   grid/flow layout (multi-child notices, inline <b>label:</b> text), and is skipped where a
   notice already carries its own leading SVG icon. Top aligns to the first text line. */
:is(.notice.warning,.notice.error,.notice.alert,.notice.success):not(:has(> svg)) { position:relative; padding-left:46px; }
:is(.notice.warning,.notice.error,.notice.alert,.notice.success):not(:has(> svg))::before { content:'!'; position:absolute; left:16px; top:13px; width:20px; height:20px; border-radius:50%; display:grid; place-items:center; font:700 13px/1 var(--text); color:#fff; background:var(--busy-warn-text); }
:is(.notice.error,.notice.alert):not(:has(> svg))::before { background:var(--busy-bad-text); }
.notice.success:not(:has(> svg))::before { content:'✓'; background:var(--busy-good-text); font-size:12px; }
@media (max-width: 650px) { :is(.notice.warning,.notice.error,.notice.alert,.notice.success):not(:has(> svg)) { padding-left:42px; } :is(.notice.warning,.notice.error,.notice.alert,.notice.success):not(:has(> svg))::before { left:14px; top:14px; width:18px; height:18px; font-size:12px; } .notice.success:not(:has(> svg))::before { font-size:11px; } }
.pill.warning { background:color-mix(in srgb,var(--busy-warn) 22%,var(--white)); color:var(--busy-warn-text); border-color:var(--busy-warn); }
.notice.banner { margin-bottom:12px; }
.card > .hint { margin:0 0 16px; }
/* Toast-style notices (the drag-and-drop move/undo banner and the
   drawer's own "Booking updated/moved" notice both use the shared
   [data-move-notice] marker, src/web/diary.ts) float above the grid
   instead of sitting inline at the top of the page. */
.notice.strong[data-move-notice] { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom, 0)); transform: translateX(-50%); z-index: 32; width: calc(100% - 2 * var(--gutter)); max-width: 520px; padding: 10px 14px; box-shadow: 0 10px 30px #14253a2e; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
@media (min-width: 900px) { .notice.strong[data-move-notice] { bottom: 20px; } }
.notice.strong[data-move-notice] > span:first-child { min-width: 0; }
.notice.strong[data-move-notice] .iconbtn { width: 36px; height: 36px; }
/* Ryan 01:09: never stack the dismiss button under the text - one row at every width */
/* B0 gate fix (Fable): .notice is a two-column icon + text grid; a notice
   with no icon (login error, duplicate-client banner) put its first text
   run in the icon column and wrapped the rest underneath. */
.notice:not(:has(> svg)) { display: block; }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-soft); }
.empty .ill { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: var(--cool); box-shadow: 0 0 0 1px var(--rule); display: grid; place-items: center; color: var(--ink); }
.empty .ill svg { width: 34px; height: 34px; }
.empty h3 { margin-bottom: 6px; }
.empty p { margin: 0 0 14px; }

/* ---------- Stepper (booking) ---------- */
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.stepper i { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--rule); }
.stepper i.done { background: var(--ink); }
.stepper i.active { background: var(--blue); }
/* B0 W2 /book: the wizard's existing .step elements (kept verbatim for
   their data-step/active/done JS hooks) become the stepper's bars - same
   rule shape as .stepper i above, just scoped to the real element class
   already driven by booking-flow.ts's showStep(). Text stays in the DOM
   for assistive tech, visually hidden via font-size:0. */
.stepper .step { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--rule); font-size: 0; line-height: 0; overflow: hidden; }
.stepper .step.done { background: var(--ink); }
.stepper .step.active { background: var(--blue); }
.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-strip .chip { min-height: 36px; font-size: 14px; padding: 0 12px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 900px) { .slot-grid { grid-template-columns: repeat(6, 1fr); } }
.slot { min-height: 52px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; font: 600 18px/1 var(--display); color: var(--ink); cursor: pointer; display: grid; place-items: center; gap: 2px; }
.slot small { font: 400 12px/1 var(--text); color: var(--ink-soft); }
.slot[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.slot[aria-pressed="true"] small { color: #fff; opacity: .8; }
.slot.tight { background: var(--cool); }
@media (max-width: 650px) {
  .stepper { margin-bottom: 12px; }
  .summary-strip { margin-bottom: 10px; }
  .summary-strip .chip { min-height: 30px; font-size: 13px; padding: 0 10px; }
  .slot-grid { gap: 8px; }
  .slot { min-height: 46px; font-size: 16px; }
}
body.no-chrome .tabbar, body.no-chrome .appbar { display: none; }
.sticky-foot { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0)); background: var(--paper); padding: 12px 0 8px; margin-top: 12px; display: flex; gap: 10px; }
.sticky-foot .btn { flex: 1; }
@media (min-width: 900px) { .sticky-foot { position: static; } .sticky-foot .btn { flex: 0 0 auto; } }

/* ---------- Dog header / avatars ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--cool); box-shadow: 0 0 0 1px var(--rule); display: grid; place-items: center; font: 600 16px/1 var(--display); color: var(--ink); flex: none; }
.avatar.diary-staff-avatar { box-shadow: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.photo { background: var(--cool); }
/* Staff list/detail avatars: a groomer's g0..g7 hue class (src/web/diary.ts's hue(), same system as the diary - DESIGN.md addendum) sets --accent; g-none/off groomers keep the plain background above. Ring is the groomer's own colour (same --accent token), with a white gap so it reads on any background - same pattern as .gh-swatch. */
.avatar[class*=" g"]:not(.diary-staff-avatar) { background: var(--accent); box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--accent); }
.avatar.g-none, .avatar.off { background: var(--cool); }
.person { display: flex; align-items: center; gap: 14px; }
.person .name { font: 600 19px/1.15 var(--display); margin: 0; letter-spacing: -0.012em; }
.person .sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* ---------- Inbox ---------- */
.thread { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--rule-row); text-decoration: none; color: var(--ink); }
.thread .who { font: 600 17px/1.2 var(--display); }
.thread .who small { font: 400 14px/1 var(--text); color: var(--ink-soft); margin-left: 6px; }
.thread .snip { font-size: 15px; color: var(--ink-soft); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.owner-label { font: 600 13px/1.3 var(--text); color: var(--ink-soft); }
.thread .meta { text-align: right; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.thread .unread, .groomer-sheet-opt .unread { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; }
.thread.is-unread .who, .thread.is-unread .snip { color: var(--ink); font-weight: 600; }
.bubble.out { background: var(--ink); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.bubble.auto { background: var(--wash); border: 1px solid var(--rule); align-self: flex-end; border-bottom-right-radius: 4px; }
.convo { display: flex; flex-direction: column; gap: 10px; }
.day-sep { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 6px 0; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 52px; }

/* ---------- Staff settings ---------- */
.staff-grid { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 24px; align-items: start; }
.staff-list { list-style: none; margin: 0; padding: 0; }
.staff-list-left { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }
/* Every disclosure toggle is clickable, so it shows the pointer like any other link or button (Ryan, 15 Nov 2026). */
summary { cursor: pointer; }
.staff-list-left summary { padding: 6px 12px; cursor: pointer; }
.staff-list-left .staff-list { margin-top: 4px; }
.staff-list li a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 52px; }
.staff-list li a:hover { background: var(--cool); }
.staff-list li a[aria-current="true"] { background: var(--wash); }
.staff-list .name { font: 600 16px/1.2 var(--display); }
.staff-list .sub { font-size: 13.5px; color: var(--ink-soft); }
.hours { width: 100%; border-collapse: collapse; font-size: 15px; }
.hours th, .hours td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.hours thead th { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.hours tbody th { font-weight: 600; width: 120px; }
.hours input[type="time"], .hours input[type="number"] { font: 400 16px/1.2 var(--text); border: 2px solid var(--input-border); border-radius: 6px; padding: 8px 10px; min-height: 44px; width: 150px; color: var(--ink); background: #fff; }
/* B1 W2: the Break column's number input is narrower than a time input -
   same look, no need for the full 150px. */
.hours input[type="number"] { width: 70px; }
/* B0 fix: the Working/Not working <select> in each weekday row has no
   .field wrapper (brief W2 keeps the same select, just as a table cell),
   so without this it fell back to the browser's native select chrome -
   found via acceptance check 7's colour-token walker (an unstyled native
   border colour is not one of DESIGN.md's tokens). Same input look as
   .field select, just sized for the table cell. */
.hours select { font: 400 16px/1.2 var(--text); color: var(--ink); border: 2px solid var(--input-border); border-radius: 6px; padding: 8px 28px 8px 10px; min-height: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%2313263B' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 8px center; appearance: none; }
.hours td.off { color: var(--ink-soft); }
.hours .toggle { vertical-align: middle; }
/* B0 W2 /working-hours fix (acceptance check 8 - zero horizontal page
   overflow): at phone width the 4-column table (Day/Working/Start/End)
   with 150px-wide time inputs is wider than the card. Rule 5 keeps the
   page itself from scrolling sideways (only the grid diary and week
   table scroll inside their own card) - so this table compresses to fit
   instead of scrolling, rather than growing a new sideways-scroll case. */
/* B1 gate fix (Fable): with the Break column the five-column table no
   longer compresses legibly at 390 (time inputs were clipped to "10:").
   On phone each weekday row becomes a small block: day + toggle on the
   first line, Start / End / Break three-up underneath with their own
   labels (from data-l), or the single "Not working" line. */
@media (max-width: 899px) {
  .hours thead { display: none; }
  .hours tbody tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--hairline); align-items: end; }
  .hours tbody th { grid-column: 1 / 3; width: auto; font-size: 16px; border: 0; padding: 0; align-self: center; }
  .hours tbody td { border: 0; padding: 0; }
  .hours tbody td:nth-child(2) { grid-column: 3; justify-self: end; align-self: center; }
  .hours tbody td.off { grid-column: 1 / -1; font-size: 15px; }
  .hours td[data-l]::before { content: attr(data-l); display: block; font: 700 12.5px/1.2 var(--text); color: var(--ink-soft); margin-bottom: 4px; }
  .hours select { width: 100%; min-width: 0; font-size: 14px; padding: 6px 24px 6px 6px; background-position: right 6px center; background-size: 12px; }
  .hours input[type="time"], .hours input[type="number"] { width: 100%; min-width: 0; font-size: 15px; padding: 6px 6px; }
}
/* B1 gate fix (Fable): switches and checkboxes have no text of their own
   but still carry a computed `color`; keep it a token. */
.toggle { color: var(--ink); }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--positive); color: var(--ink); }
/* B1 gate fix (Fable): native <details> "reveal" confirmations. The
   summary (a button or text link) stays in the card head / list row and
   the revealed panel drops to a full-width row underneath, instead of
   stacking inside the right-hand cell. */
.card-head.reveal-head, .card-head.staff-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.card-head.staff-head { grid-template-columns: 1fr auto; margin-bottom: 18px; }
.card-head.staff-head > .switch { grid-column:2; grid-row:1; justify-self:end; align-self:start; }
.reveal-panel[hidden] { display: none !important; }
.card-head .reveal-panel { grid-column: 1 / -1; margin-top: 4px; }
.rows li:has(.reveal-panel) { flex-wrap: wrap; }
.rows li .reveal-panel { flex-basis: 100%; }
button.textlink { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
@media (max-width: 899px) {
  .card-head.staff-head { grid-template-columns: 1fr auto; }
  .card-head.staff-head .person { grid-column: 1 / -1; grid-row:2; }
  .card-head.staff-head > .switch { justify-self: end; grid-column: 2; }
}
/* B1 W2: Staff uses native <details> for every no-JS in-page confirmation
   (deactivate, delete time off, add time off, show past) instead of
   custom show/hide script. Found via scripts/stage1-qa.cjs's 390px
   overflow check that this particular engine/build doesn't reliably
   collapse a closed <details>'s content box to zero size on its own
   (content still occupied real layout width even with no [open]
   attribute and no CSS display:none in the UA stylesheet actually firing
   here) - this explicit, !important rule makes the collapse authoritative
   regardless of that, rather than depending on an engine quirk. */
details:not([open]) > *:not(summary) { display: none !important; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .svc-grid { grid-template-columns: 1fr; } }
/* Column colour picker (27 Oct 2026): a radio-swatch group replaces the
   plain <select> because a native select can't render a swatch - Ryan
   wants to see the colour, not just read its name. Each radio is
   visually hidden (not display:none, so it still receives focus and
   keyboard arrow-key navigation like a native radiogroup) behind its own
   labelled swatch; the name is always visible under the swatch per the
   brief, not only on hover/focus. */
.swatch-group { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-top: 4px; }
.swatch-option { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; cursor: pointer; }
.swatch-option input { position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; }
.swatch-option .swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); box-shadow: 0 1px 2px #14253a1f; }
.swatch-option .swatch-name { font-size: 12px; color: var(--ink-soft); text-align: center; }
.swatch-option input:checked + .swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch-option input:checked ~ .swatch-name { color: var(--ink); font-weight: 600; }
.swatch-option input:focus-visible + .swatch { outline: 3px solid var(--ink); outline-offset: 3px; }
.tabs { display: flex; min-width:0; max-width:100%; overflow-x:auto; overflow-y:hidden; position:relative; scrollbar-width:thin; touch-action:pan-x pan-y; gap: 22px; border-bottom: 1px solid var(--hairline); margin-bottom: 18px; }
.tabs a { flex-shrink:0; white-space:nowrap; padding: 10px 2px; text-decoration: none; color: var(--ink-soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--blue); }
/* Shared panel tabs: horizontally scroll within their own rail, never widen the page. */
[data-tabs] { min-width:0; }
.tabs[role="tablist"] { overflow-x:auto; overflow-y:hidden; position:relative; scrollbar-width:thin; }
.tabs [role="tab"] { flex-shrink:0; white-space:nowrap; }
.tabs [role="tab"]:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; border-radius:4px; }
@media (max-width:899px) { .tabs { scrollbar-width:none; } .tabs::-webkit-scrollbar { display:none; } }

@media (max-width: 650px) {
  .tabs { gap: 16px; margin-bottom: 14px; }
  .tabs a { min-height: 40px; font-size: 14px; }
  .staff-list li a { min-height: 52px; gap: 10px; padding: 6px 8px; }
  .staff-list .avatar, .staff-list li a .avatar { width: 36px; height: 36px; font-size: 14px; }
  .staff-list .name { font-size: 14.5px; }
  .staff-list .sub { font-size: 12.5px; }
}
/* B1 W2: /settings/staff master-detail. Below 900px the list and the
   selected groomer's detail are two separate pages/routes (list-only vs
   detail-only HTML from the server), not one page with both halves
   present - so .staff-grid just needs to let whichever single child is
   actually rendered take the full width instead of being squeezed into
   the 280px first-column track that only makes sense once both columns
   are shown side by side at >=900px. */
@media (max-width: 899px) {
  /* minmax(0,1fr), not bare 1fr: a bare fr track still respects the grid
     item's min-content width (the classic grid min-width:auto trap), so a
     wide row (long breed name + pills + alias text on /settings/breeds)
     was stretching this single-column track past the viewport and causing
     page-wide horizontal scroll at 390px. */
  .staff-grid { grid-template-columns: minmax(0,1fr); }
  .back-to-staff { display: inline-flex; margin-bottom: 14px; }
  /* list page shows only the list; detail page shows only the stack. */
  .staff-grid.page-list > .stack { display: none; }
  .staff-grid.page-detail > .staff-list-card { display: none; }
  /* The detail card-head (avatar + name + joined line on the left, status
     pill + deactivate control on the right) is too wide to fit one
     no-wrap flex row at 390px - .card-head itself stays no-wrap
     everywhere else in the app (dog card, etc.), so this wrap is scoped
     to .staff-grid only. */
  .staff-grid .card-head { flex-wrap: wrap; }
}
@media (min-width: 900px) {
  .back-to-staff { display: none; }
}

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login .card { width: 100%; max-width: 420px; padding: 28px 24px 24px; }
.login .brand { flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 20px; }
.login .brand img { width: 88px; height: 88px; border-radius: 0; }
.login h1 { text-align: center; font-size: 28px; margin-bottom: 4px; }
.login .lead { text-align: center; margin-bottom: 22px; }
.code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code input { text-align: center; font: 600 26px/1 var(--display); padding: 0; min-height: 60px; }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
/* B0 gate fix (Fable): a section heading directly after a card sat flush
   against it (client card "Dogs"). */
main .card + h2 { margin-top: 18px; }
@media (max-width: 899px) { .hide-phone { display: none !important; } }
@media (min-width: 900px) { .hide-desk { display: none !important; } }

/* Native hidden must win over shared display utilities (fields, panels). */
[hidden] { display: none !important; }

/* Universal motion preference for every shared control, including booking. */
@media (prefers-reduced-motion: reduce) {
  .btn, .toggle::after, .switch input[type=checkbox]::after { transition: none; }
}

/* Records comparison reuses the shared card and field components. */
.records-compare { display:grid; grid-template-columns:1fr; gap:14px; }
@media (min-width:900px) { .records-compare { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.records-compare .card { min-width:0; overflow-wrap:anywhere; }
/* Side-by-side grid, not a stack: the generic .card + .card stacking gap
   (line ~702) otherwise pushes the second card down and the gap itself
   already spaces the columns - same fix as .edit-layout/.booking-card-layout. */
.records-compare .card + .card { margin-top: 0; }

.dog-photo { display:block; width:96px; height:96px; object-fit:cover; border-radius:12px; border:1px solid var(--rule); margin-bottom:14px; }

/* ---------- Booking drawer: the one place a booking is read and changed from either diary view ---------- */
.detail-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(960px, 92vw); max-width: none; max-height: none; height: 100dvh; border: 0; border-left: 1px solid var(--rule); padding: 0; background: #fff; color: var(--ink); box-shadow: -12px 0 36px #14253a25; display: grid; grid-template-rows: auto 1fr auto; }
@media (max-width:650px) { .detail-drawer { width:100vw; } }
.detail-drawer:not([open]) { display: none; }
.detail-drawer::backdrop { background: #14253a55; }
.detail-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--rule); }
.detail-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex:1; }
.detail-head-main > div { min-width:0; flex:1; }
.detail-dog-title { display:flex; flex-wrap:wrap; align-items:center; gap:4px; min-width:0; }
.detail-dog-title h2 { min-width:0; overflow-wrap:normal; word-break:normal; }
.drawer-dog-edit { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; flex:none; white-space:nowrap; text-decoration:none; }
.drawer-dog-edit svg { width:18px; height:18px; }
.detail-dog-avatar { flex: none; width: 56px; height: 56px; font-size: 20px; }
.detail-drawer-head h2 { margin: 0; font-size: 28px; letter-spacing: -0.014em; }
.detail-drawer-head .kicker { margin-bottom: 4px; }
.detail-drawer-head .detail-breed { margin: 4px 0 0; font-size: 15px; }
.detail-head-side { display: flex; align-items: center; gap: 10px; flex: none; }
.detail-drawer-body { padding: 20px 24px 24px; overflow-y: auto; min-height: 0; }
.detail-when { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--cool); }
.detail-when b { font: 600 15px/1.3 var(--text); color: var(--ink-soft); grid-column: 1 / -1; }
.detail-when span { font: 600 24px/1.1 var(--display); letter-spacing: -0.01em; }
.detail-when .hint { grid-column:1/-1; margin:6px 0 0; }
.detail-when small { font: 600 14px/1.2 var(--text); color: var(--ink-soft); }
.detail-drawer-body .notice { margin-top: 14px; }
.detail-drawer-body dl { margin: 16px 0 10px; }
.detail-drawer-body dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule-row); font-size: 16px; }
.detail-drawer-body dl > div:first-child { border-top: 2px solid var(--ink); }
.detail-drawer-body dt { color: var(--ink-soft); font-size: 14.5px; font-weight: 700; padding-top: 2px; }
.detail-drawer-body dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-drawer-body dd a { color: var(--ink); text-decoration-color: var(--blue); text-decoration-thickness: 2px; }
.detail-drawer-body > p.small { margin: 8px 0 0; line-height: 1.4; }
@media (min-width:1000px) {
  .detail-drawer-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-content:start; align-items:start; }
  .detail-drawer-body > * { grid-column:1/-1; min-width:0; margin-block:0; }
  .detail-drawer-body > .detail-section { grid-column:auto; margin-top:0; }
  .detail-drawer-body > details.detail-section[open] { grid-column:1/-1; }
  .detail-drawer-body dl > div:first-child { border-top:0; }
  .detail-drawer-body > dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; border-top: 2px solid var(--ink); }
}
.detail-status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; }
.detail-status-actions [role="status"]:empty { display: none; }
@media (max-width: 650px) {
  /* Tidy equal-height 2-up grid instead of flex-wrap, so "Mark arrived",
     "Mark done" and "Mark no-show" line up instead of wrapping to
     mismatched-width rows on a narrow drawer. */
  .detail-status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .detail-status-actions .btn { width: 100%; }
  .detail-status-actions [role="status"] { grid-column: 1 / -1; }
  [data-booking-panel-actions] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.detail-section { margin-top: 18px; border: 1px solid var(--rule); border-radius: 12px; padding: 0 16px; }
.detail-section:not(details) { padding:16px; }
.detail-section > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 10px; font-weight: 700; list-style: none; }
.detail-section > summary::-webkit-details-marker { display: none; }
.detail-section > summary::before { content: ""; width: 8px; height: 8px; margin-right: 2px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); transition: transform .15s var(--ease); flex: none; }
.detail-section[open] > summary::before { transform: rotate(45deg); }
.detail-section[open] > summary { border-bottom: 1px solid var(--rule-row); }
.detail-section form { padding: 14px 0 16px; }
.detail-section form > p.small { margin: 0 0 12px; }
.detail-section .field { margin-bottom: 12px; }
.detail-section .field label { font-size: 15px; }
.detail-section .field input:not([type="checkbox"]):not([type="radio"]), .detail-section .field select { min-height: 46px; font-size: 16px; padding: 9px 12px; }
.detail-section .field select { padding-right: 36px; }
.detail-section .row { margin-top: 4px; }
.detail-section .row p { margin: 0; }
.detail-drawer-actions { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--rule); background: #fff; }
.detail-drawer-actions .btn { flex: 1; text-align: center; }







.diary-workspace { background:var(--white); margin-inline:calc(-1 * var(--gutter)); padding-inline:var(--gutter); }
.diary-workspace .date-nav { padding-block:8px; }
/* Ryan 27 Oct 21:33: desktop Day view has no groomer chip row (week's
   `.always` picker is the only one shown above 899px), so the white diary
   header sits flush under the toolbar's rule instead of leaving a grey band.
   A dog-warnings strip, when present, keeps its own breathing room. */
.diary-workspace:has(> .diary-groomer-picker:not(.always)) > .diary-safety { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .diary-position .ev, .detail-section > summary::before, .gap-position .gap-actions { transition: none; } }
@media (max-width: 650px) {
  .detail-drawer { width: 100vw; border-left: 0; }
  .detail-drawer-head { padding: 16px; }
  .detail-drawer-head h2 { font-size: 19px; }
  .detail-drawer-head .detail-breed { font-size: 13px; }
  .detail-dog-avatar { width: 44px; height: 44px; font-size: 16px; }
  .detail-drawer-body { padding: 16px 16px 20px; }
  .detail-drawer-actions { padding: 10px 16px; flex-direction: column; }
  .detail-drawer-actions .btn { min-height: 44px; }
  .detail-when { padding: 10px 12px; }
  .detail-when span { font-size: 19px; }
  .detail-drawer-body dl > div { grid-template-columns: 96px 1fr; padding: 9px 0; font-size: 13px; }
  .detail-drawer-body dt { font-size: 13px; }
  .detail-drawer-body dd { font-size: 13.5px; }
}

/* ---------- Diary drag-to-move (mouse and deliberate touch long-press) ---------- */
.sr-only { position: absolute !important; width: 1px !important; min-width:0 !important; max-width:1px !important; height: 1px !important; min-height:0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.diary-position.dragging-source { opacity: .35; }
.grid-diary .gcol.drag-target { background-color: var(--wash); outline: 2px dashed var(--blue); outline-offset: -2px; }
.diary-drag-notice { position: relative; }
/* Magnetic snap + clash-preview feedback (26 Oct 2026 drag-feel pass,
   revised same day after Ryan's hands-on pass: the twisted ghost cut its
   own coloured border off at the bottom, so the free/clash colour now
   lives on the ghost itself - exactly one green/red object, never
   rotated, always fully in view. .diary-drop-slot stays as a thin neutral
   positioning guide only (no colour) so it can't duplicate that signal.
   --drop-ok/--drop-no are the one authorised red/green exception
   (transient drag feedback only, see DESIGN.md addendum); default
   (`checking`) state stays neutral --rule/--cool, matching every other
   dashed placeholder in the app. */
.diary-drop-slot { position: fixed; z-index: 29; pointer-events: none; border: 2px dashed var(--rule); border-radius: 10px; background: var(--cool); transition: left .12s var(--ease), top .12s var(--ease); }
.diary-drop-slot .slot-icon { position: absolute; top: 6px; right: 8px; font: 700 14px/1 var(--text); color: var(--ink); }
.diary-drag-ghost { position: fixed; z-index: 30; pointer-events: none; opacity: .85; box-shadow: 0 10px 24px #14253a3d; border-radius: 10px; border: 2px solid transparent; transition: border-color .12s var(--ease); }
.diary-drag-ghost .ev { transition: none; box-shadow: none; }
.diary-drag-ghost.is-free, .diary-drag-ghost.is-clash { transition: left .12s var(--ease), top .12s var(--ease), border-color .12s var(--ease); }
.diary-drag-ghost.is-free { border-color: var(--drop-ok); }
.diary-drag-ghost.is-clash { border-color: var(--drop-no); }
.diary-drag-ghost.is-free .ev { background: color-mix(in srgb, var(--drop-ok) 18%, white) !important; }
.diary-drag-ghost.is-clash .ev { background: color-mix(in srgb, var(--drop-no) 16%, white) !important; }
.diary-drag-time { position: fixed; z-index: 31; pointer-events: none; background: var(--ink); color: #fff; font: 600 13px/1 var(--text); padding: 4px 8px; border-radius: 999px; box-shadow: 0 2px 6px #14253a2e; display: flex; align-items: center; gap: 4px; }
.diary-drag-time .pill-icon:empty { display: none; }
.diary-drag-time .pill-text { white-space: nowrap; }
.diary-drag-time.is-free { background: var(--drop-ok); }
.diary-drag-time.is-clash { background: var(--drop-no); }
@keyframes diary-drop-pop { 0% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes diary-drop-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.diary-drag-ghost.drop-pop { animation: diary-drop-pop .16s var(--ease); }
.diary-drop-slot.drop-shake { animation: diary-drop-shake .22s ease; }
.diary-drag-ghost.spring-back { transition: left .22s var(--ease), top .22s var(--ease); }
/* In-place move confirm (26 Oct 2026, replaces the bottom Save/Cancel
   bar): the settled ghost becomes this fixed card right where it was
   dropped, carrying its own confirm strip, instead of vanishing while a
   detached bar asks about it elsewhere on screen. */
.diary-pending-move { position: fixed; z-index: 30; display: flex; flex-direction: column; pointer-events: auto; border-radius: 10px; border: 2px solid var(--drop-ok); background: color-mix(in srgb, var(--drop-ok) 18%, white); box-shadow: 0 10px 24px #14253a3d; overflow: hidden; }
.diary-pending-move .ev { position: static; inset: auto; height: auto; min-height: 0; flex: 1 1 auto; background: transparent; box-shadow: none; }
.diary-pending-move .ev-main { height: auto; pointer-events: none; }
.diary-pending-confirm { pointer-events: auto; flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; background: #fff; border-top: 1px solid var(--drop-ok); font-size: 12px; line-height: 1.3; }
.diary-pending-confirm span { flex: 1 1 100%; min-width: 0; color: var(--ink); }
.diary-pending-confirm .notice-actions { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; }
.diary-pending-confirm .notice-actions .btn.sm { flex: 1; padding-left: 6px; padding-right: 6px; }
/* Touch confirmations must not inherit the dragged card's inline coordinates.
   On the compact shell they are a shared safe-area-aware sheet above tabs. */
@media (max-width:899px) {
  .diary-pending-move { left:8px !important; right:8px; top:auto !important; bottom:calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 8px); width:auto !important; max-height:calc(100dvh - var(--tab-h) - env(safe-area-inset-bottom, 0px) - 24px); }
  .diary-pending-move .ev { display:none; }
  .diary-pending-confirm { min-height:112px; padding:12px; gap:10px; font-size:14px; }
  .diary-pending-confirm .notice-actions { gap:10px; }
  .diary-pending-confirm .notice-actions .btn.sm { min-height:44px; padding:0 14px; }
}
.diary-move-origin-dimmed { opacity: .35; transition: opacity .15s var(--ease); }

.diary-moved-chip { position: absolute; top: 4px; right: 4px; z-index: 2; min-height: 20px; padding: 0 8px; background: var(--drop-ok); color: #fff; border: none; cursor: pointer; font: 600 11px/1 var(--text); }
@media (prefers-reduced-motion: reduce) { .diary-drag-ghost, .diary-drag-time, .diary-drop-slot, .diary-pending-move, .diary-move-origin-dimmed { transition: none; } .diary-drag-ghost.drop-pop, .diary-drop-slot.drop-shake { animation: none; } }
/* Card gestures: tap opens, early swipe pans, 350ms hold lifts.
   Touch ownership is fixed before pointerdown so a held drag cannot be
   cancelled by native scrolling. Empty space retains native momentum. */
.diary-scroll.touch-dragging, .availability-scroll.touch-dragging { touch-action: none; overscroll-behavior: contain; }
@media (pointer: coarse) { .diary-position:is([data-appt-id], [data-appointment-preview]) { touch-action: none; } }
.diary-scroll, .availability-scroll { overscroll-behavior-x: contain; }
/* Shared action-button group for the floating notice cards above:
   grid-template-columns locks this whole group together in the right-hand
   column at desktop so Save/Cancel (or Undo/dismiss) never split across
   the message's wrap point; it is itself a plain row so narrow screens
   (stacked to a single grid column) still show the buttons side by side. */
/* Base rule (Theo review, 16 Nov 2026): .notice-actions had no unscoped
   layout rule, so any notice using it without the .diary-pending-confirm
   or [data-move-notice] overrides below got unspaced inline buttons (seen
   on the duplicate-client banner and the dog-merge/lookalike notices). */
.notice-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice.strong[data-move-notice] .notice-actions { flex-shrink: 0; }

/* ---------- Booking edit page: form beside its context instead of one long column ---------- */
.booking-edit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 18px; font-size: 15px; }
.edit-layout { display: grid; gap: 14px; align-items: start; }
.edit-layout .card h2 { font-size: 20px; margin-bottom: 14px; }
.edit-layout .stack > .card + .card { margin-top: 0; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .field-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-row.three > .field:last-child { grid-column: 1 / -1; } }
.field-row > .field { margin-bottom: 0; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.field-row > .field label, .field-row > .field input, .field-row > .field select { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (min-width: 900px) { .edit-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; } }
/* ---- Clients cards (design pass) ---- */
/* Directory: contact-style cards in an auto-fill grid (1 col phone, 2 tablet, 4-5 wide desktop). */
.client-directory { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:12px; }
.client-directory > li { min-width:0; padding:0; }
.client-directory > li[hidden] { display:none; }
.client-tile { position:relative; display:flex; flex-direction:column; gap:12px; height:100%; min-height:160px; padding:16px; border:1px solid var(--hairline); border-radius:var(--radius-soft); background:var(--white); color:var(--ink); text-decoration:none; box-shadow:0 1px 2px #14253a0a; }
.client-tile:focus-visible { outline:3px solid var(--ink); outline-offset:3px; box-shadow:0 0 0 6px var(--white); border-radius:var(--radius-soft); }
.client-tile-identity { display:grid; min-width:0; gap:2px; }
.client-tile-identity b { font:600 17px/1.2 var(--display); letter-spacing:-.01em; overflow-wrap:anywhere; }
.client-tile-identity > span { color:var(--ink-soft); font-size:13.5px; font-variant-numeric:tabular-nums; }
.client-tile-dogs { display:flex; flex-wrap:wrap; align-content:start; gap:6px; min-height:26px; }
.client-dog-chip { display:inline-flex; align-items:center; min-height:26px; padding:2px 10px; border:1px solid var(--rule); border-radius:999px; background:var(--white); font-size:13px; line-height:1.3; color:var(--ink); }
.client-tile-footer { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:auto; padding-top:12px; border-top:1px solid var(--hairline); font-size:13.5px; line-height:1.35; color:var(--ink); }
.client-tile-footer svg { width:16px; height:16px; flex:none; color:var(--ink-soft); }
.client-tile-footer b { font-weight:600; }
.client-tile-footer .is-quiet { color:var(--ink-soft); }
.client-tile-footer > span:not(.pill) { display:flex; align-items:center; gap:6px; flex:1 1 auto; min-width:0; }
.client-tile-footer .pill.next-in { flex:none; margin-left:auto; }
/* Ryan 3 Nov 21:42: Next line never wraps onto extra rows - date on line 1, groomer underneath, pill stays on the right at every width. */
.client-tile-footer:has(.client-next-text) { flex-wrap:nowrap; }
.client-tile-footer > span.client-next-text { display:grid; gap:1px; flex:1 1 auto; min-width:0; }
.client-next-text > b, .client-next-text > small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-next-text > small { color:var(--ink-soft); font-size:12.5px; }
/* Ryan 3 Nov 20:26: booked-in dog picture(s) lead the Next line; several dogs overlap slightly. */
.client-next-dogs, .client-tile-footer > span.client-next-dogs { display:flex; flex:none; }
.client-next-dogs .dog-pic { width:32px !important; height:32px !important; border-radius:50%; box-shadow:0 0 0 2px #fff; object-fit:cover; }
.client-next-dogs .dog-pic + .dog-pic { margin-left:-10px; }
.pill.client-pill-cool { background:var(--cool); color:var(--ink-soft); border-color:var(--rule); }
@media (max-width: 650px) {
  .client-tile { padding: 12px; min-height: 0; gap: 10px; }
  .client-tile-identity b { font-size: 15px; }
  .client-tile-identity > span { font-size: 12.5px; }
  .client-tile-footer { font-size: 13px; padding-top: 10px; }
  .rows li { padding: 10px 0; }
  .rows li b { font-size: 14.5px; }
  .rows li span { font-size: 13px; }
}

/* Record: 7fr/5fr body like the booking edit page. The header band, stat
   tiles and compact dog card live in the Batch 33 block at the end of this
   file. */
/* Batch 24: one tap-to-call treatment, used on the client record header and
   the appointment drawer. tabular-nums + letter-spacing keep the digits
   easy to read at a glance; min 44px tap target per field-size rules. */
.phone-link { display:inline-flex; align-items:center; gap:6px; min-height:44px; color:var(--ink); text-decoration:none; font-variant-numeric:tabular-nums; }
.phone-link svg { width:18px; height:18px; flex:none; }
.phone-link:hover { color:var(--link); text-decoration:underline; }
.phone-link-lg { font-size:19px; font-weight:700; letter-spacing:.02em; }
.phone-link-lg svg { width:20px; height:20px; }
.client-record-layout { align-items:start; }
.client-record-layout > .stack { min-width:0; display:grid; align-content:start; gap:12px; }
.client-record-layout > .stack > .card, .dog-grid > .card { min-width:0; margin:0; }
.client-section-title { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:2px 2px 0; }
.dog-grid { display:grid; gap:12px; min-width:0; }
.dog-card { display:grid; gap:12px; align-content:start; }
.dog-card > .notice { margin:0; }
.dog-card-head { display:flex; align-items:center; gap:14px; min-width:0; }
.dog-pic { border-radius:10px; flex:none; }
.dog-pic:not(.dog-pic-icon) > img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
img.dog-pic { object-fit:cover; display:block; }
/* Booking drawer header photo (Ryan, 22:56 voice): the only .dog-pic that
   opens the lightbox, so it's the only one with a <button> between the
   span and the <img> - same fill/cover/radius as the plain-img case
   above, one level deeper, plus a button reset. :focus-visible reuses the
   sitewide outline (app.css L173); no separate hover state was asked for. */
.dog-pic-avatar-open { appearance:none; border:0; margin:0; padding:0; background:transparent; display:block; width:100%; height:100%; border-radius:inherit; cursor:pointer; }
.dog-pic-avatar-open img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
/* Batch 18 item 3: one avatar treatment everywhere a dog appears in a result
   list - a white tile sits behind the breed icon so it reads as deliberate
   on a navy selected row instead of the bare icon showing an ugly white
   blob, and the initials fallback uses the same tile family (wash
   background, ink initial) rather than its own separate look. */
.dog-pic-icon { display:grid; place-items:center; overflow:hidden; background:#fff; }
.dog-pic-icon img { width:100%; height:100%; object-fit:contain; transform:scale(1.42); }
/* Batch 29 item 4 (Ryan 23:15 photo, Hugo): the fallback rendered as a bare
   "H" stuck top-left, misaligned against a sibling's real photo tile - the
   row's own flex/align rules weren't reliably reaching this span (e.g. the
   row context didn't match the `> span` selectors that centre siblings
   elsewhere). Harden the tile itself so it's always a self-contained
   size/radius/frame box, independent of whatever flow it's dropped into:
   never shrink, keep the inline width/height's box exact, and centre the
   initial inside it regardless of parent alignment. */
.dog-pic.dog-pic-initials { display:grid; place-items:center; flex-shrink:0; align-self:center; box-sizing:border-box; line-height:1; text-align:center; background:var(--wash); color:var(--ink); font-weight:600; font-family:var(--display); }
.dog-card-title { display:grid; gap:3px; min-width:0; }
.dog-card-title h2 { margin:0; overflow-wrap:anywhere; }
.dog-card-breed { color:var(--ink-soft); font-size:13.5px; overflow-wrap:anywhere; }
/* Quick-book's chosen-dog readout: same dog-card-head/-title avatar+name
   pattern as the booking drawer header and dog record card, inside the
   existing input field's border/radius so it still reads as a form field. */
.qb-dog-chosen { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; border:2px solid var(--input-border); border-radius:6px; padding:10px 12px; background:#fff; min-height:52px; box-sizing:border-box; }
.qb-dog-chosen[hidden] { display:none; }
.qb-dog-chosen .dog-pic-slot { display:contents; }
.qb-dog-chosen .dog-card-title { flex:1; min-width:0; }
.qb-dog-chosen .dog-card-title h2 { font-size:17px; text-align:left; }
.qb-dog-chosen .dog-card-title .small.muted { display:block; }
.qb-dog-chosen [data-qb-dog-change] { margin-left:auto; flex:none; }
.dog-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.dog-section-head h3 { margin:0; font-size:12.5px; font-family:var(--text); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); }
.dog-photo-upload { font-size:14.5px; }
.dog-photo-upload form { margin-top:10px; }
.dog-archive { display:contents; }
.dog-archive[open] > .notice { flex-basis:100%; margin-top:0; }
.dog-archive > summary { list-style:none; }
.dog-archive > summary::-webkit-details-marker { display:none; }
.client-record-layout .rows { min-width:0; }
.client-record-layout .rows li > div { min-width:0; }
.client-record-layout .rows li span[aria-hidden] { display:none; }
.client-record-layout .rows li > div > a.textlink { display:inline-block; margin:4px 18px 0 0; }
@media (min-width:1280px) { .client-record-layout .dog-grid:has(> .card:nth-child(2)) { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:600px) and (max-width:899px) { .dog-grid:has(> .card:nth-child(2)) { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Phone: the hour ruler is narrower than the word "Time", so shrink the corner label rather than clip it. */
@media (max-width: 650px) { .grid-diary .gh.corner { font-size: 11px; padding-left: 4px; padding-right: 2px; letter-spacing: 0; } }

/* Mobile density pass 3 (Theo review of e02e3a5): the phone main padding in
   the density block was being overridden by the later base `main` rule (18px),
   leaving a gap under the app bar; and Clients stacked its search field over a
   full-row Search button. Kept last so source order wins. Phone only. */
@media (max-width: 650px) {
  .search-box.toolbar { flex-wrap: nowrap; gap: 8px; }
  .search-box.toolbar .search.field { flex: 1 1 auto !important; min-width: 0; }
  .search-box.toolbar .search.field input { min-height: 42px; font-size: 15px; }
  .search-box.toolbar > .btn { flex: 0 0 auto; min-height: 42px; padding: 0 14px; }
  .client-directory-head { margin-bottom: 8px; }
}
.qb-dog-info { margin: -6px 0 0; }



/* Theo 27 Oct: week view must fit the window from 900px up (base minmax(150px) overflowed ~97px at 1024). */
@media (min-width: 900px) { .grid-diary.week-grid { grid-template-columns: 56px repeat(7, minmax(0, 1fr)); } }




/* The time line is a grid-level layer: above every resting card/image, but
   below the whole hovered/focused wrapper (which rises to 20).  Keeping this
   on the wrapper avoids transformed card children trapping the line. */
.grid-now { z-index: 10; pointer-events: none; }

/* Desktop owns the meter; tablet and phone own the neutral subtitle number. */
@media (max-width: 899px) {
  .grid-diary .gh small .sub-full { display:none !important; }
  .grid-diary .gh small .sub-short { display:inline !important; }
}

/* Day and Week share an edge-to-edge calendar surface. The time ruler
   owns label spacing; the scroll container must not reintroduce side gutters. */
.diary-workspace .diary-scroll { width: auto; max-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); background: #fff; padding: 0; box-sizing: border-box; }
.diary-workspace .diary-scroll .grid-diary { box-shadow: none; border: 0; border-radius: 0; }
/* No drop shadow from the stuck Day/Week bar onto the pinned day headings - a single hairline divides them. */
.diary-workspace .sticky-bar.is-stuck::after { content: none; }
.diary-workspace .sticky-bar.is-stuck { border-bottom-color: var(--hairline); }
/* Below 900px the week grid scrolls horizontally (native overflow-x) inside .diary-scroll;
   padding there would let swiped columns show through the left gutter, so the scroller
   stays unpadded and the time ruler carries the edge spacing instead. */
@media (max-width: 899px) { .diary-workspace .diary-scroll { padding: 0; } .diary-workspace .gtimes .gt, .diary-workspace .gh.corner { padding: 0 6px 0 8px; box-sizing: border-box; overflow: hidden; white-space: nowrap; font-size: 12.5px; } }

/* The column-level .grid-now is the single current-time line. Do not draw a
   second pixel-offset line inside cards: fitting/resizing makes it drift. */
/* Theo 27 Oct 18:50 (Ryan, phone): merged header row - push the ⋯ menu to the
   right edge, and remove the grey band between the header row and the white diary
   (the later `.diary-workspace .date-nav{margin-bottom:12px}` was winning). */
@media (max-width: 899px) {
  .date-nav .diary-header-slot { flex: 1 1 0; min-width: 0; }
  .diary-workspace .date-nav { margin-bottom: 0; }
}
@media (max-width: 349px) { .date-nav .diary-header-slot { flex: 1 1 auto; min-width: auto; } }

/* Ryan 27 Oct 19:51: the 2px ink rule under the groomer/day headings was too
   heavy. One lighter 1px divider (existing input-border token), day + week.
   Batch 29 (23:46 voice): today's week column no longer keeps a blue
   underline here either - no bar of any kind marks it now, just the tint
   and the wash fill. */
.grid-diary .gh, .grid-diary .gh.corner { border-bottom: 1px solid var(--input-border); }
/* Ryan 27 Oct 19:53 (phone): a tapped dog row kept the sticky touch :hover
   (navy fill) with dark text on top - unreadable. Hover fill only on real
   hover devices; the chosen row gets a proper pressed state with all its text
   white. */
@media (hover: none) { .btn.ghost:hover { background: var(--cool); color: var(--ink); border-color: var(--hairline); } }
.result-row[aria-pressed="true"], .result-row[aria-pressed="true"]:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.result-row[aria-pressed="true"] *, .btn.ghost:hover * { color: inherit; }


/* Ryan 27 Oct 20:03: the phone groomer button fills the free space in the
   header row (between the calendar and ⋯) so full names are readable. */
@media (max-width: 899px) {
  .date-nav .diary-header-slot .groomer-sheet-wrap { flex: 1 1 auto; min-width: 0; display: flex; }
  .date-nav .diary-header-slot .groomer-sheet-trigger { max-width: none; width: 100%; justify-content: space-between; text-align: left; }
  .date-nav .diary-header-slot .diary-quick-actions { flex: 0 0 auto; margin-left: 3px; }
}
@media (max-width: 899px) {
  .date-nav .diary-header-slot .groomer-sheet-trigger { text-decoration:none; display: inline-flex; align-items: center; gap: 4px; overflow: hidden; }
  .date-nav .diary-header-slot .groomer-sheet-trigger .hide-desk { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.groomer-sheet-trigger .gn-first { display: none; }
@media (max-width: 389px) { .groomer-sheet-trigger .gn-full { display: none; } .groomer-sheet-trigger .gn-first { display: inline; } }
/* Ryan 27 Oct 20:24: room for the sticky Unsaved changes bar so it never covers the form. */
body.has-dirty-bar main, body.has-dirty-bar .page { padding-bottom: 120px; }
.dirty-form-bar .btn:not(.ghost) { background: #fff; color: var(--ink); border-color: #fff; }

/* Theo 27 Oct 21:00: the /book dog list uses the same row as search
   results - avatar left, text beside it, tick on the far right. */
#dogResults { list-style: none; margin: 0; padding: 0; }
#dogResults li.result-row-live { display: flex; align-items: center; gap: 12px; padding: 8px 4px; min-height: 48px; cursor: pointer; text-align: left; }
#dogResults li.result-row-live .dog-pic { flex: none; }
#dogResults li.result-row-live > span:not(.dog-pic) { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#dogResults li.result-row-live > span small { display: block; }
#dogResults .dog-row-tick { margin-left: auto; margin-right: 0; }
/* Empty helper slots take no room (e.g. groomer hint before "Find any eligible team"). */
.hint:empty { display: none; }
/* Copy last visit wraps on narrow phones instead of running off the card. */
[data-copy-latest], [data-copy-undo] { white-space: normal; text-align: left; max-width: 100%; height: auto; }
/* Per-dog form: groomer gets the full row while the second groomer is collapsed;
   service gets the wider column so its name isn't clipped. */
.field-row.compact:has(> [data-second-wrap][hidden]) { grid-template-columns: minmax(0,1fr); }
.field-row.compact:has(> .field > label > [name=serviceId]) { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.field-row.compact + .textlink.sm, .field .textlink.sm { margin-top: 2px; }
.field .textlink-row { flex-wrap: wrap; row-gap: 4px; margin-top: 2px; }
.field .textlink-row .textlink.sm { margin-top: 0; }
.slot-grid:empty { display: none; }

/* Theo 27 Oct 21:15 (Ryan phone screenshot): free-time boxes inherited the
   4px booking-card stripe, which drew as a heavy dashed bar down every
   column. Gaps keep a hairline all round. */
.diary-position .ev.gap { border-left-width: 1px; box-shadow: none; }

/* Theo 27 Oct 21:20: the quick-book sheet on phones kept the desktop
   popover's 540px width and ran off the right edge. The sheet is full width. */
@media (max-width:650px) { .block-popover.quick-book-popover { width: 100%; max-width: 100vw; box-sizing: border-box; } }

/* Ryan 27 Oct 21:14: in the /book dog list the tick is the selection - no
   navy fill (it made the name unreadable) and no "Selected:" line. A picked
   or ticked dog gets the light wash instead, text stays ink. */
.result-row-live.dog-row.is-chosen, #dogResults li.dog-row:has([data-multi-dog]:checked) { background: var(--wash); color: var(--ink); }
.result-row-live.dog-row.is-chosen small, #dogResults li.dog-row:has([data-multi-dog]:checked) small { color: var(--ink-soft); opacity: 1; }
#dogResults li.dog-row { border-radius: 10px; padding-left: 8px; padding-right: 8px; }
#dogResults:has([data-multi-dog]) ~ #dogChosen { display: none; }
.time-select { width: 100%; }
/* Ryan 27 Oct 21:39: an open card (z 20) could still rise over the sticky
   date toolbar (z 15). Isolating the diary grid keeps every card, gap
   popover and sticky header inside one layer that always stays below the
   page's own sticky bars, whatever z-index a card uses inside it. */
.diary-workspace .diary-scroll { isolation: isolate; }

/* ---------- Batch 30: owner reports (replaces the batch 25a/25b/28 blocks) ----------
   Mobile-first redesign (Ryan 27 Oct 22:53 voice + phone screenshot). One
   rhythm for every section: shared .card header band, a .report-sub
   kicker for sub-headings, tabular figures in columns, proportional
   figures on tiles. Charts are HTML/CSS so they reflow to any width. */
.reports-page { display: grid; gap: 14px; }
/* Ryan 3 Nov 20:47: on phone the page title lives in the app bar, so the period card sat hard under it. Same breathing room as the gap between cards. */
@media (max-width: 899px) { .reports-page { padding-top: 14px; } }
.reports-page .card { margin: 0; min-width: 0; max-width: 100%; }
/* A grid item defaults to min-width:auto, so an open "View as table" would
   push its 560px table into the page's scrollWidth on a phone - the table
   must scroll inside .log-table-wrap only. */
.reports-page .log-table-wrap { min-width: 0; max-width: 100%; }
.reports-page details { min-width: 0; }
.report-sub { font: 700 12px/1.3 var(--text); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin: 18px 0 8px; }
.report-sub.first { margin-top: 0; }
.report-empty, .report-note { margin: 0 0 8px; }
.report-note { margin-top: -4px; }
.report-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; }
/* Period controls: wrapping chips so every preset is visible on a phone,
   then the date range and a compact CSV link sharing one row. */
.period-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.period-chips .chip { min-height: 40px; padding: 0 14px; font-size: 14.5px; }
.period-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 12px; }
.period-label { font: 600 16px/1.3 var(--display); margin: 0; min-width: 0; overflow-wrap: anywhere; }
.csv-link { min-height: 36px; padding: 0 12px; font-size: 14px; gap: 6px; }
/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-tile { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; background: var(--cool); min-width: 0; display: flex; flex-direction: column; }
.kpi-label { margin: 0; font-size: 13px; line-height: 1.25; color: var(--ink-soft); font-weight: 600; overflow-wrap: anywhere; }
.kpi-value { margin: 4px 0 0; font: 700 26px/1.1 var(--display); overflow-wrap: anywhere; }
.kpi-value-soft { font-size: 19px; font-weight: 600; color: var(--ink-soft); }
.kpi-delta-row { margin: 6px 0 0; line-height: 1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
.kpi-delta.good { color: var(--busy-good-text); background: #ECFDF3; border-color: #BBE5C8; }
.kpi-delta.bad { color: var(--busy-bad-text); background: #FEF2F2; border-color: #F3C4C4; }
.kpi-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); overflow-wrap: anywhere; }
/* Column chart */
.col-chart { --plot-h: 190px; --tick-w: 34px; margin-top: 2px; }
.col-plot { position: relative; height: var(--plot-h); margin-left: var(--tick-w); }
.col-grid-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--viz-grid); }
.col-grid-line:first-child { border-top-color: var(--rule-row); }
.col-tick { position: absolute; right: calc(100% + 6px); top: -7px; font: 500 11px/1 var(--text); color: var(--placeholder); font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline-offset: -2px; border-radius: 4px; }
.col:hover, .col:focus-visible { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.col-bar { width: 100%; max-width: 24px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.col-seg { display: block; flex: none; width: 100%; }
.col-seg + .col-seg { margin-top: 2px; }
.col-seg:first-child { border-radius: 4px 4px 0 0; }
.col-xaxis { display: flex; gap: 2px; margin-left: var(--tick-w); margin-top: 6px; }
.col-x { flex: 1 1 0; min-width: 0; text-align: center; font: 500 11px/1.2 var(--text); color: var(--ink-soft); white-space: nowrap; overflow: visible; }
.col-x.x-hidden { visibility: hidden; }
@media (max-width: 650px) { .col-x.x-minor { visibility: hidden; } .col-chart { --plot-h: 160px; --tick-w: 30px; } }
.viz-done { background: var(--viz-done); }
.viz-upcoming { background: var(--viz-upcoming); }
.viz-cancelled { background: var(--viz-cancelled); }
.viz-noshow { background: var(--viz-noshow); }
.viz-series { background: var(--viz-series); }
.tl-bad { background: var(--busy-bad); }
.tl-warn { background: var(--busy-warn); }
.tl-good { background: var(--busy-good); }
.tl-none { background: var(--input-border); }
/* Legend */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart-table { margin-top: 12px; }
.chart-table summary { cursor: pointer; font-size: 13.5px; color: var(--link); font-weight: 600; }
.chart-table .log-table-wrap { margin-top: 8px; }
.report-table { min-width: 560px; font-size: 14.5px; }
.report-table.narrow { min-width: 420px; }
.report-table td, .report-table th { padding: 9px 10px; }
.report-table tbody th { font-size: 15px; width: auto; white-space: normal; }
.report-table .num-cell, .report-table thead th { font-variant-numeric: tabular-nums; }
.report-notes { margin-top: 2px; }
/* Horizontal bars: label | track | value at tablet+; label + value above
   a full-width track on phone, so a long label can never touch the bar. */
.hbars { display: grid; gap: 9px; list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.hbar-label { font-size: 13.5px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hbar-track { display: block; height: 10px; border-radius: 999px; background: var(--viz-track); overflow: hidden; min-width: 0; }
.hbar-fill { display: block; height: 100%; border-radius: 0 999px 999px 0; min-width: 0; }
.hbar-value { text-align: right; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 650px) {
  .hbars { gap: 10px; }
  .hbars li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 3px 10px; }
  .hbar-label { grid-area: label; white-space: normal; overflow: visible; text-overflow: clip; font-size: 13px; line-height: 1.3; }
  .hbar-track { grid-area: track; height: 8px; }
  .hbar-value { grid-area: value; align-self: end; }
}
/* Busiest-times heatmap: equal columns fill the card, cells stay square. */
.heat-grid { display: grid; grid-template-columns: 34px repeat(12, minmax(0, 1fr)); gap: 3px; align-items: center; max-width: 560px; }
.heat-hour, .heat-day { font: 500 11px/1 var(--text); color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.heat-day { text-align: left; }
.heat-hour { padding-bottom: 2px; }
.heat-cell { display: block; width: 100%; aspect-ratio: 1; border-radius: 4px; background: var(--heat-0); }
.heat-1 { background: var(--heat-1); } .heat-2 { background: var(--heat-2); } .heat-3 { background: var(--heat-3); } .heat-4 { background: var(--heat-4); } .heat-5 { background: var(--heat-5); }
.heat-axis { margin: 6px 0 0 34px; font-size: 12px; }
.heat-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.heat-key span + i { margin-left: 4px; }
.heat-key i { width: 14px; aspect-ratio: 1; flex: none; }
.heat-key i:last-of-type { margin-right: 4px; }
@media (max-width: 650px) { .heat-grid { grid-template-columns: 30px repeat(12, minmax(0, 1fr)); gap: 2px; } .heat-hour, .heat-day { font-size: 10.5px; } .heat-axis { margin-left: 30px; } }

/* ============================================================================
   Batch 33 (27 Oct 2026, Ryan 23:24 "contact cards look weak", Fable owns the
   design - artifacts/dogspa-client-fable/DESIGN-NOTES.md, direction B
   "Record sheet"). Client record: white header band (person tile, name,
   contact, consent tags, actions, four at-a-glance stat tiles), compact dog
   cards, one merged Visits card. Tokens: existing :root only; no new colour.
   Sits inside the Design-C shell (batch 27): on desktop the band runs edge to
   edge under the page top like the shell's own page-header band.
   ========================================================================== */
/* Record headers share the shell’s zero top inset at every breakpoint. */
:root { --main-top: 0px; }
.record-head { background: var(--white); border: 1px solid var(--hairline); border-width: 0 0 1px; margin: calc(-1 * var(--main-top)) calc(-1 * var(--gutter)) 14px; padding: 14px var(--gutter); display: grid; gap: 14px; min-width: 0; }
@media (min-width: 900px) {
  .record-head { margin-bottom: 20px; padding: 22px var(--gutter) 18px; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .record-head .record-stats { grid-column: 1 / -1; }
}
.person-tile { display: grid; place-items: center; border-radius: 14px; background: var(--blue-tint); color: var(--link); font-family: var(--display); font-weight: 600; line-height: 1; flex: none; box-sizing: border-box; }
.record-identity { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.record-identity-text { min-width: 0; display: grid; gap: 4px; }
/* Item 6: the client record's own name heading is now h2 - the page's one
   true h1 is the (phone-hidden) pageHeader() title, carrying the new back
   control (DESIGN-ADDENDUM.md §6.3's /clients/:id row). Selector widened to
   keep this unchanged visually; nothing else targets h1 here. */
.record-head h1, .record-head h2 { font-size: 23px; line-height: 1.3; overflow-wrap: anywhere; }
@media (min-width: 900px) { .record-head h1, .record-head h2 { font-size: 26px; } }
.record-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; margin: 0; font-size: 15px; min-width: 0; }
.record-contact .phone-link { min-height: 40px; }
.record-contact .phone-link-lg { font-size: 18px; }
.record-contact .unset { display: inline-flex; align-items: center; min-height: 36px; }
.mail-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--ink-soft); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.mail-link svg { width: 17px; height: 17px; flex: none; }
.mail-link:hover { color: var(--link); text-decoration: underline; }
.record-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.record-tags .pill svg { width: 13px; height: 13px; }
.record-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.record-actions .btn { min-width: 0; }
.record-actions .btn:first-child, .record-actions .btn:nth-child(2):nth-last-child(3) { grid-column: 1 / -1; }
.record-actions .btn:first-child { min-height: 46px; }
.record-actions .btn.ghost { padding: 0 10px; font-size: 14.5px; gap: 6px; }
.record-actions .btn.ghost svg { width: 17px; height: 17px; flex: none; }
.record-actions .btn.ghost span { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) {
  .record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .record-actions .btn, .record-actions .btn:first-child { min-height: 40px; }
}
.record-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .record-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.record-stats li { min-width: 0; display: grid; gap: 2px; align-content: start; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--cool); }
.record-stats li.is-next { background: var(--wash); border-color: var(--blue-tint); }
.stat-k { font: 700 11.5px/1.2 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.stat-v { font: 600 18px/1.15 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.record-stats li.is-empty .stat-v { color: var(--ink-soft); font-weight: 500; }
.stat-s { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.stat-s a { font-weight: 600; }

/* Dogs section title holds the Add dog action; dog grid is 2-up from 1280. */
.client-section-title { align-items: center; }
.client-section-title .btn.xs { min-height: 36px; gap: 6px; }
.client-section-title .btn.xs svg { width: 16px; height: 16px; }
.archived-dogs { margin-top: 12px; }
.archived-dogs > summary { list-style: none; cursor: pointer; }
.archived-dogs > summary::-webkit-details-marker { display: none; }

/* Compact dog card: cool header band, pills, facts, visits, photos, footer. */
.dog-card { gap: 10px; }
.dog-card > .dog-card-head { margin: calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad)) 0; padding: 12px var(--card-pad); gap: 12px; background: var(--cool); border-bottom: 1px solid var(--hairline); border-radius: calc(var(--radius-soft) - 1px) calc(var(--radius-soft) - 1px) 0 0; }
.dog-card .dog-card-title h2 { font-size: 19px; margin:0; }
.dog-card .dog-edit { margin-left: auto; width: 40px; height: 40px; color: var(--ink-soft); flex: none; }
.dog-card .dog-edit svg { width: 20px; height: 20px; }
.dog-card .dog-edit:hover { color: var(--ink); background: var(--wash); }
.dog-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dog-pills .pill { min-height: 26px; white-space: normal; text-align: left; line-height: 1.25; padding: 3px 10px; }
.dog-pills .pill svg { width: 13px; height: 13px; flex: none; }
.dog-facts { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14.5px; }
.dog-facts span { display: inline-flex; gap: 6px; align-items: baseline; }
.dog-facts i { font: 700 11px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-style: normal; }
.dog-facts.is-empty { color: var(--ink-soft); font-size: 14px; gap: 10px; align-items: center; }
.dog-facts.is-empty a { font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.dog-notes { margin: 0; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.dog-visits { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.dog-visits svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.dog-visits b { color: var(--ink); font-weight: 600; }
.dog-card .dog-gallery { margin-top: 0; }
.dog-card .dog-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
/* Empty gallery (the add label is the grid's only child): one calm row. */
.dog-gallery-grid:has(> .dog-gallery-add:only-child) { display: flex; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) > .dog-gallery-add { flex: 1 1 auto; flex-direction: row; aspect-ratio: auto; width: auto; justify-content: flex-start; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--hairline); background: var(--cool); color: var(--ink-soft); font-size: 14px; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) > .dog-gallery-add:hover, .dog-gallery-grid:has(> .dog-gallery-add:only-child) > .dog-gallery-add:focus-within { border-color: var(--ink-40); background: var(--cool); }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) .gallery-add-icon, .dog-gallery-grid:has(> .dog-gallery-add:only-child) .gallery-add-sub { display: none; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) .gallery-add-empty { flex: 1 1 auto; text-align: left; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) .gallery-add-text { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--white); color: var(--ink); font-size: 14px; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) > .dog-gallery-add:hover .gallery-add-text { background: var(--ink); color: #fff; border-color: var(--ink); }
.gallery-add-empty-icon { display: none; }
.dog-gallery-grid:has(> .dog-gallery-add:only-child) .gallery-add-empty-icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.gallery-add-empty { display: none; }
.dog-gallery:has(> .dog-gallery-grid > .dog-gallery-add:only-child) .dog-gallery-hint { display: none; }
.dog-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.dog-card-actions .btn.sm { min-height: 40px; min-width: 0; }
.dog-card-actions .btn.sm svg { width: 16px; height: 16px; }
.textlink.quiet { min-height: 36px; font-size: 14px; font-weight: 600; color: var(--ink-soft); text-decoration-color: transparent; cursor: pointer; }
.textlink.quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
/* Secondary dog-card actions (Move/Merge/Archive) as one right-aligned,
   gap-matched group instead of each item fighting for its own margin
   (Theo review, 16 Nov 2026: Archive's own margin-left:auto broke once
   Move and Merge sat beside it, forcing a ragged extra row). */
.dog-card-secondary { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }

/* Visits card: Upcoming and History in one card, older visits behind a disclosure. */
.visits-sub { font: 700 11.5px/1.2 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 2px; }
.rows.tight + .visits-sub, .visits-none + .visits-sub { margin-top: 14px; }
.visits-none { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.visits-more > summary { list-style: none; }
.visits-more > summary::-webkit-details-marker { display: none; }
/* Client record: visit history entry (Fable, 4 Nov 2026). Avatar column +
   stacked body. Reuses .rows li separators, .dog-pic avatars, .pill status
   colours, .visit-note-body clamp, .btn.xs actions. */
.rows li.visit-entry { align-items: flex-start; justify-content: flex-start; gap: 12px; padding: 14px 0; }
.rows li.visit-entry > .dog-pic { margin-top: 2px; }
.visit-entry-body { display: grid; gap: 6px; min-width: 0; flex: 1 1 auto; }
.visit-entry-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.visit-entry-when > b { overflow-wrap: normal; word-break: normal; }
.rows li .visit-entry-when b { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.visit-entry-price { flex: none; margin-left: auto; font: 600 15px/1.2 var(--display); color: var(--ink); white-space: nowrap; }
.rows li .visit-entry-what { margin: 0; font-size: 14.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.rows li .visit-entry-what strong { color: var(--ink); font-weight: 600; }
.rows li .visit-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 14px; color: var(--ink-soft); }
.rows li .visit-entry-meta .pill { white-space: nowrap; }
.visit-entry-note { display: grid; gap: 4px; margin-top: 2px; padding: 10px 12px; background: var(--cool); border: 1px solid var(--hairline); border-radius: 10px; }
.visit-entry-note-k { font: 700 11px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.visit-entry-note .visit-note-body { font-size: 14px; line-height: 1.45; color: var(--ink); }
.visit-entry-note .visit-note-body.is-shouty { text-transform: lowercase; }
.visit-entry-note .visit-note-body.is-shouty::first-letter { text-transform: uppercase; }
.visit-entry-note .visit-entry-more { justify-self: start; min-height: 32px; }
.visit-entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
/* Household group: no avatar, members indented under the group line. */
.visit-entry-group .visit-entry-members { margin-top: 6px; border-top: 1px solid var(--hairline); }
.visit-entry-group .visit-entry-members li.visit-entry { padding: 12px 0; }
.visit-entry-group .visit-entry-members li.visit-entry:last-child { padding-bottom: 0; }
@media (max-width: 479px) {
  .rows li.visit-entry > .dog-pic { width: 40px !important; height: 40px !important; }
  .visit-entry-when { flex-wrap: wrap; gap: 2px 10px; }
  .visit-entry-actions .btn.xs { flex: 0 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .visit-entry-note .visit-note-body { transition: max-height .2s var(--ease); }
}
.card-head .textlink.sm { min-height: 32px; font-size: 14px; }
/* Client record tiles are links, with the existing cool tile surface. */
.record-stats li:has(.stat-tile) { padding: 0; }
.record-stats .stat-tile { position: relative; display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 100%; padding: 10px 24px 10px 12px; color: inherit; text-decoration: none; border-radius: 12px; }
.record-stats .stat-tile:hover { background: var(--blue-tint); }
.record-stats .stat-tile:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.record-stats .stat-s { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere;  }
.record-stats .stat-chevron { position: absolute; top: 9px; right: 10px; color: var(--ink-soft); font-size: 22px; line-height: 1; }
.record-visit-dialog { max-width: min(440px, calc(100vw - 32px)); width: 100%; padding: 0; border: 0; border-radius: var(--radius-soft); box-shadow: 0 18px 60px #0004; }
.record-visit-dialog::backdrop { background: #0008; }
.record-visit-dialog .card { margin: 0; }
#dogs-section, #visits-card { scroll-margin-top: 20px; }

/* Batch 27 - approved Design C: Studio rail. Uses the established shell
   markup and palette; the logo remains square at every breakpoint. */
.person-chip { display:inline-flex; align-items:center; gap:9px; min-height:44px; padding:4px 8px 4px 4px; border:0; border-radius:10px; background:transparent; color:var(--ink); cursor:pointer; text-align:left; }
.person-chip:hover { background:var(--cool); }
.person-avatar { width:34px; height:34px; display:grid; place-items:center; flex:none; border-radius:50%; background:var(--blue-tint); color:var(--link); font:700 14px/1 var(--display); }
.person-text { display:flex; flex-direction:column; min-width:0; line-height:1.15; }
.person-name { overflow:hidden; color:var(--ink); font:600 14px/1.15 var(--text); text-overflow:ellipsis; white-space:nowrap; }
.person-role { color:var(--ink-soft); font:400 12px/1.2 var(--text); white-space:nowrap; text-transform:capitalize; }
.person-caret { margin-left:auto; color:var(--ink-soft); display:grid; place-items:center; width:24px; height:24px; flex:none; }
.person-caret svg { width:16px; height:16px; transform:rotate(-90deg); }
@media (min-width:900px) {
  :root { --bar-h:0px; --rail-w:84px; }
  body:has(> .appbar):not(.no-chrome) { padding-left:var(--rail-w); }
  .appbar { position:fixed; inset:0 auto 0 0; width:var(--rail-w); background:var(--white); border-right:1px solid var(--hairline); }
  .appbar::after { display:none; }
  .appbar .bar { display:flex; flex-direction:column; align-items:stretch; height:100%; padding:12px 10px 10px; gap:12px; }
  .brand { justify-content:center; padding:0; }
  .brand > span { display:none; }
  .brand img { width:40px; height:40px; border-radius:0; }
  .page-title-bar { display:none; }
  .appnav { display:flex; flex-direction:column; gap:2px; margin:0; }
  .appnav a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:52px; margin:0; padding:7px 4px 6px; border:0; border-radius:9px; color:var(--ink-soft); font-size:10.5px; letter-spacing:.01em; }
  .appnav a svg { width:22px; height:22px; }
  .appnav a:hover { border:0; background:var(--cool); color:var(--ink); }
  .appnav a[aria-current="page"] { border:0; background:var(--wash); color:var(--ink); }
  .appnav a[aria-current="page"] svg { color:var(--link); }
  .rail-primary .new-booking { display:inline-flex; width:100%; min-height:44px; padding:0; justify-content:center; font-size:0; border-radius:10px; }
  .rail-primary .new-booking svg { width:20px; height:20px; }
  .rail-primary .new-booking span { display:none; }
  .rail-spacer { flex:1 1 auto; min-height:0; }
  .bar-actions { display:flex; flex-direction:column; align-items:stretch; gap:10px; margin-left:0; padding-top:10px; border-top:1px solid var(--hairline); }
  .bar-actions .account-control { display:block; }
  .bar-actions .person-chip { width:100%; justify-content:center; padding:4px 0; }
  .bar-actions .person-text, .bar-actions .person-caret { display:none; }
  /* Notifications v1.2: this sidebar is where the bell wrongly lived
     (bottom-left, dropdown clipped into the corner) - at this width the
     bell moves to the top-right of the content column instead (see
     .page-header-bell below), so the sidebar copy is hidden, not removed
     (keeps one DOM node per breakpoint, same markup/JS as phone/tablet). */
  .bar-bell { display:none; }
  #account-menu { max-width:360px; }
  .sticky-bar { top:0; }
}
@media (min-width:1280px) {
  :root { --rail-w:232px; }
  .appbar .bar { padding:14px 12px 12px; gap:14px; }
  .brand { justify-content:flex-start; gap:10px; padding:2px 4px; }
  .brand > span { display:block; }
  .brand strong { font-size:17.5px; }
  .brand span span { font-size:12.5px; }
  .appnav a { flex-direction:row; justify-content:flex-start; gap:12px; min-height:42px; padding:0 12px; font-size:15px; }
  .appnav a svg { width:20px; height:20px; }
  .rail-primary .new-booking { padding:0 14px; gap:8px; font-size:15px; }
  .rail-primary .new-booking span { display:inline; }
  .bar-actions .person-chip { justify-content:flex-start; padding:4px; }
  .bar-actions .person-text, .bar-actions .person-caret { display:flex; }
}
/* 2026-11-04-ryan-batch/DESIGN.md §1 ("Breakpoint", Decision D6): the old
   900-1279px single-column override above (compact-rail-era workaround)
   directly fought the sticky-at-900 fix - it force-hid .staff-list-card on
   the detail route in exactly the band the two-column grid is meant to
   cover, leaving a zero-size, unreachable list (measured: display:none,
   an empty rect) at 900-1279px. Removed; the two-column
   `.staff-grid { grid-template-columns: 280px minmax(0,1fr) }` base rule
   and the sticky rule above now apply uninterrupted from 900px, exactly
   the "odd 900-1279 band" §1 says this decision removes. */
@media (max-width:899px) {
  /* B39A: this used to hardcode height:56px here without updating --bar-h
     (still 52px from the :root default), so every sticky bar's `top:
     var(--bar-h)` offset (and .grid-diary .gh's) stuck 4px short of the
     app bar's real height. Set --bar-h itself so .appbar .bar's own
     height:var(--bar-h) rule (line ~211) and every sticky offset agree. */
  :root { --bar-h: 56px; }
  .appbar { background:var(--white); }
  .appbar .bar { gap:12px; }
  .brand img { width:34px; height:34px; border-radius:0; }
  .bar-actions { margin-left:auto; }
  .rail-primary, .rail-spacer { display:none; }
  .person-chip { min-width:44px; padding:0; justify-content:center; border-radius:50%; }
  .person-text, .person-caret { display:none; }
  .tabbar { --tab-h:62px; background:var(--white); border-top-color:var(--hairline); }
  .tabbar a { min-height:62px; gap:3px; padding-top:4px; font-size:11px; }
  .tabbar a::before { display:none; }
  .tabbar a svg { width:22px; height:22px; }
  .tabbar a[aria-current="page"] { color:var(--ink); }
  .tabbar a[aria-current="page"] svg { color:var(--link); }
  .tabbar[data-centered-book="true"] a[href^="/book"] svg { width:52px; height:30px; padding:5px 15px; border-radius:999px; background:var(--ink); color:#fff; box-sizing:content-box; }
  main { padding-bottom:calc(24px + 62px + env(safe-area-inset-bottom,0)); }
}


/* Shared positioning for appointment, block and empty-slot children. */
.diary-position .ev { inset:0; display:block; height:100%; padding:6px 8px 6px 9px; border-left-width:4px; overflow:hidden; text-decoration:none; color:var(--ink); }
/* B39 appointment-tile system - integrated shared stylesheet (Fable, 28 Oct 2026).
   Loaded AFTER public/css/app.css. Every rule here is the proposed replacement for
   the .diary-position:is([data-appt-id], [data-appointment-preview]) / .ev tile rules in app.css (lines ~736-927, 1958, 2096-2131,
   2193-2201). Tokens are the existing ones only: --ink, --ink-soft, --cool, --wash,
   --rule, --hairline, --drop-no (the one authorised red), --display, --text.
   The builder copies the rules marked [BUILD] into app.css and deletes the rules
   listed in SPEC.md "Rules to delete". Nothing here is a new colour. */

/* ---------- 0. Container + tile frame [BUILD] ---------- */
/* Both axes: width tier (lane width) AND height tier (duration) are read with
   container queries, so no JS has to guess what fits. */
.diary-position:is([data-appt-id], [data-appointment-preview]) { container-type: size; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev {
  --head: 44px;                 /* dog head box, overwritten per tier below */
  --band: 0px;                  /* warning band height, 0 unless .has-warning */
  position: absolute; inset: 0; display: block; height: 100%; box-sizing: border-box;
  padding: 5px 8px 5px 9px; overflow: hidden; border-radius: 10px;
  background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--accent, var(--input-border));
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.25;
  box-shadow: 0 1px 2px #14253a14; transition: box-shadow .15s var(--ease);
}
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main { -webkit-touch-callout:none; -webkit-user-drag:none; user-select:none; -webkit-user-select:none; display: block; height: 100%; min-width: 0; color: inherit; text-decoration: none; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
/* Head: dogAvatar() markup with .ev-pic spliced on (unchanged in diary.ts). Shown at EVERY size and view. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic { display: block; position: absolute; top: calc(5px + var(--band)); right: 6px; width: var(--head); height: var(--head); border-radius: 8px; overflow: hidden; pointer-events: none; z-index: 0; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic.dog-pic-icon { background: #fff; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic.dog-pic-initials { display:grid; place-items:center; line-height:1; font-size: calc(var(--head) * .36); }
/* Text stack */
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-time-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-time { display: block; font: 600 12.5px/1.3 var(--text); color: var(--ink-soft); letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* line-height 1.45, not the 1.25 the other tile text uses: Besley's own glyph
   metrics (descenders) need the extra headroom at every font-size this rule
   cascades to, or the name clips mid-glyph inside its own line box even on
   tall cards (Ryan 3 Nov: "Fenrir"/"Lily" text cut through mid-glyph). */
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-dog { display: block; margin-top: 1px; font: 600 16px/1.6 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-client, .diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-service, .diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-staff { display: block; font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-staff { color: var(--ink-soft); font-weight: 600; }
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-state { display: none; font: 600 12.5px/1.35 var(--text); color: var(--ink-soft); }
.diary-position:is([data-appt-id], [data-appointment-preview], [data-block-id]) .ev-linked { display: inline-flex; align-items: center; gap: 3px; margin: 2px 0 1px; background: var(--wash); color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 0 6px 0 5px; font: 600 10.5px/1.6 var(--text); white-space: nowrap; width: max-content; }
/* Status pill: only non-default states (confirmed / arrived / no_show). Booked AND Done never show a pill. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-status { display: none; flex: 0 0 auto; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink); font: 600 11px/1.5 var(--text); white-space: nowrap; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.confirmed .ev-status { background: var(--wash); }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.arrived .ev-status { background: var(--blue); border-color: var(--blue); }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.booked .ev-status, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.done .ev-status { display: none !important; }
/* Safety cues (existing .ev-cue markup) only live inside the warning band / open card, never as floating pills. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-cue { display: none; }
/* States. DONE (Ryan addendum 15:03): the WHOLE tile reads finished - paper-grey fill, hairline
   border, groomer stripe faded to 45%, greyscale head, and muted text. Name + time use --ink-soft
   (6.9:1 on --paper, AA) and the secondary lines --placeholder (5.6:1 on --paper, AA). Exactly the
   same when open, so hover never "wakes" a finished visit. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.arrived { background: var(--wash); }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev:hover, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:focus-within { box-shadow: 0 6px 18px #14253a2e; }

 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.now { background:color-mix(in srgb,var(--drop-ok) 22%,#fff); border-color:color-mix(in srgb,var(--drop-ok) 55%,#fff); border-left-color:var(--accent,var(--input-border)); }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.no_show { border-left-color:var(--drop-no); background:color-mix(in srgb,var(--drop-no) 10%,var(--cool)); color:var(--ink-soft); }
/* ---------- 1. Warning band [BUILD] ---------- */
/* ONE treatment at every size: a red band along the tile's top edge that carries the
   "!" glyph (shape + text, so it is never colour-only), a 7% red tint on the tile and a
   red outline. The head always sits BELOW the band (top offset includes --band), so the
   band can never cover it. Content grows with room: "!" glyph alone -> "! Warning" (wide tier and open card).
   The open card adds the full warning sentence as a text line (.ev-alert) under the name. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning { --band: 14px; border-color: var(--drop-no); background: color-mix(in srgb, var(--drop-no) 7%, #fff); }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-band { position: absolute; top: 0; left: 0; right: 0; height: var(--band); display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; background: var(--drop-no); color: #fff; font: 700 10px/1 var(--text); letter-spacing: .02em; white-space: nowrap; overflow: hidden; z-index: 2; pointer-events: none; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-band svg { width: 10px; height: 10px; flex: none; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-band .ev-band-word { display: none; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning .ev-main { padding-top: var(--band); }

/* ---------- 2. Width tiers [BUILD] ---------- */
/* Tier S "sliver"  <42px   : head only (a 10px "09:00–" line needs 34px of inner width, so time is deliberately hidden here, never clipped).
   Tier N "stacked" 42-139px: head centred, then time (wraps after the en dash), then name if height allows.
   Tier W "wide"    >=140px : head top-right, text column left (time row, name, client, service, staff). */

/* Tier S + N share the stacked layout */
@container (max-width: 139px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { padding: 3px 2px 3px 3px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main { display: flex; flex-direction: column; align-items: center; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic { position: static; flex: none; margin: 0 auto; order: -1;   /* head sits ABOVE the time, as on the served narrow tiles Ryan liked */
    /* fits the lane width, never larger than 40, and shrinks with height so the time line is never pushed off the bottom */
    --head: min(clamp(8px, calc(100cqw - 11px), 40px), calc(100cqh - var(--band) - var(--stack-h, 0px) - 8px)); }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time-row { display: none; justify-content: center; width: 100%; margin-top: 2px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time { white-space: normal; text-align: center; font: 700 10px/1.2 var(--text); letter-spacing: 0; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-dog { display: none; width: 100%; text-align: center; font-size: 12.5px; line-height: 1.4; margin-top: 1px; padding-bottom:2px; flex-shrink:0; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-status, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-client, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-service, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-staff, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-linked { display: none; }
}
/* Same sliver guard as the wide tier's 24px step: the --head formula above
   has no floor, so a 15/30-min narrow tile shrinks the avatar to a sliver
   instead of hiding it. Below 24px tall, drop it so the centred time/name
   stack gets the full box instead of fighting a near-invisible head. */
@container (max-width: 139px) and (max-height: 24px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic { display: none; }
}
/* Tier N: time appears from 60px tall; name from 96px tall (and only if it fits horizontally, see data-name-fit). */
@container (min-width: 42px) and (max-width: 139px) and (min-height: 60px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { --stack-h: 24px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time-row { display: flex; }
}
@container (min-width: 42px) and (max-width: 139px) and (min-height: 96px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { --stack-h: 40px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):not([data-name-fit="no"]) .ev-dog { display: block; }
  .diary-position:is([data-appt-id], [data-appointment-preview])[data-name-fit="tight"] .ev-dog { font-size: 11px; }   /* one shrink step before hiding (fitNames) */
}
@container (min-width: 60px) and (max-width: 139px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-dog { font-size: 13.5px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time { font-size: 11px; }
}
/* Tier W. Lanes of 140-199px (a 1-lane all-staff week column at 1440 is 151px) use a 36px head so
   the text column keeps >= 100px; from 200px (day-view columns) the head is the full 44px. */
@container (min-width: 140px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { --head: 36px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main { padding-right: calc(var(--head) + 10px); }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time-row { display: flex; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-dog { display: block; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.confirmed .ev-status, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.arrived .ev-status, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.no_show .ev-status { display: inline-block; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-client, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-service, .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-staff { display: none; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-band .ev-band-word { display: inline; }
}
@container (min-width:140px) and (max-width:199px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time { font-size:11px; letter-spacing:0; } }
/* Tier W height steps: under 48px tall = one line (time + name side by side, small head).
   A warning tile loses 14px to the band, so the one-line layout holds until 61px there. */
@container (min-width: 200px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { --head: 44px; } }
@container (min-width: 140px) and (max-height: 47px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { --head: min(28px, calc(100cqh - 8px)); padding-top: 3px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main { display: flex; align-items: baseline; gap: 6px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time-row { flex: none; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-dog { margin: 0; font-size: 14.5px; flex: 1 1 auto; }
}
/* 15/30-min tiles at the default fitted scale (Ryan 3 Nov, Week Nelly Mon 9
   Nov and Day Nelly Fri 6 Nov): --head's "shrink with height" formula above
   has no floor, so under ~24px it shrinks the avatar to an unreadable
   sliver instead of hiding it, and the still-visible single line needs
   every spare px to stay legible. Below 24px: drop the avatar outright,
   shrink the padding and type one notch further, so the time+name line
   stays one clean, un-clipped row instead of fighting a vestigial head. */
@container (min-width: 140px) and (max-height: 24px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { padding: 1px 4px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-pic { display: none; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-main { padding-right: 0; gap: 5px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-time { font-size: 10.5px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-dog { font-size: 11px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-status { display: none !important; }
}
@container (min-width: 140px) and (max-height: 61px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning { --head: min(28px, calc(100cqh - var(--band) - 8px)); padding-top: 3px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning .ev-main { display: flex; align-items: baseline; gap: 6px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning .ev-time-row { flex: none; }
  .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning .ev-dog { margin: 0; font-size: 14.5px; flex: 1 1 auto; }
}
/* Name-fit result (fitNames(), SPEC.md section 4): a name that cannot fit its lane at rest is
   hidden rather than reduced to "Ha…". The open card always shows it. */
.diary-position:is([data-appt-id], [data-appointment-preview])[data-name-fit="no"]:not(:hover, :focus-within, .is-open) .ev .ev-dog { display: none; }
/* Tier W optional lines, in order client -> service -> staff. Thresholds are the stack height
   (time 16 + name 21 + 17 per line + 12 frame) rounded up to the next quarter-hour step so a
   line is only ever fully visible or absent, never cut by the bottom edge. A warning band
   costs 14px and a "2 dogs" chip 20px, so those variants wait for the next step. */
@container (min-width: 140px) and (min-height: 66px)  { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-client { display: block; } }
@container (min-width: 140px) and (min-height: 84px)  { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-service { display: block; } }
@container (min-width: 140px) and (min-height: 102px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 80px)  { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-client { display: block; } }
@container (min-width: 140px) and (min-height: 98px)  { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-service { display: block; } }
@container (min-width: 140px) and (min-height: 116px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 86px)  { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-client { display: block; } }
@container (min-width: 140px) and (min-height: 104px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-service { display: block; } }
@container (min-width: 140px) and (min-height: 122px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 100px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-client { display: block; } }
@container (min-width: 140px) and (min-height: 118px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-service { display: block; } }
@container (min-width: 140px) and (min-height: 136px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-staff { display: block; } }
/* Chip ("2 dogs") only where there is a name row to sit under: Tier W from 66px tall. */
@container (min-width: 140px) and (min-height: 66px) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group .ev-linked { display: inline-flex; } }
/* All-staff week overview keeps tiles to time + dog + groomer (existing rule, unchanged intent): the staff line is the FIRST optional line there. */
.grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-client, .grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev-service { display: none !important; }
@container (min-width: 140px) and (min-height: 66px)  { .grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 80px)  { .grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 86px)  { .grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-staff { display: block; } }
@container (min-width: 140px) and (min-height: 100px) { .grid-diary.week-grid.all .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-staff { display: block; } }

/* Extra-wide booking cards: details share a row BELOW the time and dog heading.
   Actual card size drives this, so narrow multi-groomer lanes retain their existing tiers. */
@container (min-width:560px) and (min-height:62px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:15px 20px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-time-row { grid-column:1 / -1; grid-row:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-time { font-size:12px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-dog { grid-column:1 / -1; grid-row:2; margin:0; line-height:20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:3; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-staff { grid-column:3; }
}
@container (min-width:560px) and (min-height:76px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:15px 20px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-time-row { grid-column:1 / -1; grid-row:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-time { font-size:12px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-dog { grid-column:1 / -1; grid-row:2; margin:0; line-height:20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:3; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-staff { grid-column:3; }
}
@container (min-width:560px) and (min-height:82px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:15px 20px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-time-row { grid-column:1 / -1; grid-row:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-time { font-size:12px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-dog { grid-column:1 / -1; grid-row:2; margin:0; line-height:20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:3; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-staff { grid-column:3; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-main { grid-template-rows:15px 20px minmax(15px,1fr) 20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-linked { grid-column:1 / -1; grid-row:4; justify-self:start; }
}
@container (min-width:560px) and (min-height:96px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:15px 20px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-time-row { grid-column:1 / -1; grid-row:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-time { font-size:12px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-dog { grid-column:1 / -1; grid-row:2; margin:0; line-height:20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:3; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-staff { grid-column:3; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-main { grid-template-rows:15px 20px minmax(15px,1fr) 20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-linked { grid-column:1 / -1; grid-row:4; justify-self:start; }
}

/* Wide but short tiles keep time + name in the heading row, details beneath. */
@container (min-width:560px) and (min-height:46px) and (max-height:61px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:18px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-time-row { grid-column:1 / -1; grid-row:1; width:max-content; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-time { font-size:12px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-dog { grid-column:1 / -1; grid-row:1; margin:0 0 0 112px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:2; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev:not(.has-warning, .has-group) .ev-staff { grid-column:3; }
}
@container (min-width:560px) and (min-height:60px) and (max-height:75px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:18px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-time-row { grid-column:1 / -1; grid-row:1; width:max-content; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-time { font-size:12px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-dog { grid-column:1 / -1; grid-row:1; margin:0 0 0 112px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:2; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-warning:not(.has-group) .ev-staff { grid-column:3; }
}
@container (min-width:560px) and (min-height:66px) and (max-height:81px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:18px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-time-row { grid-column:1 / -1; grid-row:1; width:max-content; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-time { font-size:12px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-dog { grid-column:1 / -1; grid-row:1; margin:0 0 0 112px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:2; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-staff { grid-column:3; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-main { grid-template-rows:18px minmax(15px,1fr) 20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group:not(.has-warning) .ev-linked { grid-column:1 / -1; grid-row:3; justify-self:start; }
}
@container (min-width:560px) and (min-height:80px) and (max-height:95px) {
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-main { display:grid; max-width:720px; grid-template-columns:minmax(110px,160px) minmax(180px,360px) minmax(65px,100px); grid-template-rows:18px 19px; column-gap:16px; align-content:start; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-time-row { grid-column:1 / -1; grid-row:1; width:max-content; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-time { font-size:12px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-dog { grid-column:1 / -1; grid-row:1; margin:0 0 0 112px; line-height:18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning :is(.ev-client,.ev-service,.ev-staff) { display:block; grid-row:2; min-width:0; margin:0; align-self:center; font-size:12.5px; line-height:15px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-client { grid-column:1; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-service { grid-column:2; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-staff { grid-column:3; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-main { grid-template-rows:18px minmax(15px,1fr) 20px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]) .ev.has-group.has-warning .ev-linked { grid-column:1 / -1; grid-row:3; justify-self:start; }
}

/* ---------- 3. Open card (hover / keyboard focus) [BUILD] ---------- */
/* ONE layout for every source tile: the Tier W layout, height auto, min-width 240px, all
   lines on. Written after the container blocks and with higher specificity so it wins
   whatever the resting lane size was. `.is-open` is the QA hook (Playwright can add it). */
@media (hover: hover) and (min-width: 651px) {
  .grid-diary .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) { z-index: 20; }
 @container (max-width:559px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev { bottom: auto; height: auto; min-height: 100%; min-width: min(240px, calc(100vw - 80px)); padding: 6px 8px 8px 9px; --head: 44px; box-shadow: 0 6px 18px #14253a2e; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev.booked { background: #fff; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev.has-warning { --band: 18px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-main { display: block; height: auto; padding-right: 54px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-pic { position: absolute; top: calc(6px + var(--band)); right: 6px; margin: 0; width: 44px; height: 44px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-time-row { display: flex; justify-content: space-between; width: auto; margin: 0; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-time { white-space: nowrap; text-align: left; font: 600 12.5px/1.3 var(--text); }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-dog { display: block; width: auto; text-align: left; margin-top: 1px; font-size: 16px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .grid-diary .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev :is(.ev-client, .ev-service, .ev-staff) { display: block !important; white-space: normal; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-linked { display: inline-flex; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev.done .ev-state { display: inline; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev:is(.confirmed, .arrived, .no_show) .ev-status { display: inline-block; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-band { font-size: 11px; justify-content: flex-start; padding: 0 9px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-band svg { width: 12px; height: 12px; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-band .ev-band-word { display: inline; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev.now::before { display: none; }
 }
 /* The @container gate above only fires in narrow lanes. A short (compact/brief)
    card is tiny because of its *height*, not the lane width - a wide single-groomer
    column still clips a 15-min booking - so the same open-card layout must also
    fire by card height alone, regardless of lane width. */
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev { bottom: auto; height: auto; min-height: 100%; min-width: min(240px, calc(100vw - 80px)); padding: 6px 8px 8px 9px; --head: 44px; box-shadow: 0 6px 18px #14253a2e; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev.booked { background: #fff; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev.has-warning { --band: 18px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-main { display: block; height: auto; padding-right: 54px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-pic { position: absolute; top: calc(6px + var(--band)); right: 6px; margin: 0; width: 44px; height: 44px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-time-row { display: flex; justify-content: space-between; width: auto; margin: 0; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-time { white-space: nowrap; text-align: left; font: 600 12.5px/1.3 var(--text); }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-dog { display: block; width: auto; text-align: left; margin-top: 1px; font-size: 16px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
 .grid-diary .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev :is(.ev-client, .ev-service, .ev-staff) { display: block !important; white-space: normal; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-linked { display: inline-flex; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev.done .ev-state { display: inline; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev:is(.confirmed, .arrived, .no_show) .ev-status { display: inline-block; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-band { font-size: 11px; justify-content: flex-start; padding: 0 9px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-band svg { width: 12px; height: 12px; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-band .ev-band-word { display: inline; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev.now::before { display: none; }
 /* Both open-card paths above always grow the card to the right (left:6px
    stays pinned, min-width pushes the right edge out) and down (top:0
    stays pinned via the base .diary-position .ev{inset:0}, bottom:auto
    lets height grow). A card in the rightmost column or bottom rows of a
    multi-groomer view then runs off the diary's own scroll viewport, not
    just the window - and since nothing clips the overflow, that growth
    enlarges the diary scroll container's own scrollWidth/scrollHeight,
    popping a scrollbar Ryan can't use (moving the pointer off the card to
    reach it collapses the card and snaps the scroll back). `.clamp-right`/
    `.clamp-bottom` (CARD_EDGE_CLAMP_JS in diary.ts, measured against the
    scroll container's own clientWidth/clientHeight on hover/focus) flip
    the anchor so the card grows leftward/upward instead, staying inside
    the container's current viewport - scrollWidth/scrollHeight never
    change - without shifting any other card or the column layout. */
 .diary-position.clamp-right:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev { left: auto; right: 6px; }
 /* No `.clamp-bottom` rule here for top/bottom: confirmed via
    getComputedStyle (and an isolated minimal repro of the identical
    pattern, which *did* flip correctly) that the vertical flip never
    becomes the used value through this stylesheet - even as the single
    most specific, `!important`, last-in-file declaration - while the
    identical horizontal flip above works every time. CARD_EDGE_CLAMP_JS
    sets `top`/`bottom` inline instead, which reliably wins. `.clamp-bottom`
    is still toggled on `.diary-position` as the test/QA hook. */
}
/* Open-card only: the full warning sentence (never truncated) and the restriction chip
   (.pill.info from app.css). Colour is the existing warning-link red from .notice.strong.alert. */
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-alert { display: none; margin: 1px 0 2px; font: 600 12.5px/1.35 var(--text); color: color-mix(in srgb, var(--drop-no) 82%, black); white-space: normal; overflow-wrap: anywhere; }
.diary-position:is([data-appt-id], [data-appointment-preview]) .ev-safety { display: none; margin: 3px 0 2px; gap: 4px; flex-wrap: wrap; }
@media (hover: hover) and (min-width: 651px) {
 @container (max-width:559px) {
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-alert { display: block; }
  .diary-position:is([data-appt-id], [data-appointment-preview]):is(:hover, :focus-within, .is-open) .ev-safety { display: flex; }
 }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-alert { display: block; }
 .diary-position:is([data-appt-id], [data-appointment-preview]):has(.ev.compact, .ev.brief):is(:hover, :focus-within, .is-open) .ev-safety { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .diary-position:is([data-appt-id], [data-appointment-preview]) .ev { transition: none; } }

/* Floating appointment previews use the shared tile system without becoming
   interactive diary records. Confirmation has its own natural-height layout. */
.diary-position.diary-pending-move { container-type:inline-size; min-height:0 !important; }
.diary-position.diary-pending-move .ev { position:relative; inset:auto; height:auto; min-height:100px; flex:none; }
@media (max-width:899px) {
  .diary-position.diary-pending-move { min-height:0 !important; }
  .diary-position.diary-pending-move .ev { display:none; }
}

@media (min-width:900px) { .diary-position.diary-pending-move { width:280px !important; max-width:calc(100vw - 16px); } }

/* Block cards share booking typography, but fit details to their own footprint. */
.diary-position[data-block-id] { container-type:size; }
.diary-position[data-block-id] .ev.block { box-sizing:border-box; border:1px solid var(--rule); border-left:4px solid var(--rule); border-radius:10px; padding:5px 8px 5px 9px; }
.diary-position[data-block-id] .ev-time { overflow:hidden; text-overflow:ellipsis; }
@container (max-width:139px) {
  .diary-position[data-block-id] .ev.block { padding:3px 4px; }
  .diary-position[data-block-id] .ev-time { font-size:11px; }
  .diary-position[data-block-id] .ev-dog { font-size:13.5px; }
}
@container (max-height:89px) { .diary-position[data-block-id] .ev-staff { display:none; } }
@container (max-height:69px) { .diary-position[data-block-id] .ev-service { display:none; } }
@container (max-height:43px) { .diary-position[data-block-id] .ev-dog { display:none; } }
@container (max-width:89px) { .diary-position[data-block-id] .ev-time { display:none; } }
@container (max-height:27px) { .diary-position[data-block-id] .ev-time { display:none; } }
@container (max-width:59px) { .diary-position[data-block-id] :is(.ev-dog,.ev-service,.ev-staff) { display:none; } }
/* Blocks open on hover / keyboard focus exactly like booking cards (section 3 open card):
   height grows to fit, min-width 240px, every line shown in full. Out-specifies the
   container queries above, which only trim the resting footprint. */
@media (hover: hover) and (min-width: 651px) {
  .grid-diary .diary-position[data-block-id]:is(:hover, :focus-within, .is-open) { z-index: 20; }
  .grid-diary .diary-position[data-block-id]:is(:hover, :focus-within, .is-open) .ev.block { bottom: auto; height: auto; min-height: 100%; min-width: min(240px, calc(100vw - 80px)); padding: 6px 8px 8px 9px; box-shadow: 0 6px 18px #14253a2e; }
  .grid-diary .diary-position[data-block-id]:is(:hover, :focus-within, .is-open) .ev :is(.ev-time, .ev-dog, .ev-service, .ev-staff) { display: block; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .grid-diary .diary-position[data-block-id]:is(:hover, :focus-within, .is-open) .ev .ev-time { font: 600 12.5px/1.3 var(--text); white-space: nowrap; }
  .grid-diary .diary-position[data-block-id]:is(:hover, :focus-within, .is-open) .ev .ev-dog { font-size: 16px; line-height: 1.25; margin-top: 1px; }
}
@media (hover: hover) and (min-width: 651px) and (prefers-reduced-motion: no-preference) { .grid-diary .diary-position[data-block-id] .ev.block { transition: box-shadow .15s ease; } }

/* Shared report chart detail bubble: native hover, keyboard and tap. */
.report-chart-tip { z-index: 100; width: 280px; margin: 0; color: var(--ink); font-size: 14px; line-height: 1.5; pointer-events: none; }
.report-chart-tip[hidden] { display: none; }

/* Shared staff portraits preserve avatar geometry and initials fallback. */
.avatar > img { width:100%; height:100%; border-radius:inherit; object-fit:cover; }
/* Dark identity swatches need light initials; photos remain unchanged. */
.avatar.g1, .avatar.g5, .avatar.g10, .avatar.g11 { color:var(--white); }

.diary-staff-avatar.g0 { --groomer-colour:var(--g0); }
.diary-staff-avatar.g1 { --groomer-colour:var(--g1); }
.diary-staff-avatar.g2 { --groomer-colour:var(--g2); }
.diary-staff-avatar.g3 { --groomer-colour:var(--g3); }
.diary-staff-avatar.g4 { --groomer-colour:var(--g4); }
.diary-staff-avatar.g5 { --groomer-colour:var(--g5); }
.diary-staff-avatar.g6 { --groomer-colour:var(--g6); }
.diary-staff-avatar.g7 { --groomer-colour:var(--g7); }
.diary-staff-avatar.g8 { --groomer-colour:var(--g8); }
.diary-staff-avatar.g9 { --groomer-colour:var(--g9); }
.diary-staff-avatar.g10 { --groomer-colour:var(--g10); }
.diary-staff-avatar.g11 { --groomer-colour:var(--g11); }
.diary-staff-avatar.g12 { --groomer-colour:var(--g12); }

.diary-staff-avatar { box-sizing:border-box; overflow:hidden; padding:0; line-height:1; place-items:center; background:var(--cool); color:var(--ink); border:2px solid var(--groomer-colour, var(--hairline)); }
.diary-staff-avatar > span:not([hidden]) { grid-area:1 / 1; justify-self:center; align-self:center; }
.diary-staff-avatar > img { display:block; min-width:0; min-height:0; width:100%; height:100%; object-fit:cover; grid-area:1 / 1; }
.diary-staff-avatar > span[hidden], .diary-staff-avatar > img[hidden] { display:none; }
/* Short laptop windows: preserve diary time, not desktop-sized chrome.
   Sticky offsets continue to come from the measured controls strip. */
@media (min-width:900px) and (max-width:1279px), (min-width:900px) and (max-height:760px) {
  .diary-workspace .date-nav.sticky-bar { padding-top:4px; padding-bottom:4px; }
  .diary-workspace .grid-diary .gh { padding-top:6px; padding-bottom:6px; }
}
/* Shared desktop diary control scale, including filter pills. */
@media (min-width:900px) {
  .diary-workspace { --diary-control-height:34px; }
  .diary-workspace .date-nav { gap:6px; }
  .diary-workspace .date-nav .groomer-sheet-trigger,
  .diary-workspace .date-nav .btn,
  .diary-workspace .date-nav .segmented a,
  .diary-workspace .date-nav .segmented button { height:var(--diary-control-height); min-height:var(--diary-control-height); padding:0 10px; font-size:13px; }
  .diary-workspace .date-nav > .iconbtn { width:32px; height:36px; min-height:36px; padding:0; }
  .diary-workspace .date-nav input[type="date"] { width:144px; min-height:var(--diary-control-height); height:var(--diary-control-height); padding:0 8px; font-size:13px; }
  .diary-workspace .diary-groomer-picker .chip { height:var(--diary-control-height); min-height:var(--diary-control-height); padding:0 10px; font-size:13px; }
  .diary-workspace .diary-groomer-picker { padding-top:6px; padding-bottom:6px; }
}

/* One compact component scale across the app, including nested panels. */
@media (min-width:900px) and (max-width:1279px), (min-width:900px) and (max-height:760px) {
  main .btn, main .btn.sm, dialog .btn { min-height:36px; padding:6px 10px; font-size:13px; gap:6px; }
  main .segmented a, main .segmented button { min-height:36px; padding:0 10px; font-size:13px; }
  main .chip, main .period-chips .chip { min-height:34px; padding:0 10px; font-size:13px; }
  main .tabs a { min-height:36px; padding:6px 2px; font-size:13px; }
  .grid-diary .gh { font-size:var(--diary-heading-size); }
  .grid-diary .gh .busy-meter, .grid-diary .gh .busy-meter.tl-warn, .grid-diary .gh .busy-meter.tl-good { display:block !important; min-height:0; width:auto; margin-top:3px; padding:0; border-radius:0; background:none; color:var(--ink-soft); font:600 11px/1.2 var(--text); text-align:left; overflow:visible; }
  .grid-diary .gh .busy-meter::before { content:none; }
}

/* Reuse the existing accessible groomer/actions selectors on laptops. */
@media (min-width:900px) and (max-width:1279px), (min-width:900px) and (max-height:760px) {
  .diary-workspace .diary-groomer-picker, .diary-workspace .week-selected-label { display:none !important; }
  .date-nav .diary-header-slot { display:inline-flex; align-items:center; gap:6px; flex:1; }
  .date-nav .groomer-sheet-trigger { display:inline-flex; min-height:36px; padding:0 10px; font-size:13px; border-radius:8px; max-width:220px; }
  .date-nav .groomer-sheet { inset:50% auto auto 50%; transform:translate(-50%,-50%); width:min(420px,calc(100vw - 40px)); max-height:calc(100vh - 64px); border:1px solid var(--hairline); border-radius:var(--radius); }
}

/* Search-style inputs (search box, inbox) use one lighter 1px border,
   matching .inbox-search - not the heavier 2px .field border used by
   ordinary form inputs, which reads as a heavy outline once the search
   box no longer sits inside its own white panel. */
.search-box .search.field input { border-width: 1px; }
@media (min-width:900px) and (max-width:1279px), (min-width:900px) and (max-height:760px) {
  .search-box.toolbar .search.field input { min-height:36px; height:36px; padding-top:0; padding-bottom:0; padding-left:36px; font-size:14px; }
  .search-box .search svg { width:18px; height:18px; left:10px; }
}
/* design/2026-11-04-unified-page-header/DESIGN.md §4.1: .diary-header-
   joined and its whole family (title/actions used to move house at
   >=1100px) are gone - the title and the shared "..." menu are both born
   in the row now via pageHeader(), nothing moves. */


/* Availability is a distinct horizontal multi-day grid, using shared cards and tokens. */
.availability-scroll { overflow-x:scroll; overflow-y:hidden; height:calc(100dvh - 180px); border-top:0; touch-action:pan-x pan-y; }
.availability-grid .availability-day { position:sticky; top:0; z-index:25; background:#fff; border-right:0; padding:4px 10px; height:28px; box-sizing:border-box; font:600 var(--diary-heading-size)/1.3 var(--display); }
.availability-day a { position:sticky; left:68px; color:var(--ink); text-decoration:none; }
.grid-diary.availability-grid .gh { display:flex; position:sticky; top:28px; box-sizing:border-box; align-items:flex-start; padding:4px 8px; gap:0; }
.grid-diary.availability-grid .gcol { display:block; }
.grid-diary.availability-grid .gtimes { position:sticky; left:0; z-index:22; background:var(--white,#fff); }
.grid-diary.availability-grid .corner,.availability-grid .availability-corner { left:0; z-index:30; }




.grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter { display:block !important; width:100%;min-height:16px;margin-top:4px;padding:0;border-radius:999px;background:color-mix(in srgb,var(--busy-bad) 34%,#fff);color:var(--ink);font:700 10px/16px var(--text);text-align:center;overflow:hidden; }
.grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter::before { content:""; }
.grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter.tl-warn { background:color-mix(in srgb,var(--busy-warn) 34%,#fff); }
.grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter.tl-good { color:var(--white);background:var(--busy-good); }
.grid-diary.availability-grid .gh > span { width:100%;min-width:0; }
.grid-diary.availability-grid .gh small .sub-full { display:inline !important; }
.grid-diary.availability-grid .gh small .sub-short { display:none !important; }
.availability-grid .gap-actions { flex-wrap:wrap; }
.slot-search-results .slot-grid { margin-bottom:16px; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
.slot-search-results .slot { padding:8px; }
.slot-search-results .slot small { line-height:1.35; }
.grid-diary.availability-grid .gh .gh-name-full { display:inline; }
.grid-diary.availability-grid .gh .gh-name-short { display:none; }


/* Fitted Availability: measured remaining viewport, same time scale for all geometry. */
main:has(.availability-scroll) { padding-bottom:0; }
.diary-workspace .availability-scroll { margin-inline:calc(-1 * var(--gutter)); }
.diary-workspace:has(.availability-scroll) .date-nav,
.diary-workspace:has(.availability-scroll) .diary-groomer-picker { margin-bottom:0; }
.grid-diary.availability-grid { grid-template-columns: 56px var(--week-edge-width) repeat(calc(var(--cols) - 2),190px) var(--week-edge-width); --week-edge-width: 148px; width: max-content; border: 0; border-radius: 0; box-shadow: none; }
.availability-empty-day { background:var(--cool); padding:12px; color:var(--ink-soft); }
.availability-grid .availability-off-hours { position:absolute; left:0; right:0; background:transparent; pointer-events:none; }
.availability-grid .diary-position { z-index:1; }
.availability-grid .gap-position .ev { overflow:hidden; }
.availability-grid .availability-end-time { position:absolute; bottom:3px; right:8px; color:var(--ink-soft); font:600 12px/1 var(--display); }
.availability-grid .gt { font-size:12px; padding-top:2px; }

/* Compact read-only gallery, sharing photo frames and lightbox. */
.photo-strip { display:flex; gap:10px; overflow-x:auto; padding:3px; margin:18px 0; }
.photo-strip > .photo-frame { flex:0 0 112px; width:112px; aspect-ratio:1; cursor:pointer; }

/* Keep the diary unpainted only during its initial responsive measurements.
   The inline initializer has a bounded fail-open; no-JS pages stay visible. */
.diary-layout-pending .diary-workspace { visibility: hidden; }

/* One continuous blank time gutter above the availability ruler. */
/* Centre settings in the time-gutter cell in every diary layout. */
.grid-diary.day-grid .gh.corner,
.availability-grid .availability-corner { width:calc(100% - 1px); background:#fff; border-right:0; border-bottom:1px solid var(--input-border); padding:0; display:flex; align-items:center; justify-content:center; }
.availability-grid .availability-day.availability-corner { grid-row:1 / span 2; height:auto; align-self:stretch; }
/* The corner settings cog is always a true circle that fits inside the header cell, so its hover state is round and never clipped;
   the ::after keeps a 44px touch target (Ryan, 15 Nov 2026). */
.grid-diary .gh.corner .iconbtn, .availability-corner .iconbtn { width:36px; height:36px; flex:none; border-radius:50%; position:relative; }
.grid-diary .gh.corner .iconbtn::after, .availability-corner .iconbtn::after { content:""; position:absolute; inset:-4px; }
.grid-diary.availability-grid .gh.corner { border-right:0; }

/* Shared large staff identity treatment for contextual action dialogs. */
.staff-avatar-large { display:grid; width:72px; height:72px; font-size:24px; flex:none; }
.slot-summary { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; padding:4px 0 12px; }
.slot-summary p, .slot-summary h2 { margin:0; }

/* Shared diary dialog actions: equal side-by-side primary and cancel. */
.block-popover form > .row:has(> button[type="submit"]), .block-popover .confirm-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:10px; }
.block-popover form > .row:has(> button[type="submit"]) > .btn, .block-popover .confirm-actions > .btn { width:100%; }
.block-popover h2 { margin: 0 0 4px; font-size: 18px; text-align: center; }

/* Shared diary dialog dismissal; uses the established icon button. */
.block-popover.has-dialog-close { padding-top:52px; }
.block-popover .dialog-close { position:absolute; top:8px; right:8px; }
.confirm-popover [data-confirm-body] { white-space:pre-line; text-align:center; margin:6px 0 0; line-height:1.5; text-wrap:pretty; }

.diary-drag-household { display:flex; gap:5px; height:100%; min-height:inherit; }
.diary-drag-household > .diary-position { position:relative; flex:1 1 0; min-width:0; height:100%; }

.diary-drag-ghost.is-warning,.diary-drop-slot.is-warning { border-color:var(--busy-warn); }
.diary-drag-ghost.is-warning .ev { background:color-mix(in srgb,var(--busy-warn) 16%,white)!important; }
.diary-drag-time.is-warning { background:var(--busy-warn); color:var(--ink); }




.diary-pending-move[hidden] { display:none !important; }

/* Shared diary slot action picker: portrait choices and compact primary actions. */
/* Shared picker: fixed portraits, explicit selection, natural wrapping. */
.slot-picker-dialog { width:min(880px, calc(100vw - 48px)); }
.slot-picker-content { display:grid; gap:20px; }
@media (max-width:650px) { .slot-picker-content .slot-summary { padding:0; gap:6px; } }
.slot-picker-section { display:grid; gap:12px; }
.slot-picker-caption { margin:0; text-align:center; font-size:14px; color:var(--ink-soft); }
.slot-staff-picker { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.slot-staff-card { display:flex; flex:0 0 122px; min-width:0; flex-direction:column; align-items:stretch; gap:6px; padding:10px 6px; border:2px solid var(--hairline); border-radius:var(--radius-soft); background:var(--paper); box-sizing:border-box; }
.slot-staff-choice { display:flex; width:100%; flex-direction:column; align-items:center; gap:5px; padding:0; border:0; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.slot-windows { display:grid; gap:4px; }
.slot-window { padding:6px 2px; min-height:32px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--ink-soft); font:inherit; font-size:12px; cursor:pointer; }
.slot-window[aria-pressed="true"] { border-color:var(--drop-ok); background:var(--paper); color:var(--ink); font-weight:700; }
.slot-window:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.slot-staff-choice strong { max-width:100%; overflow-wrap:anywhere; font-size:14px; font-weight:500; line-height:1.35; }
.slot-staff-status { display:inline-block;align-self:center;max-width:100%;padding:3px 7px;border:1px solid var(--hairline);border-radius:999px;background:var(--white);color:var(--ink-soft);font-size:10px;font-weight:400;line-height:1.3;white-space:nowrap; }
.slot-staff-choice .small { font-size:12px; }
.slot-staff-portrait { position:relative; display:block; margin-bottom:3px; }
.slot-staff-choice .staff-avatar-large { width:56px; height:56px; font-size:22px; }
.slot-staff-card[data-selected="true"] { border-color:var(--drop-ok); background:var(--cool); }
.slot-staff-choice[aria-pressed="true"] .slot-staff-portrait::after { content:'✓'; position:absolute; right:-4px; bottom:0; width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:var(--drop-ok); color:var(--white); font-size:12px; }
.slot-staff-choice:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.slot-picker-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.slot-picker-actions > .btn { width:100%; }
.gcol[data-staff-free]:focus-visible { outline:2px solid var(--ink); outline-offset:-2px; }
/* Short windows use the same compact identity treatment in every diary dialog. */
@media (max-height:760px) {
  .block-popover .slot-summary { gap:4px; }
  @media (max-width:650px) { .block-popover .slot-summary { padding-bottom:6px; } }
  .block-popover .slot-summary .staff-avatar-large { width:48px; height:48px; font-size:20px; }
  .block-popover .slot-summary strong { font-size:16px; }
  .block-popover .slot-summary p { font-size:13px; }
}

/* Photo choices need a usable card row, including nested household forms. */
.field-row:has(> .field > [data-groomer-photo-picker]) {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));
}

/* A single-choice portrait button owns its entire card, not just its contents. */
.slot-staff-card:has(> button.slot-staff-choice:only-child) { padding:0; }
.slot-staff-card > button.slot-staff-choice:only-child { flex:1; padding:10px 6px; border-radius:inherit; justify-content:flex-start; }

/* Shared choice sheet can anchor beside its trigger when there is room. */
@media (min-width:651px) {
  .groomer-sheet.is-anchored, .date-nav .groomer-sheet.is-anchored { inset:var(--choice-top) auto auto var(--choice-left); transform:none; width:240px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border:1px solid var(--hairline); border-radius:var(--radius-soft); box-shadow:0 8px 24px #14253a2e; }
  .groomer-sheet.is-anchored .groomer-sheet-head { padding:10px 12px; }
  .groomer-sheet.is-anchored .groomer-sheet-head h2 { font-size:15px; }
  .groomer-sheet.is-anchored .groomer-sheet-list { padding:6px; }
  .groomer-sheet.is-anchored .groomer-sheet-opt { min-height:40px; font-size:14px; font-weight:500; }
  .groomer-sheet.is-anchored::backdrop { background:transparent; }
}
/* Keep the full view selector on laptops; compact screens use the choice sheet. */
.diary-view-tabs { display:none; }
@media (min-width:1100px) {
  .diary-view-tabs { display:inline-flex; }
  .diary-view-dropdown { display:none; }
}

/* Shared booking-review composition: existing card, portrait and button tokens. */
.visit-review-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:16px; margin:16px 0; align-items:stretch; }
.visit-review-grid > .card { margin:0; min-width:0; }
.visit-review-grid > :only-child { width:100%; max-width:440px; }
.visit-review-card { display:flex; flex-direction:column; gap:16px; overflow-wrap:anywhere; }
.visit-review-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.visit-review-identity h3 { font-size:18px; line-height:1.35; color:var(--ink); margin:0; }
.visit-review-dog { flex:none; display:block; }
.visit-review-dog .dog-pic { width:64px!important; height:64px!important; object-fit:cover; }
.visit-review-when { display:grid; gap:4px; padding-top:14px; border-top:1px solid var(--hairline); }
.visit-review-card p { margin:0; }
.visit-review-team { display:flex; flex-wrap:wrap; gap:14px; }
.visit-review-person { display:flex; align-items:center; gap:10px; min-width:0; }
.visit-review-person > span:last-child { display:grid; gap:2px; min-width:0; }
.visit-review-card > .btn { margin-top:auto; align-self:flex-start; }

/* Calendar time target: shared Day/Week, no animation; touch uses direct tap. */
.diary-time-target { position:absolute;left:0;right:0;z-index:4;pointer-events:none;background:var(--wash);outline:1px solid var(--blue);color:var(--ink);font-weight:600;font-size:12px;padding:2px 8px; }
.diary-time-tooltip[data-state="available"] { background:var(--busy-good-text); border-color:var(--busy-good-text); }
.diary-time-tooltip:is([data-state="outside"],[data-state="past"]) { background:var(--busy-warn-text); border-color:var(--busy-warn-text); }
.diary-time-tooltip[data-state="unavailable"] { background:var(--busy-bad-text); border-color:var(--busy-bad-text); }
.diary-time-tooltip { position:fixed; z-index:60; pointer-events:none; max-width:calc(100vw - 16px); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--ink); color:var(--white); border-color:var(--ink); }

/* Shared diary backgrounds: day bands and elapsed time never tint appointment cards. */
.grid-diary [data-day-shade="alternate"] { background-color:color-mix(in srgb,var(--cool) 70%,var(--rule) 30%); }
.diary-elapsed-time { position:absolute;inset:0 0 auto;z-index:2;background:color-mix(in srgb,var(--ink) 9%,transparent);pointer-events:none; }
.grid-diary .diary-position:is([data-appt-id],[data-block-id]) { z-index:3; }

/* Week headers reuse the compact diary type scale; capacity stays inline on small/short screens. */
.grid-diary.availability-grid .gh .gh-name-row .gh-swatch { display:inline-block; }
@media(max-width:1279px), (max-height:760px) {
 .grid-diary.availability-grid { --diary-heading-size:12.5px;--diary-sub-size:10.5px; }
 .availability-grid .availability-day { height:24px;padding:3px 8px; }
 .grid-diary.availability-grid .gh { top:24px;padding:3px 8px; }
 .grid-diary.availability-grid .gh small { margin-top:2px; }
 .grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter { display:none !important; }
 .grid-diary.availability-grid .gh small .sub-full { display:none !important; }
 .grid-diary.availability-grid .gh small .sub-short { display:inline !important; }
 .grid-diary .gh.corner .iconbtn, .availability-corner .iconbtn { width:32px; height:32px; }
}

/* A recessed range edge, separate from the appointment columns. */
.grid-diary :is([data-week-edge],[data-day-edge]) { background:var(--white); }
.grid-diary .gh:is([data-week-edge],[data-day-edge]) { border-bottom:0; }
.grid-diary :is([data-week-edge="previous"],[data-day-edge="previous"]) { background-image:linear-gradient(to left,color-mix(in srgb,var(--ink) 6%,transparent),transparent 14px); border-right:1px solid var(--ink-40); }
.grid-diary :is([data-week-edge="next"],[data-day-edge="next"]) { background-image:linear-gradient(to right,color-mix(in srgb,var(--ink) 6%,transparent),transparent 14px); border-left:1px solid var(--ink-40); }
.availability-more { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px; box-sizing:border-box; }
.availability-more .btn { display:flex; flex-direction:column; gap:8px; width:100%; min-height:76px; padding:10px 0; border-color:transparent; background:transparent; font-size:13px; font-weight:500; line-height:1.4; white-space:nowrap; text-align:center; }
.availability-more .btn svg { width:34px; height:34px; padding:7px; box-sizing:border-box; border:1px solid var(--hairline); border-radius:50%; background:var(--white); }
.availability-more .btn[aria-busy="true"] svg { border:2px solid var(--hairline); border-top-color:var(--ink-soft); animation:diary-week-spin .8s linear infinite; }
.availability-more .btn[aria-busy="true"] svg > * { visibility:hidden; }
@keyframes diary-week-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .availability-more .btn[aria-busy="true"] svg { animation:none; } }

.availability-more .btn:is(:hover,:focus-visible) { background:var(--wash); border-color:var(--hairline); color:var(--ink); }
.availability-more .btn[aria-disabled="true"] { opacity:.65; cursor:wait; }
.availability-more [role="status"] { font-size:12px; line-height:1.4; text-align:center; }
.availability-more [role="status"]:empty { display:none; }
@media(max-width:650px) { .grid-diary.availability-grid { --week-edge-width:132px; } }

/* Mobile week arrows stay in their natural edge columns: reveal them only
   when the user scrolls to that edge, never over appointment columns. */
@media (max-width:650px) {
  .availability-more:is([data-week-edge]) .btn { pointer-events:auto; position:sticky; top:50%; width:44px; min-width:44px; min-height:44px; height:44px; flex-direction:row; gap:0; padding:0; border-radius:50%; background:color-mix(in srgb, var(--white) 90%, transparent); box-shadow:0 2px 10px #14253a33; border:1px solid var(--hairline); }
  .availability-more:is([data-week-edge]) .btn svg { width:20px; height:20px; padding:0; border:0; background:none; }
  .availability-more:is([data-week-edge]) .btn [data-week-label] { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .availability-more:is([data-week-edge]) [role="status"] { display:none; }
}

/* Day uses the same fitted time scale and compact shared picker as Week. */
main:has(.diary-fit-scroll) { padding-bottom:0; }
.day-grid.is-columns-animating { overflow:clip; }
.diary-fit-scroll { overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y; }
.diary-fit-scroll .grid-diary .gh { top:0;box-sizing:border-box;align-items:flex-start; }
.diary-fit-scroll .grid-diary .gtimes { position:sticky;left:0;z-index:22;background:var(--white); }
.diary-fit-scroll .grid-diary .gh.corner { left:0;z-index:30; }
.diary-fit-scroll .grid-diary:not(.day-all) { width:100%;grid-template-columns:56px minmax(0,1fr); }
.diary-fit-scroll .grid-diary:not(.day-all) [data-groomer-header]:not([data-active="true"]),
.diary-fit-scroll .grid-diary:not(.day-all) [data-groomer-column]:not([data-active="true"]) { display:none; }
.diary-fit-scroll .availability-end-time { position:absolute;bottom:3px;right:8px;color:var(--ink-soft);font:600 12px/1 var(--display); }

/* Shared compact diary chrome: keep selectors clear without boxing every control. */
@media(max-width:899px){
 .diary-workspace .date-nav { gap:4px; padding-block:5px; }
 .date-nav .diary-view-dropdown > .groomer-sheet-trigger,
 .date-nav > a.groomer-sheet-trigger,
 .date-nav .diary-header-slot .groomer-sheet-trigger { border-color:transparent; background:transparent; box-shadow:none; }
 .date-nav input[type="date"] { border-color:transparent; box-shadow:none; }
 .date-nav .diary-header-slot .diary-quick-actions > .btn { background:transparent; border-color:transparent; box-shadow:none; }
}
.diary-move-undo .iconbtn { flex:none; color:inherit; width:44px; height:44px; }
.diary-move-undo .row { flex-wrap:nowrap; }

/* Day edges share the recessed range controls, leaving staff columns at their
   existing fitted widths. They sit outside the initial visible day. */
.diary-fit-scroll .grid-diary.day-grid:not(.day-single) { width:max-content; grid-template-columns:56px repeat(var(--cols),var(--day-col-width,150px)); }
.diary-fit-scroll .day-grid .gh[data-day-edge] { display:flex; }
.diary-fit-scroll .grid-diary.day-grid.day-single { width:100%;grid-template-columns:56px minmax(0,1fr); }
@media(max-width:650px){.diary-fit-scroll .grid-diary.day-grid:not(.day-single) { --week-edge-width:132px; }}

/* Short viewports (phone held sideways, ~390px tall): fitting the whole day into the
   viewport squashed the hours to ~15px each (Ryan 30 Oct 21:44 screenshot). Enforce a
   readable minimum hour height and let the day/week scrollport scroll vertically instead.
   !important deliberately beats the inline --hour-h that __availabilityFit() sets. */
@media (max-height: 640px) {
  .diary-fit-scroll .grid-diary, .availability-scroll .grid-diary { --hour-h: 48px !important; }
  .availability-scroll { overflow-y: auto; }
}

/* Pinch/ctrl-wheel zoom (diary-pinch-zoom): the reset control is a
   zero-height sticky row (the scroller's first child) so it stays pinned to
   the top-right corner while scrolling without reflowing the grid below it. */
/* Ryan 3 Nov 20:23: the sticky top placement collided with the groomer header row. Float it bottom-right above the tab bar instead, like the toast. */
.diary-zoom-reset-wrap { height:0; pointer-events:none; }
/* Ryan 3 Nov 20:25: Week view's scroller is overflow-y:hidden (fits the day), so once zoomed it could only be moved by dragging bookings. Allow normal vertical scrolling while zoomed. */
.availability-scroll:has(> [data-zoom-reset-wrap]), .diary-fit-scroll:has(> [data-zoom-reset-wrap]) { overflow-y:auto; -webkit-overflow-scrolling:touch; }
.diary-zoom-reset { pointer-events:auto; position:fixed; right:14px; bottom:calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index:35; background:#fff; box-shadow:0 8px 24px #14253a3d; border-radius:999px; }
@media (min-width: 900px) { .diary-zoom-reset { bottom:24px; right:24px; } }

/* ---- messaging v2 (batch 2, ported from design/messaging-v2/build.mjs STYLE) ---- */
/* Unified header (DESIGN.md §3 messages.ts row): .inbox-tools is now the
   header's own .page-header-row second line - no background of its own,
   the white .page-header block behind it already paints the surface. */
.inbox-tools{padding:8px 0 10px;display:grid;gap:10px}
.inbox-search{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 14px;background:#fff;border:1px solid var(--input-border);border-radius:999px;color:var(--ink-soft)}
.inbox-search svg{width:20px;height:20px;flex:none}
.inbox-search input{border:0;outline:0;background:transparent;font:400 16px var(--text);color:var(--ink);width:100%;min-width:0}
.inbox-search input::placeholder{color:var(--placeholder)}
.threads{padding:0 14px}
.thread.v2{grid-template-columns:56px 1fr auto;gap:12px;padding:12px 0;align-items:center}
.thread.v2 .avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:var(--blue-tint);font:600 18px var(--text);color:var(--ink)}
.thread.v2 .body{min-width:0}
.thread.v2 .who{font:600 17px/1.2 var(--display);display:block;white-space:normal;overflow:hidden;min-width:0}
.thread.v2 .dogs{display:block;font:400 14px/1.3 var(--text);color:var(--ink-soft);margin:1px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread.v2 .snip{font-size:15px;color:var(--ink-soft);margin-top:3px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.thread.v2 .snip.draft{color:var(--ink-soft);font-style:italic}
.thread.v2.is-unread .who,.thread.v2.is-unread .snip{color:var(--ink);font-weight:600}
.thread.v2 .meta{display:flex;flex-direction:column;align-items:flex-end;gap:8px;min-width:52px;max-width:92px}
.thread.v2 .meta .pill{white-space:nowrap}
.thread.v2 .time{font-size:13px;color:var(--ink-soft)}.thread.v2 .time.hot{color:var(--ink);font-weight:600}
.thread.v2 .state{display:flex;align-items:center;gap:6px;min-height:16px}
.thread.v2 .muted{width:16px;height:16px;color:var(--ink-40)}.thread.v2 .muted svg{width:16px;height:16px}
.ticks{display:inline-flex;width:18px;height:18px;color:var(--ink-40)}.ticks svg{width:18px;height:18px}
.ticks.read{color:var(--blue)}
.bubble .ticks{width:16px;height:16px}.bubble .ticks svg{width:16px;height:16px}
.bubble.out .ticks{color:rgba(255,255,255,.55)}.bubble.out .ticks.read{color:#9CC4EC}
.thread.v2.is-selected{background:var(--wash);margin:0 -14px;padding:12px 14px;border-radius:12px;border-bottom-color:transparent}
.thread.v2 .unread{width:10px;height:10px;border-radius:50%;background:var(--ink)}
.thread-head{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;column-gap:0;row-gap:4px;align-items:center;padding:8px 0;background:var(--paper);min-height:60px}
/* Row 1: back, avatar, name block, actions. Row 2: the assign/needs-reply
   line, starting at the name's left edge and running under the actions so
   it gets the full width on a phone. Back and avatar span both rows and
   centre on the whole block. Column gaps are margins, so a hidden back
   button (desktop split view) leaves no phantom gap. */
.thread-head > .page-header-back{grid-column:1;grid-row:1 / span 2;margin-right:4px}
.thread-head > .avatar{grid-column:2;grid-row:1 / span 2;margin-right:10px}
.thread-head > .who{grid-column:3;grid-row:1}
.thread-head > .thread-actions{grid-column:4;grid-row:1;display:flex;align-items:center;margin-left:8px}
.thread-head > .thread-assign-line{grid-column:3 / -1;grid-row:2}
/* Brief item 5 (Ryan, 16 Nov 2026): ownership is a quiet secondary line
   directly under the client name INSIDE .who, not a separate strip band
   after the row - removed. .thread-head > .avatar (direct child only, not
   a descendant selector) so it only ever sizes the one big contact avatar
   and never the small inline assign-trigger avatar nested in .who. */
.thread-head > .avatar{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:none;display:grid;place-items:center;background:var(--blue-tint);font:600 16px var(--text);color:var(--ink)}
.thread-head .who{min-width:0;display:flex;flex-direction:column;gap:2px}
/* Flex-column children default to min-width:auto (their own content
   width) even though the container stretches - without min-width:0 here
   a long owner name or the client name would refuse to shrink below its
   own intrinsic width and silently force the whole .who column wider
   than the space actually available, which is what caused the client
   name to truncate far too early and the assign line to wrap mid-word. */
.thread-head .who > *{min-width:0;max-width:100%}
.thread-head .who strong{font:560 18px/1.15 var(--display);letter-spacing:-.012em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-head .sub{font-size:13px;color:var(--ink-soft);display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px}
.thread-head .sub .dogs-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.avatar.xs{width:18px;height:18px;font-size:8px;flex:none}
.thread-assign-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.thread-assign-line .groomer-sheet-wrap{min-width:0;max-width:100%}
/* The trigger is always exactly one line - the owner name ellipsises
   instead of wrapping, so a long name ("Jenell McKinnell (TEST)") never
   stacks the avatar/label/chevron onto separate rows the way free-flowing
   text would. The Needs-reply pill and No-reply-needed button are
   separate flex items on the same .thread-assign-line, so they share the
   row when there's space and wrap to their own line when there isn't -
   never squeezed inside the trigger itself. */
.thread-assign-trigger{display:inline-flex;align-items:center;gap:4px;min-height:0;min-width:0;max-width:100%;border:0;background:none;padding:0;font:400 13px var(--text);color:var(--ink-soft);cursor:pointer;text-align:left}
.thread-assign-trigger b{font-weight:600;color:var(--ink)}
.thread-assign-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.thread-assign-trigger .chev{font-size:11px;line-height:1;flex:none}
.thread-assign-line > .groomer-sheet-wrap{flex:0 1 auto}
/* Needs-reply pill and its action stay together as one unit: they share
   line 2 when there is room and drop to one tidy line 3 when there isn't. */
.reply-state{display:inline-flex;align-items:center;gap:8px;flex:none}
.reply-state form{display:contents}
/* Compact header control - same sizing the shared .page-header uses for
   its buttons, so it sits at pill scale rather than as a full form button. */
.thread-head .btn.no-reply-btn{display:inline-flex;align-items:center;gap:4px;min-height:var(--page-header-control-h);height:var(--page-header-control-h);padding:0 10px;font-size:13px;white-space:nowrap}
.thread-head .btn.no-reply-btn svg{width:16px;height:16px}
@media (max-width:389px){ .no-reply-label{display:none} }
.thread-head .next{display:inline-flex;align-items:center;gap:4px;margin-left:0;white-space:nowrap;padding:2px 8px;border-radius:999px;background:var(--blue-tint);color:var(--ink);font-weight:600;font-size:12.5px}
.thread-head .next svg{width:13px;height:13px}
.iconbtn { width: 44px; height: 44px; flex-shrink: 0; border: 0; background: transparent; border-radius: 50%; display: grid; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; place-items: center; }
.iconbtn svg { width: 22px; height: 22px; }
.convo.v2{padding:12px 0 8px;display:flex;flex-direction:column;gap:8px}
.msg-day{display:flex;justify-content:center;margin:8px 0}
.msg-day span{font:600 12.5px var(--text);color:var(--ink-soft);background:var(--cool);border:1px solid var(--rule);border-radius:999px;padding:4px 10px}
.msg-sys{text-align:center;font-size:13px;color:var(--ink-soft);margin:2px 0}
.bubble { max-width: 78%; padding: 10px 12px 8px; border-radius: 18px; font-size: 16px; line-height: 1.4; position: relative; }
.bubble.in { background: #fff; border: 1px solid var(--rule); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.out,.bubble.auto{border-bottom-right-radius:6px;align-self:flex-end}
.bubble.out{background:var(--ink);color:#fff}
.bubble.auto{background:var(--wash);color:var(--ink)}
.bubble .foot{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-top:4px;font-size:11.5px;opacity:.75}
.bubble .foot .label{margin-right:auto;font-weight:600}
.bubble time { display: inline; font-size: 11.5px; opacity: 1; margin-top: 4px; margin: 0; }
.bubble.photo{padding:4px;max-width:260px}
.bubble.photo img{display:block;width:100%;height:auto;border-radius:14px;aspect-ratio:1;object-fit:cover}
.bubble.card-bubble{padding:6px;max-width:300px}
.msg-card{position:relative;background:var(--white);color:var(--ink);border:1px solid var(--rule);border-radius:12px;padding:16px 16px 16px 20px;display:grid;gap:6px;grid-template-columns:minmax(0,1fr);font-family:var(--text);overflow-wrap:anywhere;overflow:hidden}
.msg-card::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--blue)}
/* §4h: the Inbox rail's "Next visit" card is a whole-card link to the
   booking page - same .msg-card.appt look, just an <a> instead of a <div>. */
a.msg-card.appt-link{text-decoration:none;color:inherit;cursor:pointer}
a.msg-card.appt-link:hover{background:var(--cool)}
/* Shared booking identity: date/time balanced by the booked dog's own portrait. */
.msg-card.appt,.attach-chip.booking{grid-template-columns:minmax(0,1fr) 48px;column-gap:16px}
.appt-portrait{grid-column:2;grid-row:1 / span 3;align-self:center;justify-self:end}
.appt-portrait .avatar{width:64px;height:64px;object-fit:cover;font-size:22px}
.msg-card.appt .appt-eyebrow,.msg-card.appt .appt-date,.msg-card.appt .appt-time{grid-column:1}
.appt-dog,.appt-line,.appt-select{grid-column:1 / -1}
.attach-chip.booking .appt-portrait{grid-column:2;grid-row:1 / span 3}
.attach-chip.booking .appt-portrait .avatar,.attach-chip.booking .appt-portrait .dog-pic{width:44px;height:44px;font-size:16px}
.appt-eyebrow{font:600 11px var(--text);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft)}
.appt-date{font:500 13px var(--text);color:var(--ink-soft)}
.msg-card .appt-time{font:600 28px var(--text);line-height:1.15;font-variant-numeric:tabular-nums}
.msg-card .appt-dog{font:600 18px var(--display);line-height:1.3;margin-top:4px}
.msg-card .appt-line{font:400 13px var(--text);color:var(--ink-soft);line-height:1.5}
.appt-select{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--rule);padding-top:10px;margin-top:6px;font:600 13px var(--text);color:var(--ink)}

/* Messaging v2 batch 4 (§10.4): photo bubbles, in-bubble booking card, composer attachment strip. */
.bubble.has-media{padding:8px}
.bubble.has-media .msg-card.in-bubble{margin-bottom:6px;width:100%;max-width:360px}
.bubble-photos{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:4px;max-width:260px}
.bubble-photos:has(+ *){margin-bottom:6px}
.bubble-photo{display:block;border-radius:12px;overflow:hidden;line-height:0}
.bubble-photo img{width:100%;height:auto;display:block;aspect-ratio:1/1;object-fit:cover}
.bubble.out .msg-card.in-bubble,.bubble.auto .msg-card.in-bubble{margin-left:auto}
.attach-strip{display:flex;gap:8px;overflow-x:auto;padding:4px 2px;scrollbar-width:none}
.attach-chip{position:relative;flex:none;border-radius:10px;overflow:hidden;background:var(--wash);display:flex;align-items:center}
.attach-chip.photo{width:56px;height:56px}
.attach-chip.photo img{width:56px;height:56px;object-fit:cover;display:block}
.attach-chip.is-uploading,.attach-chip.is-error{padding:8px 12px;font-size:12.5px;color:var(--ink-soft);height:56px;box-sizing:border-box;align-items:center}
.attach-chip.is-error{color:var(--red,#b3261e)}
.attach-chip button[data-remove-attachment],.attach-chip button[data-remove-booking-card]{position:absolute;top:2px;right:2px;width:18px;height:18px;border-radius:50%;background:rgba(19,38,59,.65);color:#fff;border:0;font-size:13px;line-height:1;cursor:pointer;display:grid;place-items:center}
.attach-chip.booking{padding:12px 40px 12px 12px;height:auto;min-width:190px;max-width:280px;display:grid;gap:4px;border:1px solid var(--rule)}
.attach-chip.booking [data-remove-booking-card]{width:32px;height:32px;top:4px;right:4px}
.attach-chip.booking .appt-time{font:600 13.5px var(--display)}
.attach-chip.booking .appt-dog{font:600 13px var(--display)}
.attach-chip.booking .appt-line{font-size:11.5px;color:var(--ink-soft)}
.booking-card-pick{flex-shrink:0;width:100%;text-align:left;cursor:pointer;min-height:44px}
.booking-card-pick:hover{background:var(--wash)}
[data-booking-card-list] .msg-card{margin-bottom:8px}
/* Inbox layout (4 Nov 2026 design/2026-11-04-inbox-layout): phone thread
   page is an app-shell column (body.v-thread), not a document scrolling
   behind fixed bars - the tab bar is hidden (Ryan decision 1, 4 Nov) so the
   conversation is full screen and the composer owns the bottom edge. --vvh
   (set by MESSAGING_V2_JS from window.visualViewport) shrinks the column
   when the iOS keyboard opens, so Send/plus stay reachable. */
.composer-note{margin:4px 0 0;font:400 12.5px/1.4 var(--text);color:var(--ink-soft)}
@media (max-width:899px){
  body.v-thread{height:var(--vvh,100dvh);overflow:hidden;display:flex;flex-direction:column}
  body.v-thread .appbar,body.v-thread .tabbar{display:none}
  /* §4g (2026-11-04-ryan-batch/DESIGN.md): /messages/:id is now the same
     Inbox page at every width, so its markup always includes the page
     header and the threads list - at phone widths with a thread open,
     hide both (and the rail, already display:none below 1440) so only
     the conversation column shows, matching the old dedicated thread
     page's full-screen phone behaviour. */
  body.v-thread .page-header,body.v-thread .pane.threads-col{display:none}
  html:has(body.v-thread){--bar-h:0px}
  body.v-thread main{flex:1;min-height:0;padding:0;display:flex;flex-direction:column}
  body.v-thread .chat-split{flex:1;min-height:0;margin:0;display:flex}
  body.v-thread .pane.convo-col{flex:1;min-height:0;display:flex;flex-direction:column}
  body.v-thread .pane.convo-col .thread-head{flex:none;position:static;margin:0;padding:8px var(--gutter);border-bottom:1px solid var(--rule);background:var(--white)}
  body.v-thread .pane.convo-col .convo.v2{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px var(--gutter);background:var(--cool)}
  body.v-thread .pane.convo-col .composer2{flex:none;position:static;margin:0;padding:8px var(--gutter) calc(8px + env(safe-area-inset-bottom,0px));background:var(--white);border-top:1px solid var(--rule)}
  .thread-head .who strong{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

  /* Inbox list page fills the screen; rows are full-bleed like /search. */
  body.v-inbox main{min-height:100dvh;display:flex;flex-direction:column}
  body.v-inbox .chat-split,body.v-inbox .threads-col{flex:1;display:flex;flex-direction:column;min-height:0}
  body.v-inbox .threads{flex:1;background:var(--white);margin:0 calc(-1*var(--gutter));padding:0 var(--gutter)}
  body.v-inbox .threads .empty{margin:auto 0}
  body.v-inbox .thread.v2.is-selected{background:transparent;margin:0;padding:12px 0;border-radius:0;border-bottom-color:var(--rule-row)}
  .inbox-tools .chips{margin:0 calc(-1*var(--gutter));padding:2px var(--gutter) 8px}
}
.composer2{position:relative;background:var(--white);padding:8px 0;display:grid;gap:8px;z-index:5}
/* Composer consent notice sits above .composer2 and takes the same horizontal inset as the composer in each layout. */
[data-composer-notice]{margin:8px var(--gutter) 8px}
@media (min-width:900px){.chat-split .pane.convo-col [data-composer-notice]{margin:10px 20px 10px}}
.inbox-tools .chips,.quick-replies{scrollbar-width:none;scroll-snap-type:x proximity;scroll-padding-inline:var(--gutter)}
.inbox-tools .chips::-webkit-scrollbar,.quick-replies::-webkit-scrollbar{display:none}
.inbox-tools .chips>.chip,.quick-replies>.chip{scroll-snap-align:start}
.chips[data-can-scroll-right],.quick-replies[data-can-scroll-right]{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent)}
.quick-replies{display:flex;gap:8px;overflow-x:auto}
.quick-replies .chip{min-height:44px;font-size:14px;padding:0 14px}
.composer-row{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:8px;align-items:end}
.composer-row .grow{background:#fff;border:1px solid var(--input-border);border-radius:24px;min-height:48px;display:flex;align-items:center;padding:0 16px}
.composer-row textarea{border:0;outline:0;resize:none;width:100%;font:400 16px/1.4 var(--text);color:var(--ink);background:transparent;padding:12px 0;max-height:120px}
.composer-row .plus{width:48px;height:48px;margin:0}
.sendbtn{width:48px;height:48px;border-radius:50%;border:0;background:var(--ink);color:#fff;display:grid;place-items:center;cursor:pointer}
.sendbtn svg{width:22px;height:22px}
.sendbtn:disabled{background:var(--wash);color:var(--ink-40);cursor:default}
@media (prefers-reduced-motion:reduce){.sendbtn,.chip{transition:none}}
/* Below 900px: threads list only (the existing two-page phone flow - rows
   link to /messages/:id for the full thread page). Above 900px: the split
   follows the shell rail breakpoint, so there is never a width where the
   page has a desktop rail but a phone list (design/2026-11-04-inbox-layout
   §2). Rail column appears at >=1440px only. */
.chat-split{display:block}
.chat-split .pane.convo-col,.chat-split .context-rail{display:none}
@media (min-width:900px){
  body.v-inbox main{height:100dvh;overflow:hidden;display:flex;flex-direction:column;padding-bottom:0}
  body.v-inbox .page-header{flex:none}
  .chat-split{flex:1;min-height:0;display:grid;grid-template-columns:320px minmax(0,1fr);gap:0;margin:0 calc(-1*var(--gutter))}
  .chat-split>.pane,.chat-split>.context-rail{min-height:0;height:100%;overflow:hidden;display:flex;flex-direction:column}
  .chat-split .pane.threads-col{border-right:1px solid var(--hairline);background:var(--white)}
  .chat-split .inbox-tools{position:static;margin:0;padding:12px var(--gutter) 10px;border-bottom:1px solid var(--hairline)}
  .chat-split .inbox-tools .chips{flex-wrap:wrap;overflow:visible;padding:0;margin:0;mask-image:none;-webkit-mask-image:none}
  .chat-split .threads{flex:1;min-height:0;overflow-y:auto;padding:0 var(--gutter)}
  .chat-split .pane.convo-col{display:flex;background:var(--cool)}
  .chat-split .pane.convo-col .thread-head{flex:none;position:static;margin:0;padding:10px 20px;background:var(--white);border-bottom:1px solid var(--hairline)}
  .chat-split .pane.convo-col .convo.v2{flex:1;min-height:0;overflow-y:auto;padding:16px 24px}
  .chat-split .pane.convo-col .composer2{flex:none;position:static;background:var(--white);border-top:1px solid var(--hairline);padding:10px 20px 12px}
  .chat-split .quick-replies{flex-wrap:wrap;overflow:visible;gap:6px 8px;mask-image:none;-webkit-mask-image:none;scroll-snap-type:none}
  .chat-split .threads-col .thread.v2.is-selected{margin:0 calc(-1*var(--gutter));padding:12px var(--gutter);border-radius:0}
  .chat-split .context-rail{display:none}
}
@media (min-width:1440px){
  .chat-split{grid-template-columns:320px minmax(0,1fr) 300px}
  .chat-split .context-rail{display:flex;flex-direction:column;gap:12px;overflow-y:auto;overflow-x:hidden;padding:12px 16px;border-left:1px solid var(--hairline);background:var(--white)}
  .chat-split .context-rail .card{min-width:0;flex:none}
}
/* Rail cards set --card-pad (not a bare padding) so .card-head bands and rules meet the card border exactly instead of overhanging it (Ryan 15 Nov: crossed lines at card corners). */
.context-rail .card{--card-pad:16px}
.context-rail h3{font-size:16px;margin:0}
.context-rail .card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
/* §4e/D3 (DESIGN-REVIEW.md §2.3): compact card-head modifier for narrow
   columns - band-less, one hairline, ≤36px, so a compact head reads as a
   quiet label rather than a lid sitting on the box below it. The rail
   (context-rail) is today the only user of `compact`; any future compact
   head inherits this quieter look too. */
.card > .card-head.compact { background: transparent; border-bottom: 1px solid var(--hairline); min-height: 36px; padding: 6px var(--card-pad); margin-bottom: 8px; align-items: center; flex-wrap: nowrap; }
.card > .card-head.compact h2, .card > .card-head.compact h3 { font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card > .card-head.compact .textlink { flex: none; white-space: nowrap; min-height: 0; }
.card > .card-head.compact .iconbtn { width: 24px; height: 24px; flex: none; }
/* §4h: every person/dog/visit row in a .rows list opens its record. */
.rows li > a.row-link { display:flex; flex:1; justify-content:space-between; align-items:flex-start; gap:8px; min-height:44px; color:inherit; text-decoration:none; border-radius:8px; margin:0 -6px; padding:4px 6px }
.rows li > a.row-link:hover { background: var(--cool) }
/* Page header, flush: for pages whose first element is a full-bleed surface. */
.page-header-flush { margin-bottom: 0; }
/* Chip, compact: pointer widths only (≥900). 36px visual, 44px hit area via ::after. */
@media (min-width: 900px) {
  .chip.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; position: relative; }
  .chip.sm::after { content: ""; position: absolute; inset: -4px; }
}
.svc-pick.is-disabled { opacity: .55; }
.context-rail .textlink{font-size:13.5px;display:inline-flex;align-items:center;gap:4px}.context-rail .textlink svg{width:14px;height:14px}
.dog-row{display:flex;gap:10px;align-items:flex-start;margin-top:8px}
.dog-row .avatar{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:none}
.rows.small li{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:6px 0;border-bottom:1px solid var(--rule-row);font-size:13.5px}
.rows.small li:last-child{border-bottom:0}
.rows.small li .when{flex:none;white-space:nowrap;min-width:3.4em;font-variant-numeric:tabular-nums}
.rows.small li .what{min-width:0;overflow-wrap:anywhere;text-align:right}
.switch-row{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px;font-size:15.5px}
.switch-row>span:first-child{display:inline-flex;align-items:center;gap:8px}.switch-row svg{width:18px;height:18px;color:var(--ink-soft)}
.switch[role="switch"]{width:46px;height:28px;border-radius:999px;background:var(--hairline);position:relative;flex:none;transition:background .2s var(--ease);cursor:pointer;border:0}
.switch[role="switch"]::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:left .2s var(--ease)}
.switch[role="switch"].on{background:var(--positive)}.switch[role="switch"].on::after{left:21px}
.toast{position:fixed;top:calc(var(--bar-h,56px) + 10px);right:16px;left:16px;z-index:60;display:grid;grid-template-columns:40px 1fr auto;gap:10px;align-items:center;background:var(--ink);color:#fff;border-radius:14px;padding:10px 12px;box-shadow:0 10px 30px rgba(19,38,59,.25)}
@media (min-width:900px){.toast{left:auto;width:360px}}
.toast .avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:var(--blue-tint);font:600 15px var(--text);color:var(--ink)}
.toast{text-decoration:none}
.toast b{font:600 14.5px var(--text)}
.toast b small{font-weight:400;color:#cfd6dd}
.toast div{font-size:13.5px;color:#e7ebee;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.new-messages-pill{position:sticky;bottom:72px;align-self:center;background:var(--ink);color:#fff;border:0;border-radius:999px;padding:8px 16px;font:600 13.5px var(--text);cursor:pointer;z-index:6}
.composer-sheet{position:fixed;inset:0;background:rgba(19,38,59,.45);display:grid;align-items:flex-end;z-index:70}
@media (min-width:1024px){.composer-sheet{align-items:center;justify-content:center}}
.composer-sheet .combobox-list{position:static;margin-top:8px;max-height:min(260px,40dvh);box-shadow:none}
.composer-sheet-inner{max-width:480px;width:100%;margin:0 auto;border-radius:20px 20px 0 0;max-height:80vh;overflow:auto}
@media (min-width:1024px){.composer-sheet-inner{border-radius:16px}}
@media (prefers-reduced-motion:reduce){.toast,.new-messages-pill{transition:none}}


.inbox-search-row{display:flex;gap:8px;align-items:center}
.inbox-search-row .inbox-search{flex:1;min-width:0}

/* Booking picker uses the browser top layer, above every fixed app surface. */
dialog.composer-sheet{grid-template-columns:minmax(0,480px);justify-content:center;margin:0;border:0;padding:16px;width:100%;max-width:none;height:100dvh;max-height:none;background:transparent;align-items:end;box-sizing:border-box}
dialog.composer-sheet::backdrop{background:rgba(19,38,59,.45)}
dialog.composer-sheet .composer-sheet-inner{margin:0 auto;padding:0;max-height:calc(100dvh - 32px);border-radius:16px;display:flex;flex-direction:column;overflow:hidden}
dialog.composer-sheet .card-head{flex:none;padding:16px;margin:0;border-bottom:1px solid var(--rule);background:var(--white)}
dialog.composer-sheet [data-booking-card-list]{padding:16px;overflow-y:auto;overscroll-behavior:contain;min-height:0;gap:12px;display:grid;grid-auto-rows:max-content;align-content:start}
dialog.composer-sheet [data-booking-card-list] .msg-card{margin:0}
@media(min-width:768px){dialog.composer-sheet{align-items:center}}

/* Day and Week share a compact staff identity and time-ruler scale. */
.grid-diary:is(.day-grid,.availability-grid) .gh {padding:4px 8px;font-size:14px;}
.grid-diary:is(.day-grid,.availability-grid) .gh > span:has(.diary-staff-avatar) {display:grid;grid-template-columns:32px minmax(0,1fr);column-gap:8px;align-items:center;width:100%;}
.grid-diary:is(.day-grid,.availability-grid) .gh .gh-name-row:has(.diary-staff-avatar) {display:contents;}
.grid-diary:is(.day-grid,.availability-grid) .gh .gh-name-row .diary-staff-avatar {display:grid;width:32px;height:32px;font-size:14px;grid-column:1;grid-row:1 / 3;margin:0;}
.grid-diary:is(.day-grid,.availability-grid) .gh .gh-name {grid-column:2;grid-row:1;}
.grid-diary:is(.day-grid,.availability-grid) .gh small {grid-column:2;grid-row:2;margin:0;font-size:11px;}
.grid-diary:is(.day-grid,.availability-grid) .gh .busy-meter {grid-column:1 / -1;grid-row:3;}
.grid-diary:is(.day-grid,.availability-grid) .gh .gh-name-row .gh-swatch {display:none;}
@media(min-width:900px){
 .diary-workspace .date-nav.sticky-bar {padding-block:4px;}
 .diary-workspace .diary-groomer-picker {padding-block:4px;}
 .chat-split .pane.convo-col .thread-head > a[aria-label="Back to inbox"] {display:none;}
}

/* design/2026-11-04-unified-page-header/DESIGN.md §4.1: the settings header
   (.page-head followed by .tabs.settings-tabs) is gone - settingsTabs() is
   now pageHeader()'s own `secondary` row (.page-header-row > .tabs), so it
   already bleeds edge-to-edge and sits flush under the title with no gap,
   by the shared component's own CSS (§4.2), not a per-section patch. */
@media(min-width:900px){
 .chat-split .threads-col .thread.v2{grid-template-columns:40px minmax(0,1fr);gap:4px 10px;}
 .chat-split .threads-col .thread.v2 .avatar{width:40px;height:40px;font-size:14px;grid-column:1;grid-row:1;}
 .chat-split .threads-col .thread.v2 .body{grid-column:2;grid-row:1;}
 .chat-split .threads-col .thread.v2 .meta{grid-column:2;grid-row:2;flex-direction:row;justify-content:space-between;max-width:none;align-items:center;}
 .chat-split .threads-col .thread.v2 .who{font-size:15px;white-space:nowrap;text-overflow:ellipsis;}
 .chat-split .threads-col .thread.v2 .snip{font-size:13px;-webkit-line-clamp:1;}
 .chat-split .threads-col .thread.v2 .dogs{font-size:12px;}
}

/* Settings share Staff's full-width cards and the standard action row.
   Form-only card caps elsewhere remain unchanged. */
main:has(.page-header .settings-tabs) .card,
main:has(.page-header .settings-tabs) .card form.stack {max-width:none;}
main:has(.page-header .settings-tabs) .template-form {gap:12px;}

/* Shared diary groomer-order interaction; no native browser drag thumbnail. */
.groomer-chip-row [data-active-groomer] { cursor:pointer; touch-action:pan-y; user-select:none; -webkit-user-select:none; }
.groomer-chip-row .groomer-drag-ready { cursor:grab; }
.groomer-chip-row .groomer-reordering { opacity:.3; }
.groomer-drag-preview { position:fixed;z-index:10000;pointer-events:none;margin:0;box-shadow:0 5px 14px #14253a30;transform:scale(1.04); }
.groomer-order-dragging, .groomer-order-dragging * { cursor:grabbing!important;user-select:none!important; }

/* Semantic choices: one palette across booking and client controls. */
.segmented [data-choice="yes"] { --choice-colour: var(--positive); }
.segmented [data-choice="no"] { --choice-colour: var(--negative); }
.segmented [data-choice] { color:var(--ink); border-color:var(--rule); background:var(--white); }
.segmented [data-choice]:hover { background:var(--wash); }
.segmented [data-choice][aria-pressed="true"] { background:var(--choice-colour); color:var(--white); border-color:var(--choice-colour); }
select.semantic-choice:has(option[value="yes"]:checked) { color:var(--positive); border-color:var(--positive); }
select.semantic-choice:has(option[value="no"]:checked) { color:var(--negative); border-color:var(--negative); }
select.semantic-choice option { color:var(--ink); background:var(--white); }

/* Feather the shadow layer, never the cell or its continuous divider. */
.grid-diary :is(.availability-day,.gh,.availability-more):is([data-week-edge],[data-day-edge]) { background-image:none; }
.grid-diary .availability-more:is([data-week-edge],[data-day-edge]) { position:relative; }
.grid-diary :is(.availability-day,.gh,.availability-more):is([data-week-edge],[data-day-edge])::after { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(to left,color-mix(in srgb,var(--ink) 6%,transparent),transparent 14px); }
.grid-diary :is(.availability-day,.gh,.availability-more):is([data-week-edge="next"],[data-day-edge="next"])::after { background:linear-gradient(to right,color-mix(in srgb,var(--ink) 6%,transparent),transparent 14px); }
.grid-diary .availability-day[data-week-edge]::after,
.grid-diary .gh[data-day-edge]::after { mask-image:linear-gradient(to bottom,transparent,#000 16px); }
.grid-diary .availability-more:is([data-week-edge],[data-day-edge])::after { mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent); }

/* Diary overview family: shared shell/cards/tokens, content rather than time lanes. */
.diary-workspace .overview-scroll { overflow:auto; min-height:0; padding:16px var(--gutter) 24px; background:var(--paper); }
.diary-workspace .overview-scroll .overview-grid { display:block; width:100%; min-width:0; height:auto; background:transparent; border:0; box-shadow:none; }
/* Month view v1 - Fable, 3 Nov 2026. */
.diary-workspace:has(> .overview-scroll) { background:var(--paper); }
.overview-grid::after { display:none; }
.overview-summary { margin-bottom:12px; gap:8px 16px; align-items:baseline; }
.month-caption { margin:0; font-size:13px; color:var(--ink-soft); }
/* Legend swatches sized/bordered to match the actual cell treatment
   (14px square, 1px border) so "Working"'s white fill is still visible
   against the legend's own white background, and text matches the app's
   small-text size rather than being smaller still (Theo review
   2026-11-15). */
.month-legend { display:flex; flex-wrap:wrap; gap:8px 16px; margin:10px 2px 0; padding:0; list-style:none; font-size:13.5px; color:var(--ink-soft); }
.month-legend li { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.month-legend i { width:14px; height:14px; border-radius:4px; display:inline-block; border:1px solid var(--input-border); }
.month-legend .is-closed i { background:repeating-linear-gradient(135deg,color-mix(in srgb, var(--busy-warn) 32%, #fff) 0 3px,color-mix(in srgb, var(--busy-warn) 16%, #fff) 3px 6px); border-color:var(--busy-warn); }
.month-legend .is-not-working i { background:var(--hairline); border-color:var(--input-border); }

.month-calendar { padding:0; overflow:hidden; }
.month-weekdays, .month-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.month-weekdays { background:var(--cool); border-bottom:1px solid var(--hairline); }
.month-weekdays span { padding:10px 4px; text-align:center; font:700 11.5px/1 var(--text); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft); }

.month-day { position:relative; display:flex; flex-direction:column; gap:6px; min-height:112px; padding:10px 10px 12px; border-right:1px solid var(--hairline); border-bottom:1px solid var(--hairline); color:var(--ink); text-decoration:none; min-width:0; background:var(--white); }
.month-day:nth-child(7n) { border-right:0; }
.month-days .month-day:nth-last-child(-n+7) { border-bottom:0; }
.month-day:hover { background:var(--cool); }
.month-day:focus-visible { outline:3px solid var(--ink); outline-offset:-3px; z-index:1; }
.month-day.is-selected { box-shadow:inset 0 0 0 2px var(--input-border); z-index:1; }
/* Days outside the shown month are blank (not grey) so grey reads as
   "Not working" and nothing else (Theo review 2026-11-15). */
.month-day.outside-month { background:var(--white); color:color-mix(in srgb, var(--ink-soft) 40%, var(--white)); }
/* Three clearly distinct states (Ryan 2026-11-15): working = plain white
   with normal ink text; not-working = flat muted-grey fill with lighter
   text (no hatch - colour + fill alone is enough to read as "closed",
   the hatch is reserved for time off so colour isn't the only signal
   there); time off = visible amber/warn tint (busy-warn family, already
   used for .pill.warning text-on-tint contrast) with a strong hatch so it
   reads at a glance and isn't colour-only. Shared by both the Time off
   and Extra days tabs (one renderMiniMonth call site each, same CSS). */
.month-day.outside-month .month-grooms, .month-day.outside-month .month-free { opacity:.6; }
.month-day.outside-month .month-load i { opacity:.45; }

.month-day-number { align-self:flex-start; display:grid; place-items:center; min-width:26px; height:26px; padding:0 4px; border-radius:50%; font:600 15px/1 var(--display); letter-spacing:-.01em; }
.month-day.is-today .month-day-number { background:var(--ink); color:var(--white); }

.month-grooms { display:inline-flex; align-items:center; gap:5px; font:600 13.5px/1 var(--text); white-space:nowrap; }
.month-grooms svg { width:14px; height:14px; flex:none; color:var(--ink-soft); }
.month-grooms-label { font-weight:400; color:var(--ink-soft); }
.month-day.is-quiet .month-grooms { color:var(--ink-soft); font-weight:400; }

.month-free { font:400 12.5px/1.2 var(--text); color:var(--ink-soft); white-space:nowrap; }
.month-free b { font-weight:500; color:var(--ink); }
.month-day.outside-month .month-free b { color:inherit; }

.month-load { height:5px; border-radius:999px; overflow:hidden; background:var(--hairline); margin-top:auto; }
.month-load i { display:block; height:100%; min-width:0; border-radius:inherit; }

.month-day.is-closed { background:repeating-linear-gradient(135deg,color-mix(in srgb, var(--busy-warn) 32%, #fff) 0 6px,color-mix(in srgb, var(--busy-warn) 16%, #fff) 6px 12px); color:var(--busy-warn-text); border-color:color-mix(in srgb, var(--busy-warn) 45%, var(--hairline)); }
/* Noticeably darker than the old --paper fill, same --hairline tone
   already used for disabled/unavailable UI elsewhere in the app, so "Not
   working" reads clearly as off rather than blending with other muted
   surfaces (Theo review 2026-11-15). */
.month-day.is-not-working { background:var(--hairline); color:var(--ink-soft); }
.month-closed { margin-top:auto; font:500 11.5px/1 var(--text); color:var(--ink-soft); letter-spacing:.02em; }

@media (prefers-reduced-motion:no-preference) { .month-day { transition:background .2s var(--ease); } }
.agenda-day { margin-bottom:16px; }
.agenda-day .card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.agenda-day .card-head p { margin:4px 0 0; }
.agenda-booking { display:grid; grid-template-columns:112px 44px minmax(0,1fr) minmax(130px,200px) 22px; align-items:center; gap:16px; margin:0 calc(-1 * var(--card-pad)); padding:16px var(--card-pad); border-bottom:1px solid var(--hairline); border-radius:var(--radius); color:var(--ink); text-decoration:none; }
.agenda-booking:last-child { border-bottom:0; margin-bottom:calc(-1 * var(--card-pad)); }
.agenda-booking:hover, .agenda-booking:focus-visible { background:var(--cool); }
.agenda-booking:focus-visible { outline:2px solid var(--ink); outline-offset:-2px; }
.agenda-time { font-weight:600; font-size:14px; white-space:nowrap; }
.agenda-time small { display:block; font-weight:400; color:var(--ink-soft); margin-top:4px; }
.agenda-identity { display:flex; flex-direction:column; gap:4px; min-width:0; overflow-wrap:anywhere; }
.agenda-identity strong { font-family:var(--display); font-size:18px; }
.agenda-identity>span,.agenda-identity small { font-size:13px; color:var(--ink-soft); }
.agenda-assignment { display:flex; flex-direction:column; align-items:flex-start; gap:8px; font-size:13px; overflow-wrap:anywhere; }
.agenda-staff { display:flex; align-items:center; gap:6px; min-width:0; }
.agenda-staff-avatar { width:24px; height:24px; font-size:10px; flex:none; }
.agenda-staff-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:140px; }
.agenda-open svg { width:20px;height:20px; }
.agenda-empty { margin:16px 0 0; }
@media(max-width:650px){
 .diary-workspace .overview-scroll { padding:12px 8px 20px; }
 .overview-summary { margin-bottom:10px; }
 .month-caption { font-size:12px; }
 .month-weekdays span { font-size:10.5px; padding:9px 0; letter-spacing:.04em; }
 .month-day { min-height:92px; padding:7px 5px 8px; gap:5px; }
 .month-day-number { min-width:24px; height:24px; font-size:14px; padding:0 3px; }
 .month-grooms { font-size:13px; gap:4px; }
 .month-grooms svg { width:13px; height:13px; }
 .month-grooms-label, .month-free-label { display:none; }
 .month-free { font-size:11.5px; }
 .month-load { height:4px; }
 .month-closed { font-size:10.5px; }
 .month-legend { font-size:12px; gap:4px 12px; }
 .month-day.is-selected { box-shadow:inset 0 0 0 1px var(--input-border); }
 .agenda-day { --card-pad:12px; }
 .agenda-day .card-head h2 { font-size:18px; }
 .agenda-booking { grid-template-columns:44px minmax(0,1fr) 22px; gap:8px 12px; padding:14px var(--card-pad); }
 .agenda-time { grid-column:1/3;display:flex;align-items:center;gap:10px; }
 .agenda-time small { margin:0; }
 .agenda-booking>.dog-pic { grid-column:1;grid-row:2; }
 .agenda-identity { grid-column:2;grid-row:2; }
 .agenda-assignment { grid-column:2; flex-direction:row; flex-wrap:wrap; align-items:center; }
 .agenda-open { grid-column:3;grid-row:2; }
 .agenda-staff-name { max-width:72px; }
 /* Ryan 3 Nov 22:07: Show/Hide cancelled button jumped between lines as its label changed - keep it on its own row on phones. */
 .overview-summary { align-items:flex-start; flex-direction:column; }
 .overview-summary .btn { font-size:12px; }
}
@media (min-width:651px) and (max-width:899px) {
 .month-day { padding:10px 8px 12px; }
 .month-grooms { font-size:13px; gap:4px; }
 .month-free { font-size:12px; }
}
@media (min-width:900px) {
 .month-day { min-height:124px; padding:12px 14px 14px; gap:7px; }
 .month-day-number { font-size:16px; }
 .month-grooms { font-size:14px; }
 .month-free { font-size:13px; }
}

/* Shared booking drawer: essentials precede history, every card is content-sized. */
.detail-drawer-body.booking-card-layout { display:flex; flex-direction:column; align-items:stretch; gap:16px; }
.booking-card-layout > * { flex-shrink:0; min-width:0; margin-block:0; }
.detail-dog-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:6px; }
.detail-dog-meta .detail-breed { margin:0; }
/* One summary, not nested cards: price and care are first-scan information. */
.booking-card-layout .card + .card { margin-top:0; }
.detail-drawer-head { flex-wrap:wrap; }
.booking-care { margin-top:36px; flex:0 0 200px; width:200px; }
@media(max-width:650px) {
 .detail-drawer-head .booking-care { order:3; flex-basis:100%; margin-top:0; }
 .detail-drawer-head { row-gap:8px; }
 .detail-drawer-head .booking-care .row { justify-content:flex-end; }
}
.booking-care [data-treat-permission] { margin:0; }
.booking-care .row { justify-content:flex-start; gap:10px; }
.booking-care strong { font-size:13.5px; }
.booking-care .hint { margin:6px 0 0; }
.treat-control-compact { position:relative; }
.treat-control-compact .segmented { flex:none; }
.treat-control-compact .treat-status-error { position:absolute; top:100%; right:0; width:240px; max-width:calc(100vw - 32px); margin:6px 0 0; z-index:40; }
.booking-card-layout dl { margin:0; }
.booking-card-layout dl > div:first-child { border-top:0; }
.booking-overview { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:2px 0 16px; border-bottom:1px solid var(--rule); }
.booking-schedule,.booking-amount { display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-width:0; }
.booking-schedule > strong { font:600 24px/1.2 var(--display); }
.booking-amount { text-align:right; align-items:flex-end; }
.booking-amount > strong { font:700 34px/1.1 var(--display); color:var(--ink); overflow-wrap:anywhere; }
.booking-amount > .small { font-size:12px; }
.booking-service { padding-top:14px; }
.booking-service > h3 { font:600 20px/1.3 var(--display); margin:0 0 6px; }
.booking-service dl > div { grid-template-columns:70px 1fr; padding:7px 0; border:0; align-items:center; }
.booking-service dl > div dt { padding:0; }
.booking-service p { margin:6px 0 0; }
.booking-summary-card [data-move-details]:not([open]) { display:none; }
.booking-summary-card [data-move-details] { margin-top:16px; border:0; border-top:1px solid var(--rule); border-radius:0; padding:0; }
#appointment-detail:not(:has([data-move-details][open])) .detail-drawer-actions { display:none; }
.booking-contact { padding:4px 0 14px; border-bottom:1px solid var(--rule); }
.booking-contact-main { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.booking-contact-main > div { display:flex; flex-direction:column; gap:3px; }
.booking-contact-main a { font-weight:600; color:var(--ink); }
.booking-contact > p { margin:8px 0 0; }
@media(max-width:650px) {
 .booking-overview { gap:10px; }
 .booking-schedule > strong { font-size:21px; }
 .booking-amount > strong { font-size:28px; }
 .booking-summary-card .card-head { gap:8px; }
 .booking-summary-card .card-head .btn { padding-inline:10px; }
}
.visit-note { padding:14px 0; border-bottom:1px solid var(--rule); }
.visit-note:last-child { border-bottom:0; }
.visit-note-meta { display:flex; gap:10px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
.visit-note-meta > div:not(.row) { flex:1; min-width:100px; }
.visit-note-meta small { display:block; }
.visit-note-portrait,.visit-note-avatar { width:32px; height:32px; flex:0 0 32px; }
.visit-note-portrait img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.visit-note-body { white-space:pre-wrap; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
.visit-note-body.expanded { display:block; }


/* ---------- Sign-in v3 (Fable, 2 Nov 2026) - replaces the whole .signin* block at the end of app.css. Existing tokens only. ---------- */
.signin-body { margin: 0; min-height: 100dvh; background: var(--blue); color: var(--ink); }
main.signin { position: relative; min-height: 100dvh; display: flex; flex-direction: column; padding: 0; margin: 0; max-width: none; width: 100%; overflow: hidden;
  background: linear-gradient(180deg, var(--blue) 0 38%, color-mix(in srgb, var(--blue) 80%, var(--ink)) 100%); }
.signin-body button, .signin-body summary, .signin-body a { -webkit-tap-highlight-color: transparent; }

/* Hero: the real logo, dissolving into its own blue. No text up here (white on logo blue is 2.6:1, so copy lives on the sheet). */
.signin-hero { position: relative; flex: 1 0 auto; min-height: 176px; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px 28px; }
.signin-mark { width: 116px; height: 116px; display: block; }
.signin-mark-bg { position: absolute; right: -26%; bottom: -34%; width: 112%; max-width: 560px; opacity: .10; pointer-events: none; }

/* Sheet */
.signin-sheet { position: relative; background: #fff; border-radius: 30px 30px 0 0; padding: 30px 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  box-shadow: 0 -14px 40px rgba(19,38,59,.18); }
.signin-sheet h2 { font: 560 27px/1.1 var(--display); letter-spacing: -.012em; margin: 0 0 20px; color: var(--ink); text-align: center; }
.signin-form { display: flex; flex-direction: column; gap: 12px; }

/* Stacked-label field: label always visible inside the field (no placeholder-as-label). */
.signin-field { position: relative; display: block; background: var(--cool); border: 1.5px solid var(--hairline); border-radius: 14px; min-height: 62px;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease); }
.signin-field label { position: absolute; left: 16px; top: 10px; font: 600 12.5px/1.2 var(--text); color: var(--ink-soft); pointer-events: none; }
.signin-field .signin-input { display: block; box-sizing: border-box; width: 100%; height: 59px; padding: 24px 16px 0; border: 0; background: transparent; outline: 0; box-shadow: none;
  font: 400 17px/1.3 var(--text); color: var(--ink); border-radius: 14px; }
.signin-field .signin-input::placeholder { color: transparent; }
.signin-field:focus-within { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px var(--blue-tint); }
.signin-field:focus-within label { color: var(--ink); }
.signin-field.is-filled, .signin-field:has(.signin-input:not(:placeholder-shown)) { background: #fff; }
.signin-field:has(.signin-input[aria-invalid="true"]) { border-color: var(--ink); }
.signin-secret .signin-input { padding-right: 56px; }
.signin-secret .iconbtn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 10px; color: var(--ink-soft); }
.signin-secret .iconbtn svg { width: 22px; height: 22px; }
.signin-secret .iconbtn:hover, .signin-secret .iconbtn[aria-pressed="true"] { color: var(--ink); background: var(--paper); }

/* Keep-signed-in + forgot row */
.signin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px; font-size: 15px; color: var(--ink); }
.signin-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.signin-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.signin-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--ink-soft); background: #fff; display: inline-grid; place-items: center; flex: none; transition: background .15s var(--ease), border-color .15s var(--ease); }
.signin-box::after { content: ""; width: 11px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; }
.signin-check input:checked + .signin-box { background: var(--ink); border-color: var(--ink); }
.signin-check input:checked + .signin-box::after { opacity: 1; }
.signin-check input:focus-visible + .signin-box { outline: 3px solid var(--blue); outline-offset: 2px; }
.signin-forgot summary { list-style: none; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 4px; text-decoration-thickness: 2px; border-radius: 6px; }
.signin-forgot summary::-webkit-details-marker { display: none; }
.signin-forgot summary:hover, .signin-forgot[open] summary { text-decoration-color: var(--ink); }
.signin-forgot summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.signin-forgot-note { margin: -4px 0 0; padding: 12px 14px; background: var(--cool); border: 1px solid var(--hairline); border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.signin-forgot-note[hidden] { display: none; }

/* Alerts: no error colour in this system; ink bar + bold ink text, icon for the two kinds. */
.signin-alert { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; padding: 12px 14px; background: var(--cool); border: 1px solid var(--hairline); border-left: 4px solid var(--ink); border-radius: 12px; }
.signin-alert svg { width: 22px; height: 22px; flex: none; color: var(--ink); }
.signin-alert p { margin: 0; font: 600 15px/1.35 var(--text); color: var(--ink); }

/* Primary button: 56px, arrow, pressed, loading, disabled */
.signin-actions { margin-top: 6px; }
.signin-btn { position: relative; width: 100%; min-height: 56px; border-radius: 14px; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .2s var(--ease), transform .12s var(--ease), opacity .2s var(--ease); }
.signin-btn .signin-btn-arrow { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.signin-btn:hover .signin-btn-arrow { transform: translateX(3px); }
.signin-btn:active { transform: scale(.985); }
.signin-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.signin-btn[disabled] { opacity: .45; cursor: default; transform: none; }
.signin-spinner { display: none; position: absolute; width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: signin-spin .8s linear infinite; }
.signin-btn.is-loading { pointer-events: none; }
.signin-btn.is-loading > span, .signin-btn.is-loading .signin-btn-arrow { visibility: hidden; }
.signin-btn.is-loading .signin-spinner { display: block; }
@keyframes signin-spin { to { transform: rotate(360deg); } }

/* Set password + expired */
/* Identity badge on the set-password page (design/2026-11-04-signin-badge/DESIGN.md).
   Read-only "this is you" tile: the shared .avatar.lg (photo or initials on the
   groomer's --accent) ringed in the same colour, diary name, email, optional role.
   Surface = the --cool/--hairline wash .signin-alert and .signin-forgot-note use. */
.signin-identity { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 12px 14px; background: var(--cool); border: 1px solid var(--hairline); border-radius: 16px; min-width: 0; }
.signin-identity-avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent, var(--rule)); margin: 3px; }
.signin-identity-avatar.device, .signin-identity-avatar.g-none { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rule); }
.signin-identity-avatar > img { display: block; }
.signin-identity-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.signin-identity-name { font: 600 19px/1.15 var(--display); letter-spacing: -.012em; color: var(--ink); overflow-wrap: anywhere; }
.signin-identity-email { font: 500 14.5px/1.3 var(--text); color: var(--ink-soft); overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.signin-identity-label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-right: 4px; }
.signin-identity-role { font: 400 13.5px/1.3 var(--text); color: var(--ink-soft); }
.signin-hint { margin: -4px 2px 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-soft); }
.signin-sheet-message { text-align: center; }
.signin-badge { width: 64px; height: 64px; border-radius: 50%; background: var(--blue-tint); color: var(--ink); display: grid; place-items: center; margin: 0 auto 16px; }
.signin-badge svg { width: 28px; height: 28px; }
.signin-sheet-message h2 { margin-bottom: 8px; }
.signin-note { margin: 0 0 22px; font-size: 15.5px; line-height: 1.45; color: var(--ink-soft); }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .signin-mark { animation: signin-in .5s var(--ease) both; }
  .signin-sheet { animation: signin-up .42s var(--ease) .06s both; }
  @keyframes signin-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes signin-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .signin-body * { transition: none !important; animation: none !important; } .signin-spinner { border-top-color: rgba(255,255,255,.35); } }

/* Tablet + desktop: one centred column on the full gradient; the sheet becomes a card. */
@media (min-width: 700px) {
  main.signin { justify-content: center; align-items: center; padding: 48px 24px; background: linear-gradient(165deg, var(--blue) 0 30%, color-mix(in srgb, var(--blue) 78%, var(--ink)) 100%); }
  .signin-hero { flex: none; min-height: 0; padding: 0 0 26px; position: static; }
  .signin-mark { width: 128px; height: 128px; }
  .signin-mark-bg { right: auto; left: 52%; bottom: -8%; width: 56vw; max-width: 820px; opacity: .08; }
  .signin-sheet { width: 100%; max-width: 420px; border-radius: 28px; padding: 30px 28px 28px; box-shadow: 0 30px 80px rgba(19,38,59,.32); }
}
@media (min-width: 1200px) { .signin-mark { width: 152px; height: 152px; } .signin-hero { padding-bottom: 30px; } }

/* Front desk login v1 (design/front-desk-login-v1/SPEC.md §5) - pasted
   verbatim from mockups/front-desk.css §1-4. Existing tokens only. */
.avatar.device { background: var(--cool); box-shadow: 0 0 0 1px var(--rule); color: var(--ink-soft); }
.avatar.device svg { width: 22px; height: 22px; }
.avatar.device.lg svg { width: 30px; height: 30px; }
.staff-list .avatar.device svg { width: 20px; height: 20px; }

.staff-list-shared { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }

.card-head.staff-head > .pill { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }

.login-card .login-intro { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.login-card .login-status { margin: 0 0 14px; font-size: 15.5px; line-height: 1.5; }
.login-card .login-status b { font-weight: 600; }
.login-email { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; margin: 0 0 10px; }
.login-email b { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.login-email .textlink.sm { margin-left: auto; }
.login-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.login-actions form { display: contents; }
.login-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.login-card .field { margin-bottom: 14px; }
.login-card .stack > * + * { margin-top: 0; }
.field.login-card > label { display: flex !important; align-items: center; gap: 10px; }
.field.login-card .login-intro { margin-top: -2px; }

.notice.login-link { --notice-accent: var(--blue); font-weight: 400; }
.notice.login-link p { margin: 0 0 6px; }
.notice.login-link p b { font-weight: 600; }
.notice.login-link input { width: 100%; min-height: 44px; margin: 8px 0 10px; padding: 10px 12px; font: 400 14.5px/1.3 var(--text); color: var(--ink); background: var(--cool); border: 1px solid var(--hairline); border-radius: 8px; }
.login-link-actions { gap: 10px; }
.login-link-actions .btn { flex: 1 1 auto; }
.login-link-actions .btn svg { width: 18px; height: 18px; }

@media (min-width: 900px) {
  .login-actions .btn { flex: 0 1 auto; }
  .login-link-actions .btn { flex: 0 1 auto; }
}

/* ===== Breeds (Settings > Breeds, design/breed-mapping-v1/SPEC.md, Fable
   3 Nov 2026, built by Sonnet) START - copied verbatim from
   design/breed-mapping-v1/mockups/breeds.css. Everything else on the page
   is existing shared markup: .page-head, .settings-tabs,
   .search-box.toolbar.sticky-bar, .chips/.chip, .segmented, .card,
   .staff-grid/.staff-list rows, .dog-pic, .pill, .rows, .check, .field,
   .notice, .btn, .textlink, .block-popover(.block-sheet) and the
   appConfirm dialog. */

/* 1. One "not set" pill. Paper fill, dashed rule: the absence of a mapping
   reads as a gap, not a status. Same tokens as .pill.next-in-none. */
.pill.unset { background: var(--paper); color: var(--ink-soft); border: 1px dashed var(--input-border); }

/* 2. Breed row = the staff-list row with a breed illustration instead of a
   groomer avatar, service pills under the name, and the dog count on the
   right in Besley like .rows .pr. */
.staff-list.breed-list li a, .staff-list.breed-list li .cross-row-static { align-items: center; }
/* Same fix as .svc-pick .check > div: a flex item's default min-width is
   auto (its content's min-content), so without this the name/pills/alias
   text block refused to shrink below its longest unbreakable run, pushing
   the whole row (and the page) wider than the viewport at phone widths. */
.staff-list.breed-list li a > div, .staff-list.breed-list li .cross-row-static > div { min-width: 0; }
/* One-sided crosses have no pair to open (SPEC §7): render as a plain,
   non-interactive row - same layout as the link rows, no hover/current
   state, no chevron, so tapping it does nothing ugly. */
.staff-list.breed-list li .cross-row-static { display: flex; gap: 12px; padding: 8px 10px; min-height: 52px; color: var(--ink); cursor: default; }
.staff-list.breed-list .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.staff-list.breed-list .sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; }
.staff-list.breed-list .num { margin-left: auto; flex: none; text-align: right; font: 600 19px/1 var(--display); color: var(--ink); min-width: 44px; }
.staff-list.breed-list .num small { display: block; font: 600 11px/1.3 var(--text); color: var(--ink-soft); letter-spacing: .02em; }
.staff-list.breed-list .num.zero { color: var(--ink-soft); }
.staff-list.breed-list .cross-x { color: var(--ink-soft); font-weight: 400; padding: 0 2px; }

/* 3. Filter strip under the search box: chips scroll sideways on phone,
   count sits inside each chip (existing .chip .count). */
.breed-filters { margin: -6px 0 10px; }
.breed-filters .chips { padding-bottom: 4px; }
.breed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.breed-toolbar .segmented { flex: none; }
.breed-toolbar .muted { flex: 1 1 auto; min-width: 0; font-size: 14px; }

/* 4. Service picker inside the edit sheet / detail card: a tick list of the
   eleven catalogue services, grouped, each row a shared .check. */
.svc-pick { list-style: none; margin: 0; padding: 0; }
.svc-pick > li { border-bottom: 1px solid var(--hairline); }
.svc-pick > li:last-child { border-bottom: 0; }
.svc-pick .group { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 12px 0 4px; font: 700 12.5px/1 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 0; }
.svc-pick .group .svc-group-actions { gap: 10px; text-transform: none; font-weight: 600; letter-spacing: normal; }
.svc-pick .check { min-height: 52px; align-items: center; padding: 6px 0; cursor: pointer; }
.svc-pick .check > div { flex: 1 1 auto; min-width: 0; }
.svc-pick .check b { display: block; font-size: 16px; }
.svc-pick .check .meta { display: block; font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.svc-pick .check .pr { font: 600 17px/1 var(--display); color: var(--ink); flex: none; }

/* 5. Sheet / detail header: illustration + name + one line of facts. */
.breed-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.breed-head h2 { margin: 0; text-align: left; font-size: 22px; }
.breed-head .facts { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.block-popover .breed-head h2 { text-align: left; }

/* 6. Alias chips: an existing .chip with a remove cross; the add row is a
   .field input + .btn.ghost.sm side by side. */
.alias-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.alias-chips .chip { min-height: 40px; padding-right: 6px; }
/* Same reset as .iconbtn (shared icon-only button component): without it
   this <button> keeps its native browser border/background, which
   border-radius:50% then clips into a half-drawn-looking arc instead of a
   clean circle. */
.alias-chips .chip .x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; padding: 0; color: var(--ink-soft); cursor: pointer; }
.alias-chips .chip .x:hover { background: var(--cool); }
.alias-chips .chip .x svg { width: 14px; height: 14px; }
.alias-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.alias-add .field { margin: 0; }

/* 7. Two-pane on desktop: the staff grid with a wider list, the detail card
   sticky so the list can be long. Phone keeps the list only; editing opens
   the bottom sheet. */
@media (min-width: 900px) {
  .staff-grid.breeds { grid-template-columns: 460px minmax(0, 1fr); }
  .staff-grid.breeds .svc-pick .check { min-height: 44px; padding: 3px 0; }
}
@media (max-width: 899px) {
  .staff-grid.breeds .stack { display: none; }
}

/* 8. Sheet sizing: edit sheet is the block-sheet on phone; on desktop the
   same markup lives in the right pane so no popover is needed. The confirm
   is the existing appConfirm dialog untouched. */
.breed-sheet { width: min(640px, calc(100vw - 48px)); }
@media (max-width: 650px) {
  .breed-sheet.block-sheet { max-height: calc(100dvh - 24px); }
}
.sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* 9. Empty list after a search. Existing .empty; the illustration circle
   holds a paw. */
.breed-empty { padding-top: 28px; }
/* ===== Breeds END ===== */

/* ===== Move dog (design/move-dog-v1/SPEC.md) START ===== */
.move-dog-sheet { width: min(640px, calc(100vw - 48px)); }
@media (max-width: 650px) {
  .move-dog-sheet.block-sheet { max-height: calc(100dvh - 24px); }
}
.dog-card-actions [data-move-dog] { margin-left: auto; }
.move-dog-sheet .move-new-client { margin-top: 10px; }
.move-dog-sheet .move-new-client[open] > summary { margin-bottom: 8px; }
.move-route { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.move-route .person-tile { width: 40px; height: 40px; border-radius: 50%; font-size: 14px; }
.move-route-label { font-size: 14px; line-height: 1.3; }
.move-route-arrow { flex: none; color: var(--muted); }
.move-lists { display: grid; gap: 16px; margin: 14px 0; }
@media (min-width: 560px) {
  .move-lists { grid-template-columns: 1fr 1fr; }
}
.move-lists .kicker { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* ===== Move dog END ===== */

/* ===== Dog size for pricing + Rebook (design/dog-size-rebook-v1/SPEC.md,
   Fable 3 Nov 2026). Copied from mockups/dog-size-rebook.css as one block.
   Everything else on these screens is an existing component. ===== */

/* 1. Booking drawer card-head: two small actions side by side (Rebook, Edit
   booking). The head already wraps; this only keeps the pair together. */
.card-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
@media (max-width: 650px) { .booking-summary-card .card-head-actions { flex-basis: 100%; justify-content: flex-start; } }

/* 2. "No size yet" in the drawer head: same dashed pill as Breeds' "Not set",
   but it is a link to the dog card (keeps the textlink focus ring). */
a.pill.unset { text-decoration: none; cursor: pointer; }
a.pill.unset:hover { border-style: solid; color: var(--ink); }

/* 3. Rebook sheet: the "from" line is a third line inside the chosen-dog
   block; the weeks field is a normal .field sharing a row with Date. */
.qb-dog-chosen [data-qb-rebook-from] { display: block; margin-top: 2px; }

/* 4. Size picker inside the service-recommendation notice (no-size case):
   four ghost buttons in the same grid the recommendation choices use. */
.size-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.size-choices .btn { display: grid; gap: 2px; justify-items: start; align-content: center; height: auto; min-height: 44px; padding: 8px 12px; white-space: normal; text-align: left; line-height: 1.3; }
.size-choices .btn small { display: block; font: 400 12.5px/1.3 var(--text); color: var(--ink-soft); }
@media (min-width: 900px) { .size-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 4b. A button inside a notice keeps button colours (the notice's link rule
   would otherwise paint it --link). */
.notice .btn { color: var(--ink); }
.notice .btn:not(.ghost) { color: #fff; }

/* 5. Settings > Breeds > Dogs needing a size: the .rows list with a size
   picker per row. Phone: picker below the name block; desktop: inline. */
.needs-size li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.needs-size li > .dog-pic, .needs-size li > .dog-pic-initials { grid-row: 1 / span 2; width: 44px; height: 44px; font-size: 16px; }
.needs-size .who { min-width: 0; }
.needs-size .who b { font: 600 16px/1.2 var(--display); }
.needs-size .who span { font-size: 13.5px; }
.needs-size .size-choices { grid-column: 2; }
.needs-size .size-choices .btn { min-height: 40px; font-size: 14px; }
.needs-size .size-choices .btn small { display: none; }
.needs-size li.is-set .size-choices { display: none; }
.needs-size .who .set { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.needs-size .who .set .pill { display: inline-flex; width: auto; }
@media (min-width: 900px) {
  .needs-size li { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .needs-size .size-choices { grid-column: 3; grid-row: 1 / span 2; grid-template-columns: repeat(4, auto); }
}
/* ===== Dog size for pricing + Rebook END ===== */

/* Ryan 4 Nov 09:16: on the two-column staff page the staff list stays in
   view while the record scrolls, instead of scrolling away. Scrolls inside
   itself if the list is taller than the window.
   Side column that stays in view under the pinned page header (staff list,
   breeds detail). --sticky-h is the pinned .page-header height published by
   STICKY_BAR_JS; --bar-h is the phone app bar (0 on the desktop rail). */
@media (min-width: 900px) {
  .staff-grid > .staff-list-card {
    position: sticky;
    top: calc(var(--bar-h) + var(--sticky-h, 0px) + 16px);
    max-height: calc(100dvh - var(--bar-h) - var(--sticky-h, 0px) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Breeds list is the scrolling page, not a side column: undo the sticky
     scroll-container treatment above wholesale (not just max-height), or a
     mouse wheel over the list does nothing - the list stays visually
     pinned to the sticky top offset instead of scrolling away with the
     page, and overscroll-behavior:contain has nothing to contain so it
     just sits there looking broken. The detail pane (.stack) keeps the
     sticky treatment from the shared rule above. */
  .staff-grid.breeds > .stack {
    position:sticky;
    top:calc(var(--bar-h) + var(--sticky-h, 0px));
    height:calc(100dvh - var(--bar-h) - var(--sticky-h, 0px));
    max-height:none; overflow-y:auto; overscroll-behavior:contain;
    background:var(--white); border:1px solid var(--hairline); border-radius:var(--radius-soft);
  }
  .staff-grid.breeds > .stack > .card { margin:0; min-height:100%; border:0; border-radius:0; box-shadow:none; }
  .staff-grid.breeds .staff-list-card { position: static; max-height: none; overflow: visible; overscroll-behavior: auto; }
}

/* DESIGN-REBOOK.md §3.3 (items 8+9): Find a time in the Quick book / Rebook sheet. Append-only. */
.quick-book-popover .qb-find-time{display:flex;flex-direction:column;gap:6px}
.quick-book-popover [data-qb-find-time]{width:100%}
.quick-book-popover .qb-search-options>summary{cursor:pointer;font-size:13px;color:var(--muted, inherit)}
.quick-book-popover .qb-search-options[open]>summary{margin-bottom:8px}

/* Shared navigation: keep chrome visually stable while native same-origin
   documents load. No private-HTML cache, router, or script re-execution.
   Browsers without View Transitions retain ordinary native navigation. */
@view-transition { navigation: auto; }
.appbar { view-transition-name: app-chrome; }
.tabbar { view-transition-name: mobile-navigation; }
::view-transition-group(*) { animation-duration: 120ms; }
::view-transition-old(app-chrome),
::view-transition-old(mobile-navigation) { animation: none; opacity: 0; }
::view-transition-new(app-chrome),
::view-transition-new(mobile-navigation) { animation: none; mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* Shared setting rows: full-width cards, readable columns on large screens. */
@media (min-width:1100px){ .rows.responsive-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px;} .rows.responsive-columns li{min-width:0;} }

/* booking panel */
.booking-panel-staff{align-items:center;gap:8px}
.booking-panel-client{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
[data-booking-panel-note-form]{align-items:center;gap:8px;margin-top:10px}
[data-booking-panel-note-form] input{flex:1;min-width:160px}
@media (max-width:650px){ [data-booking-panel-note-form] input{min-width:0} }

/* inbox rail (WP-B, DESIGN-REVIEW.md §2, §3.3 item 8, P2-8): the rail
   reuses .visit-entry as-is (same CSS as the client record, D2) - these
   rules only cover the rail-specific anchor wrapper and the thread-head
   name/pill fix, nothing already styled elsewhere. */
.context-rail .visit-entry-list{list-style:none;margin:0;padding:0}
.context-rail .visit-entry-list .visit-entry{padding:10px 0}
.context-rail .visit-entry-link{display:flex;align-items:flex-start;gap:12px;width:100%;color:inherit;text-decoration:none;border-radius:8px;margin:0 -6px;padding:4px 6px}
.context-rail .visit-entry-link:hover,.context-rail .visit-entry-link:focus-visible{background:var(--cool)}
.context-rail .visit-entry-link .dog-pic,.context-rail .visit-entry-link .avatar{margin-top:2px}
.context-rail .visit-entry-link > .dog-pic{width:40px;height:40px;font-size:14px}
.context-rail .visit-entry-list .visit-entry:last-child{padding-bottom:0;border-bottom:0}
.context-rail .visit-entry-meta .agenda-staff-name{max-width:120px}
.thread-head .who strong.name-tight{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.thread-head .iconbtn.is-static{cursor:default;opacity:.55}

/* Offers (design/2026-11-08-website-v2/DESIGN.md §4.3/§8). Reuses .rows,
   .pill, .num, .switch, .notice, .field, .segmented exactly as the
   Services/Breeds settings pages - no new layout primitives. */
.offer-preview-sentence{font-size:.95rem;color:var(--ink-soft,#555);margin:8px 0 4px}
.offer-preview-sentence b{color:var(--ink,#13263B)}
.offer-rows .num{font-weight:600}
/* The offers list row's trailing pills/number/pause form can be squeezed
   at phone width by the row's flex layout; keep each piece on one line
   and let the row wrap as a whole instead of wrapping pill text. */
.rows li .pr .pill{white-space:nowrap;flex-shrink:0}
.rows li .pr{flex-wrap:wrap;justify-content:flex-end;gap:6px}

/* services merge: a grouped service row (item 20, design/2026-11-08-ryan-
   batch/ITEMS.md) nests a size-band sub-list inside one top-level .rows li.
   The default .rows li is a space-between row of two inline children; a
   full-width nested .rows list needs to stack below the heading instead -
   no existing .rows/.card rule expresses that, so this is the minimal
   addition rather than a page-specific copy of .rows itself. */
.rows > li:has(> ul.rows){flex-direction:column;align-items:stretch;gap:6px}
.rows > li:has(> ul.rows) > .row-copy{flex:unset}

/* Settings search (design/2026-11-09-settings-ia/PROPOSAL.md §3, rebuilt
   9 Nov per Ryan): the field itself is the exact breed-search component
   (.search.field + I.search, see breed-settings.ts) - no one-off input
   skin here. Sits at the end of the category-tabs row, collapsed to a
   plain .iconbtn magnifier so it never stacks as a second full-width box
   under a page's own search (e.g. Breeds); click/"/" expands it. */
.settings-tabs-row { display: flex; align-items: center; gap: 10px; position: relative; }
.settings-tabs-row .settings-tabs { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.settings-search { position: relative; flex: 0 0 auto; display: flex; align-items: center; }
.settings-search[data-collapsed="true"] .search.field { width: 0; opacity: 0; pointer-events: none; }
.settings-search[data-collapsed="false"] #settings-search-toggle { display: none; }
.settings-search .search.field { overflow: hidden; transition: width .15s ease, opacity .15s ease; }
@media (prefers-reduced-motion: reduce) { .settings-search .search.field { transition: none; } }
/* Expanded search never takes width from the tab row: it detaches from the
   flex flow and overlays, anchored top-right of the row (so the six
   category tabs never reflow or get a scrollbar while typing). */
.settings-search[data-collapsed="false"] { position: absolute; top: calc(100% + 6px); right: 0; z-index: 21; background: var(--white); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; }
.settings-search[data-collapsed="false"] .search.field { width: 280px; max-width: calc(100vw - 2 * var(--gutter)); opacity: 1; }
.settings-search-results { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--white); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 60vh; overflow-y: auto; width: 280px; max-width: 90vw; }
@media (max-width: 650px) {
  .settings-search[data-collapsed="false"] { right: var(--gutter); left: var(--gutter); top: calc(100% + 6px); background: var(--paper); box-shadow: none; border: 0; padding: 0; }
  .settings-search[data-collapsed="false"] .search.field { width: 100%; max-width: none; flex: 1 1 auto; }
  .settings-search-results { left: 0; width: auto; }
}
.settings-search-results li { border-radius: 8px; }
.settings-search-results li a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-height: 44px; justify-content: center; text-decoration: none; color: var(--ink); border-radius: 8px; }
.settings-search-results li a:hover, .settings-search-results li[aria-selected="true"] a { background: var(--cool); }
.settings-search-results li a span { font-size: 13px; color: var(--ink-soft); }
.settings-search-results li.no-results { padding: 10px; color: var(--ink-soft); min-height: 44px; display: flex; align-items: center; }
.settings-search-highlight { animation: settings-search-flash 2.2s ease-out; border-radius: 10px; }
@keyframes settings-search-flash { 0% { background: var(--gold, #f6d98a); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .settings-search-highlight { animation: none; background: var(--gold, #f6d98a); } }
/* Never a native scrollbar on the settings tab rows (six categories fit
   one line at common desktop widths once search no longer squeezes them;
   where they can't, e.g. phone, use the same hidden-scrollbar + right-edge
   fade affordance as .inbox-tools .chips/.quick-replies). */
[data-settings-section], .card[id][data-settings-section] { scroll-margin-top: calc(var(--bar-h, 0px) + var(--sticky-h, 0px) + 16px); }
.settings-tabs, .settings-subtabs { scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar, .settings-subtabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.settings-tabs[data-can-scroll-right], .settings-subtabs[data-can-scroll-right] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
/* Mouse and trackpad users cannot swipe a hidden-scrollbar rail, so on hover-capable screens the settings
   menus wrap onto a second line and every tab stays visible and clickable. Touch keeps the swipe rail. */
@media (hover: hover) and (pointer: fine) {
  .settings-tabs, .settings-subtabs { flex-wrap: wrap; overflow: visible; column-gap: 22px; row-gap: 0; }
  .settings-tabs[data-can-scroll-right], .settings-subtabs[data-can-scroll-right] { -webkit-mask-image: none; mask-image: none; }
}
/* Theo, 15 Nov 2026: with 8 top-level categories (Team..Advanced) the
   22px column-gap above pushed "Advanced" onto a second row at common
   desktop widths (measured: 1120px available, 1047px of label text, 7
   gaps needed <= 74px total to fit - 22px/gap summed to 154px). Narrower
   gap only, never smaller text, keeps every category on one row without
   touching .settings-subtabs (those stay on the 22px gap - they're never
   as crowded) or the 768/390 wrap-or-scroll behaviour above. */
@media (hover: hover) and (pointer: fine) and (min-width: 1200px) {
  .settings-tabs { column-gap: 8px; }
}

/* Shared responsive rows with potentially wide actions: allow the copy and
   controls to occupy their own line before either becomes unreadable. */
.rows > li.row-responsive { flex-wrap: wrap; }
.rows > li.row-responsive > .row-copy { flex: 1 1 180px; }
.rows > li.row-responsive > .row-action { min-width: 0; max-width: 100%; }
.rows > li.row-responsive > .row-action-field { flex: 1 1 240px; }
.rows > li.row-responsive > .row-action-field select { width: 100%; min-width: 0; }
/* A row's field action (e.g. Legacy merge target + Merge) uses the shared .field control styling with its
   button beside it at the same height, wrapping under the select only when the row is too narrow. */
.rows > li.row-responsive > .row-action-field.field { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0; }
.rows > li.row-responsive > .row-action-field.field > select { flex: 1 1 200px; width: auto; }
.rows > li.row-responsive > .row-action-field.field > .btn { flex: 0 0 auto; min-height: 0; }
.rows > li.row-responsive .iconbtn:disabled { opacity: .35; cursor: default; }

/* Settings navigation stays in the same place across pages on compact
   screens; page-specific actions follow the shared category/subtab row. */
@media (max-width: 899px) {
  .page-header:has(.settings-tabs-row) { display: flex; flex-direction: column; }
  .page-header:has(.settings-tabs-row) .page-header-main { display: contents; }
  .page-header:has(.settings-tabs-row) .page-header-back { order: 0; margin: 6px var(--gutter); }
  .page-header:has(.settings-tabs-row) .page-header-row { order: 1; }
  .page-header:has(.settings-tabs-row) .page-header-actions,
  .page-header:has(.settings-tabs-row) .page-header-controls { order: 2; margin: 0; padding: 0 var(--gutter) 8px; }
}

/* Shop products P1 (15 Nov 2026): products list controls, filter sheet
   and row thumbnails. Reuses .search.field, .segmented, .chips, .rows,
   .pill and .groomer-sheet exactly; this block only adds the layout glue
   those shared components need for the products list. */
#products-page .toolbar { margin-top: 4px; }
#products-page .product-row-link { gap: 12px; }
.shop-controls-desktop { display: flex; }
#product-filter-trigger { display: none; }
@media (max-width: 767px) {
  .shop-controls-desktop { display: none !important; }
  #product-filter-trigger { display: inline-flex; }
}
.filter-sheet:not(:modal) { display: none; }
.filter-sheet .groomer-sheet-list { max-height: calc(min(80dvh, 560px) - 54px); }
