/* SHARC visual identity: "Clean Sky" (Claude Design, 6 Nov 2026), agreed with SHARC.
   Plain and readable, after the practice-management system Geoff pointed us at: Aptos, the logo's
   navy and sky blues, a light menu under the logo on its own band, field labels bold in the
   theme's navy with the data beside them in plain weight. Names that say "petrol"/"teal" are the
   old palette's slots; they now hold the navy family. */
:root {
  --ink:#14213F; --ink-2:#4E5D78; --ink-3:#7D8AA3;
  --petrol-800:#13234D; --petrol-700:#25418A;
  --teal-600:#2F4F9E; --teal-500:#3A5CAD;
  --aqua-300:#8FA8D8; --aqua-150:#D8E3F2;
  --mist:#EBF0F8; --paper:#F5F8FC; --card:#FFFFFF; --line:#DCE4F0;
  /* Subdivision rules, for a grid that has to show more than one level without reading as graph
     paper: --line-2 for the halfway rule, --line-3 for the finest. */
  --line-2:#E4EAF3; --line-3:#ECF0F7;
  --good:#2E7D5B; --good-bg:#E3F0E9;
  --warn:#A8731F; --warn-bg:#F6EDDC;
  --alert:#B23A2E; --alert-bg:#F7E6E3;

  /* Aptos is Microsoft's Office font: present on machines with Microsoft 365, not on Google
     Fonts, and not licensed here for serving from the site. Segoe UI stands in elsewhere. */
  --font-ui:Aptos,"Aptos Display","Segoe UI",system-ui,-apple-system,Roboto,sans-serif;
  --font-mono:"IBM Plex Mono",ui-monospace,Consolas,monospace;

  --r-lg:16px; --r-md:10px; --r-sm:6px;
  --shadow-card:0 1px 2px rgba(17,52,60,.06), 0 4px 14px rgba(17,52,60,.05);
  --sidebar-w:236px;
  --focus:0 0 0 3px rgba(37,65,138,.22);

  --side-bg:#E4ECF7;        /* the menu: the same pale blue as the table headings */
  --side-brand-bg:#C3D4EC;  /* the band behind the logo, a step darker */
  --label:#25418A;          /* field labels and table headings */
  --band:#E4ECF7;           /* table-heading background */
  --link:#2F5FB3;           /* a link inside a table row */
  /* SC-174: diary time outside a calendar's opening hours — a grey hatch, distinct from a note's
     paler stripes and from the amber of a day closed to online booking. */
  --diary-shut:repeating-linear-gradient(-45deg,#E6EAF0,#E6EAF0 4px,#F1F3F7 4px,#F1F3F7 9px);
}

/* SC-174: a board column's closed hours. Takes clicks so empty grid there can't open the form. */
.pt-diary-shut { background:var(--diary-shut); cursor:not-allowed; }

* { box-sizing:border-box; }
html,body { margin:0; padding:0; height:100%; background:var(--paper); }
body { font-family:var(--font-ui); font-size:15px; line-height:1.55; color:var(--ink);
  -webkit-font-smoothing:antialiased; }
a { color:var(--link); text-decoration:none; }
a:hover { color:var(--petrol-700); }
h1 { font-size:26px; font-weight:650; letter-spacing:-.02em; line-height:1.15; margin:0 0 4px; color:var(--ink); }
h2 { font-size:19px; font-weight:650; letter-spacing:-.015em; margin:0 0 12px; color:var(--ink); }
h3 { font-size:15px; font-weight:650; margin:0 0 8px; color:var(--ink); }
p { margin:0 0 12px; color:var(--ink-2); }
code { font-family:var(--font-mono); font-size:.85em; background:var(--mist); color:var(--petrol-700);
  padding:1px 6px; border-radius:var(--r-sm); }

/* ═══════════════════════════════════════════════════════════
   Design-system primitives (cascade-tokens.css)
   ═══════════════════════════════════════════════════════════ */
/* Card — one component, three variants. Pages must NOT set padding inline;
   use the base padding or a modifier below so every card matches system-wide.
   .flush  → full-bleed content (a table/list that reaches the card edges)
   .empty  → centered empty-state / placeholder */
.cd-card { background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-card); padding:18px 20px; }
.cd-card.flush { padding:0; }
.cd-card.empty { padding:44px 20px; text-align:center; color:var(--ink-3); }
.cd-card.tile { padding:18px 14px; text-align:center; }
.cd-chip {
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:600; letter-spacing:.02em;
  padding:3px 9px; border-radius:999px; white-space:nowrap;
}
.cd-chip.good  { background:var(--good-bg);  color:var(--good); }
.cd-chip.warn  { background:var(--warn-bg);  color:var(--warn); }
.cd-chip.alert { background:var(--alert-bg); color:var(--alert); }
.cd-chip.info  { background:var(--mist);     color:var(--petrol-700); }
.cd-chip.ghost { background:transparent; border:1px solid var(--line); color:var(--ink-2); }
/* Solid chips: the day sheet's Treatment and Payment buttons, which need to stand out from the row.
   Draft is amber with dark text, as white on amber is too faint to read. */
.cd-chip.solid { font-size:11.5px; padding:5px 11px; box-shadow:0 1px 2px rgba(0,0,0,.18); }
.cd-chip.solid.good  { background:var(--good);  color:#fff; }
.cd-chip.solid.alert { background:var(--alert); color:#fff; }
.cd-chip.solid.warn  { background:#F2A33A;      color:#3A2400; }
.cd-chip.solid:hover { filter:brightness(1.08); }

.cd-dot { width:7px; height:7px; border-radius:99px; flex-shrink:0; }

.cd-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  font-family:var(--font-ui); font-weight:600; font-size:14px;
  border-radius:var(--r-md); border:1px solid transparent;
  padding:11px 18px; cursor:pointer;
}
.cd-btn.primary { background:var(--petrol-700); color:#fff; }
.cd-btn.primary:hover { background:var(--petrol-800); }
.cd-btn.secondary { background:var(--mist); color:var(--petrol-700); }
.cd-btn.secondary:hover { background:var(--aqua-150); }
.cd-btn.outline { background:#fff; border-color:var(--line); color:var(--ink); }
.cd-btn.outline:hover { border-color:var(--aqua-300); }
/* The confirm button of an action that cannot be undone — cancelling an invoice (SC-89). */
.cd-btn.danger { background:var(--alert); color:#fff; }
.cd-btn.danger:hover { filter:brightness(1.08); }
.cd-btn.block { width:100%; }
.cd-btn.sm { padding:8px 13px; font-size:12.5px; }
.cd-btn.tiny { padding:6px 11px; font-size:12px; border-radius:8px; }
.cd-btn.icon { padding-left:9px; padding-right:9px; }

.cd-mono { font-family:var(--font-mono); }
/* SC-138: a form field's label, in the Clean Sky style of .pt-kv .k: bold, the theme's navy, normal
   case. Was the old 10.5px uppercase grey, which ~60 edit forms and pop-ups still showed. */
.cd-label { font-size:13px; font-weight:700; color:var(--label); }
.cd-h1 { font-size:26px; font-weight:650; letter-spacing:-0.02em; line-height:1.15; }
.cd-h2 { font-size:19px; font-weight:650; letter-spacing:-0.015em; }
.cd-h3 { font-size:15px; font-weight:650; }
.cd-sub { font-size:13px; color:var(--ink-2); }

.cd-ph {
  background:repeating-linear-gradient(-45deg, var(--mist), var(--mist) 6px, #F0F4FA 6px, #F0F4FA 12px);
  border:1px dashed var(--aqua-300); border-radius:var(--r-md);
  display:flex; align-items:center; justify-content:center;
  color:var(--teal-600); font-size:10.5px; font-weight:600; letter-spacing:.04em; text-align:center;
}

.cd-field { display:flex; flex-direction:column; gap:5px; }
.cd-input {
  border:1px solid var(--line); border-radius:var(--r-md); background:#fff;
  padding:10px 12px; font-family:var(--font-ui); font-size:14px; color:var(--ink); line-height:1.45;
}
.cd-input.filled { background:#FDFEFE; }
/* A public form held until its circuit connects (SC-132): a bare wrapper, and inputs that look
   quietly unavailable rather than broken while the page goes live. */
.live-gate { border:0; margin:0; padding:0; min-width:0; }
.live-gate:disabled .cd-input { background:var(--mist); cursor:progress; }
.live-gate:disabled, .live-gate:disabled button { cursor:progress; }
.live-pending { opacity:.55; pointer-events:none; cursor:progress; }

/* ═══════════════════════════════════════════════════════════
   Portal shell (portal.css)
   ═══════════════════════════════════════════════════════════ */
.pt-app { display:flex; height:100vh; font-family:var(--font-ui); color:var(--ink); overflow:hidden; }

/* ── sidebar ── */
/* overflow stays visible so the search results (SC-123) can spill out over the page; .pt-nav does
   its own scrolling, so nothing else in the column needs clipping. */
.pt-side {
  width:var(--sidebar-w); flex-shrink:0; background:var(--side-bg); color:var(--petrol-700);
  border-right:1px solid #CBD8EC;
  display:flex; flex-direction:column; height:100%; overflow:visible;
}
.pt-side-brand { display:flex; align-items:center; flex-shrink:0; padding:16px 18px 14px;
  background:var(--side-brand-bg); border-bottom:1px solid var(--line); }
.pt-side-brand a { display:block; width:100%; }
.pt-side-brand img { width:100%; height:auto; display:block; }
.pt-site {
  margin:0 12px 10px; padding:9px 11px; border-radius:10px; background:rgba(255,255,255,.07);
  display:flex; align-items:center; gap:9px; cursor:pointer;
}
.pt-site:hover { background:#fff; }
.pt-nav { flex:1; overflow-y:auto; padding:4px 12px 16px; scrollbar-width:none; }
.pt-nav::-webkit-scrollbar { display:none; }
.pt-nav-item {
  display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:9px;
  font-size:16px; font-weight:500; color:var(--petrol-700); cursor:pointer; margin-bottom:1px; text-decoration:none;
}
.pt-nav-item:hover { background:rgba(37,65,138,.08); color:var(--petrol-800); text-decoration:none; }
.pt-nav-item.active { background:var(--petrol-700); color:#fff; }
.pt-nav-item .pt-badge { margin-left:auto; }
/* A group in the menu (SC-127): Notifications opens and closes. Its toggle is a <button> (the phone
   drawer closes on any link click), so it opts out of the global button rule below: that rule's
   padding, fill, centring and press-nudge would all leak in. */
.pt-nav-toggle {
  width:100%; justify-content:flex-start; border:none; background:transparent; font:inherit;
  font-size:16px; font-weight:500; color:var(--petrol-700); padding:9px 10px; text-align:left;
}
.pt-nav-toggle:active { transform:none; }
.pt-nav-toggle svg { flex-shrink:0; }
.pt-nav-toggle > span:first-of-type { flex:1; }
.pt-nav-toggle .pt-badge { margin-left:0; }
.pt-nav-chev { color:var(--ink-3); transition:transform .15s ease; }
.pt-nav-chev.open { transform:rotate(90deg); }
/* The group's own item, while one of its pages is open: marked, but quieter than the page's item. */
.pt-nav-item.parent-active { font-weight:650; color:var(--petrol-800); background:rgba(37,65,138,.08); }
/* An entry under a menu item (the queues under Notifications, Vet reports under Patients): indented
   past the parent's icon, and a size down. */
.pt-nav-item.pt-nav-child { padding:7px 8px 7px 39px; gap:8px; font-size:14px; line-height:1.3; }
.pt-badge {
  min-width:19px; height:19px; padding:0 6px; border-radius:99px; background:var(--petrol-700);
  color:#fff; font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center;
}
.pt-badge.alert { background:var(--alert); }
.pt-user { display:flex; align-items:center; gap:10px; padding:12px 16px; border-top:1px solid rgba(37,65,138,.15); }

/* ── mobile drawer affordances (inert above the 820px breakpoint) ── */
.pt-burger {
  display:none; align-items:center; justify-content:center; width:38px; height:38px; flex-shrink:0;
  margin-left:-6px; padding:0; border:none; background:transparent; border-radius:9px;
  color:var(--ink-2); cursor:pointer;
}
/* The bare `button` rule below sets padding:11px 18px, which leaves a 2px content box here and
   flex-shrinks the icon to a hairline — hence the explicit padding:0 and no-shrink on the svg. */
.pt-burger svg { flex-shrink:0; }
.pt-burger:hover { background:var(--mist); color:var(--ink); }
.pt-scrim { display:none; }

/* ── main area ── */
.pt-main { flex:1; display:flex; flex-direction:column; min-width:0; height:100%; }
/* The phone-only strip that holds the burger (SC-123: there is no top bar on a desktop). Shown by the
   820px block further down. */
.pt-top {
  display:none; height:52px; flex-shrink:0; background:#fff; border-bottom:1px solid var(--line);
  align-items:center; padding:0 14px;
}
/* ── global search (sidebar, under the logo) ──
   .pt-gs is the positioning context the results dropdown anchors to; .pt-search is the pill.
   .pt-side-search is its slot in the sidebar column: it must not grow (flex:0 0 auto), or it would
   take height from the menu below it. */
.pt-side-search { flex:0 0 auto; padding:12px 12px 8px; }
.pt-gs { position:relative; width:100%; min-width:0; }
.pt-search {
  display:flex; align-items:center; gap:9px; background:var(--paper);
  border:1px solid var(--line); border-radius:10px; padding:8px 13px; color:var(--ink-3); font-size:13.5px;
  cursor:text;
}
.pt-search:hover { border-color:var(--aqua-300); }
.pt-search.open { border-color:var(--aqua-300); background:#fff; }
.pt-search:focus-within { border-color:var(--teal-500); background:#fff; }
/* The pill itself carries the focus treatment (:focus-within above), so this input opts out of the
   global input / input:focus rules further down — otherwise their border, padding and focus ring
   draw a second box inside the pill. */
.pt-gs-input {
  flex:1; min-width:0; max-width:none; border:none; background:transparent; padding:0; margin:0;
  font:inherit; font-size:13.5px; color:var(--ink); outline:none;
}
.pt-gs-input:focus { border:none; box-shadow:none; }
.pt-gs-input::placeholder { color:var(--ink-3); }
.pt-gs-clear {
  border:none; background:transparent; padding:2px; margin:-2px -3px -2px 0; display:flex;
  color:var(--ink-3); cursor:pointer; border-radius:5px;
}
.pt-gs-clear:hover { color:var(--ink); background:var(--mist); }
.pt-gs-spin {
  width:13px; height:13px; flex-shrink:0; border-radius:50%;
  border:2px solid var(--aqua-150); border-top-color:var(--teal-500);
  animation:pt-gs-spin .6s linear infinite;
}
@keyframes pt-gs-spin { to { transform:rotate(360deg); } }

/* The veil sits under the dropdown but over the page, so the click that dismisses the results
   never also lands on whatever is behind them. */
.pt-gs-veil { position:fixed; inset:0; z-index:40; }
/* Wider than the sidebar it hangs from, so names and invoice details are readable: it spills out over
   the page (.pt-side does not clip). The phone drawer pins it back inside the drawer. */
.pt-gs-pop {
  position:absolute; z-index:41; top:calc(100% + 6px); left:0; width:400px; max-width:calc(100vw - 24px);
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:0 4px 8px rgba(20,33,63,.07), 0 16px 40px rgba(20,33,63,.13);
  padding:6px; max-height:min(70vh, 460px); overflow-y:auto;
}
.pt-gs-group {
  font-size:10px; font-weight:650; letter-spacing:.07em; text-transform:uppercase;
  color:var(--ink-3); padding:9px 10px 5px;
}
.pt-gs-group:first-child { padding-top:5px; }
.pt-gs-item {
  display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:var(--r-md);
  color:var(--ink); text-decoration:none; cursor:pointer;
}
.pt-gs-item.active { background:var(--mist); }
.pt-gs-icon {
  width:27px; height:27px; flex-shrink:0; border-radius:8px; background:var(--petrol-700);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:650; letter-spacing:.02em;
}
.pt-gs-text { flex:1; min-width:0; }
.pt-gs-title {
  display:block; font-size:13px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pt-gs-meta {
  display:block; font-size:11.5px; color:var(--ink-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pt-gs-msg { padding:14px 12px; font-size:12.5px; color:var(--ink-3); text-align:center; }

/* ── client/patient search (appointment form) ──
   The booking form's one box over clients and patients. Shaped like the sidebar's search but sized
   as a form field, and its results are a three-column grid rather than a one-line-per-hit list.
   .cps is the positioning context the results anchor to. */
.cps { position:relative; }
.cps-box {
  display:flex; align-items:center; gap:9px; background:#fff;
  border:1px solid var(--line); border-radius:var(--r-md); padding:9px 12px;
  color:var(--ink-3); cursor:text;
}
.cps-box:hover { border-color:var(--aqua-300); }
.cps-box.open, .cps-box:focus-within { border-color:var(--teal-500); }
/* SC-61: the same red as .cd-input.invalid. Restated for the open/focused box, or the field turns
   teal again while it is still wrong. */
.cps-box.invalid, .cps-box.invalid:hover, .cps-box.invalid.open, .cps-box.invalid:focus-within {
  border-color:var(--alert); }
.cps-box.invalid:focus-within { box-shadow:0 0 0 3px rgba(178,58,46,.18); }
/* The box carries the focus treatment (:focus-within above), so this input opts out of the global
   input / input:focus rules — otherwise their border, padding and focus ring draw a second box
   inside this one. */
.cps-input {
  flex:1; min-width:0; max-width:none; border:none; background:transparent; padding:0; margin:0;
  font:inherit; font-size:14px; color:var(--ink); outline:none;
}
.cps-input:focus { border:none; box-shadow:none; }
.cps-input::placeholder { color:var(--ink-3); }
.cps-clear {
  border:none; background:transparent; padding:2px; margin:-2px -3px -2px 0; display:flex;
  color:var(--ink-3); cursor:pointer; border-radius:5px;
}
.cps-clear:hover { color:var(--ink); background:var(--mist); }
.cps-spin {
  width:13px; height:13px; flex-shrink:0; border-radius:50%;
  border:2px solid var(--aqua-150); border-top-color:var(--teal-500);
  animation:pt-gs-spin .6s linear infinite;
}

/* The veil sits under the results but over the form, so the click that dismisses them never also
   lands on a field behind them. Both sit above the modal's own stacking. */
.cps-veil { position:fixed; inset:0; z-index:60; }
.cps-pop {
  position:absolute; z-index:61; top:calc(100% + 5px); left:0; right:0;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:0 4px 8px rgba(20,33,63,.07), 0 16px 40px rgba(20,33,63,.13);
  /* SC-159 (Geoff, 19 Nov 2026): every match is listed now, so this box scrolls rather than the
     list being cut to a few rows; contained, so reaching its end does not scroll the form behind. */
  padding:5px; max-height:min(52vh, 400px); overflow-y:auto; overscroll-behavior:contain;
}
.cps-group {
  font-size:10px; font-weight:650; letter-spacing:.07em; text-transform:uppercase;
  color:var(--ink-3); padding:8px 9px 4px;
}
.cps-group:first-child { padding-top:4px; }
/* The name takes what is left; the two context columns are fixed, so breeds and owners line up
   down the list — that alignment is what makes it read as a grid rather than a run of text. */
.cps-row {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,30%) minmax(0,34%);
  align-items:center; gap:10px; width:100%; text-align:left;
  padding:7px 9px; border:none; border-radius:var(--r-md); background:transparent;
  font:inherit; color:var(--ink); cursor:pointer;
}
.cps-row.active { background:var(--mist); }
.cps-name { font-size:13px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cps-cell { font-size:11.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cps-msg { padding:13px 11px; font-size:12.5px; color:var(--ink-3); text-align:center; }
/* Under a group the search cut short: quieter than a row, so it is not mistaken for one. */
.cps-more { padding:3px 9px 6px; font-size:11.5px; font-style:italic; color:var(--ink-3); }

.pt-scroll { flex:1; overflow-y:auto; }
.pt-page { padding:22px 28px 40px; max-width:1280px; }
.pt-page.wide { max-width:none; }

/* ── page header ── */
.pt-ph { display:flex; align-items:flex-start; gap:14px; margin-bottom:20px; flex-wrap:wrap; }
.pt-ph > :first-child { flex:1 1 240px; min-width:0; }
/* Avatars/icon boxes lead some headers — keep them at intrinsic size, don't let
   the :first-child grow rule stretch them into a giant empty box. */
.pt-ph > .cd-avatar:first-child { flex:0 0 auto; }
.pt-crumb { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-3); margin-bottom:9px; }
.pt-crumb a { color:var(--teal-600); cursor:pointer; font-weight:600; }
.pt-crumb a:hover { text-decoration:underline; }

/* ── table ── */
.pt-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.pt-table thead th {
  text-align:left; font-size:13px; font-weight:700;
  color:var(--label); padding:11px 14px 10px; border-bottom:1.5px solid var(--line); white-space:nowrap;
  background:var(--band);
}
.pt-table tbody td { padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
.pt-table tbody tr { cursor:pointer; }
.pt-table tbody tr:hover td { background:var(--mist); }
.pt-table tbody tr:last-child td { border-bottom:none; }
/* Numbers in the page's own font, not a monospace one; tabular figures still line them up. */
.pt-num { font-variant-numeric:tabular-nums; }
/* A link inside a clickable row (the dashboard's client and breed): blue, underlined on hover,
   so it reads as its own way out of the row. */
a.pt-link { color:var(--link); }
a.pt-link:hover { color:var(--link); text-decoration:underline; }
/* The client's account ledger (SC-90): money columns on the right, and the rows are not links —
   only the Ref in each one is. */
.pt-ledger th.r, .pt-ledger td.r { text-align:right; white-space:nowrap; }
.pt-ledger tbody tr { cursor:default; }
.pt-ledger tbody tr:hover td { background:none; }

/* ── tabs ── */
.pt-tabs { display:flex; gap:24px; border-bottom:1px solid var(--line); margin-bottom:18px; }
.pt-tab { padding:0 1px 11px; font-size:13.5px; font-weight:600; color:var(--ink-3); cursor:pointer; border-bottom:2.5px solid transparent; margin-bottom:-1px; }
.pt-tab.active { color:var(--petrol-700); border-bottom-color:var(--petrol-700); }
.pt-tab:hover { color:var(--ink); }
/* The tabs are buttons (SC-139), for the keyboard; they keep the look they had as divs. */
.pt-tabs > .pt-tab { display:block; background:none; border-top:0; border-left:0; border-right:0;
  border-radius:0; line-height:inherit; text-align:left; transition:none; }
.pt-tabs > .pt-tab:active { transform:none; }
.pt-tabs > .pt-tab:focus-visible { outline:2px solid var(--teal-500); outline-offset:2px; border-radius:4px; }

/* ── segmented control ── */
.pt-seg { display:inline-flex; background:var(--mist); border-radius:9px; padding:3px; gap:2px; }
.pt-seg > div, .pt-seg > button { padding:6px 13px; font-size:12.5px; font-weight:600; border-radius:7px; color:var(--ink-2); cursor:pointer; background:transparent; border:none; }
.pt-seg > div.active, .pt-seg > button.active { background:#fff; color:var(--petrol-700); box-shadow:var(--shadow-card); }

/* ── date navigation (prev / today / next + jump-to picker) ── */
.pt-datenav { display:inline-flex; align-items:center; gap:6px; }
/* The bare input rule above stretches inputs to 100%/420px; the picker sits in a toolbar, so it
   sizes to its own content instead. */
.pt-datenav .cd-input.sm { width:auto; padding:7px 10px; font-size:12.5px; }
.pt-datenav .cd-btn.outline:disabled:hover { border-color:var(--line); }

/* ── diary side rail (SC-125): two month calendars and Skip ahead beside the board ──
   The rail replaces the header's date dropdown on a desktop-width window. Below the breakpoint
   (a laptop with the menu open, a tablet) the board needs the width more, so the rail goes and
   the dropdown comes back. 1200px leaves the board about 700px beside the menu and the rail. */
.pt-diary-shell { display:flex; align-items:flex-start; gap:16px; }
.pt-diary-main { flex:1; min-width:0; }
.pt-diary-rail { width:224px; flex-shrink:0; display:flex; flex-direction:column; gap:14px;
  position:sticky; top:16px; background:var(--card, #fff); border:1px solid var(--line);
  border-radius:var(--r-md); padding:12px 12px 14px; }
.pt-datenav .pt-datenav-date { display:none; }
@media (max-width:1200px) {
  .pt-diary-rail { display:none; }
  .pt-datenav .pt-datenav-date { display:inline-block; }
}

/* One month calendar (MiniMonth.razor). Its cells and arrows are buttons, so every rule here
   undoes the bare button rule below: padding, fill, white text, the press nudge. */
.mm-head { display:flex; align-items:center; gap:4px; margin-bottom:6px; min-height:24px; }
.mm-title { flex:1; text-align:center; font-size:13px; font-weight:700; color:var(--petrol-700); }
.mm-nav { padding:0; width:24px; height:24px; flex-shrink:0; background:transparent; color:var(--ink-2);
  border:1px solid transparent; border-radius:6px; }
.mm-nav:hover { background:var(--mist); color:var(--petrol-700); }
.mm-nav svg { flex-shrink:0; }
.mm-grid { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); row-gap:2px; }
.mm-dow { text-align:center; font-size:10.5px; font-weight:700; color:var(--ink-3); padding:2px 0 4px;
  text-transform:uppercase; letter-spacing:.03em; }
.mm-day { padding:0; height:26px; min-width:0; font-size:12px; font-weight:500; font-variant-numeric:tabular-nums;
  background:transparent; color:var(--ink); border:1px solid transparent; border-radius:0; }
.mm-day:hover { background:var(--mist); color:var(--petrol-700); }
.mm-day:active { transform:none; }
.mm-day.out { color:var(--ink-3); opacity:.6; }
/* The span the diary is showing: one band, rounded at its two ends, so a week reads as a week. */
.mm-day.on { background:#DCEBF7; color:var(--petrol-700); font-weight:700; }
.mm-day.on-start { border-top-left-radius:7px; border-bottom-left-radius:7px; }
.mm-day.on-end { border-top-right-radius:7px; border-bottom-right-radius:7px; }
.mm-day.on:hover { background:#C9DFF2; }
/* Today: a ring in the brand colour, which shows whether or not today is in the shaded span. */
.mm-day.today { border-color:var(--teal-500); border-radius:7px; font-weight:700; color:var(--petrol-700); }
/* Inside the shaded band today stays square, so the band has no notch; only the band's ends round. */
.mm-day.today.on { border-radius:0; }
.mm-day.today.on.on-start { border-top-left-radius:7px; border-bottom-left-radius:7px; }
.mm-day.today.on.on-end { border-top-right-radius:7px; border-bottom-right-radius:7px; }

.pt-rail-skip { border-top:1px solid var(--line); padding-top:12px; }
.pt-rail-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); margin-bottom:8px; }
.pt-rail-skip-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; }
.pt-rail-skip-btn { padding:6px 4px; font-size:11.5px; font-weight:600; background:#fff; color:var(--petrol-700);
  border:1px solid var(--line); border-radius:7px; white-space:nowrap; }
.pt-rail-skip-btn:hover { background:var(--mist); border-color:var(--teal-500); }

/* ── grids ── */
.pt-cards { display:grid; gap:16px; }

/* ── dashboard outstanding-work rows (full-width, expand in place) ── */
.pt-outstanding-head { display:flex; align-items:center; padding:15px 20px; cursor:pointer; }
/* A button (SC-139), for the keyboard, that looks as the clickable div did. */
button.pt-outstanding-head { width:100%; gap:0; justify-content:flex-start; text-align:left; border:0;
  border-radius:0; background:transparent; color:inherit; font-weight:inherit; transition:none; }
button.pt-outstanding-head:active { transform:none; }
button.pt-outstanding-head:focus-visible { outline:2px solid var(--teal-500); outline-offset:-2px; border-radius:var(--r-lg); }
/* --paper, not --mist: .cd-chip.info is mist-backed and would vanish into a mist hover. */
.pt-outstanding-head:hover { background:var(--paper); border-radius:var(--r-lg); }
.pt-outstanding-body { border-top:1px solid var(--line); }
/* Wide detail grids scroll inside their own row instead of stretching the page. */
.pt-outstanding-scroll { overflow-x:auto; }
.pt-outstanding-empty,
.pt-outstanding-loading { padding:26px 20px; text-align:center; color:var(--ink-3); font-size:12.5px; }
.pt-kpis { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }
@media (max-width:1080px) { .pt-kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* ── modal ── */
.pt-overlay { position:fixed; inset:0; background:rgba(20,33,63,.42); display:flex; align-items:center; justify-content:center; z-index:50; padding:30px; }
.pt-modal { background:#fff; border-radius:var(--r-lg); width:100%; max-width:480px; box-shadow:0 24px 60px rgba(20,33,63,.28); overflow:hidden; display:flex; flex-direction:column; max-height:calc(100vh - 60px); }
.pt-modal.wide { max-width:680px; }
.pt-modal.xwide { max-width:900px; }
.pt-modal-h { padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; flex:0 0 auto; }
.pt-modal-h h2 { font-size:17px; margin:0; }
.pt-modal-b { padding:20px 22px; overflow-y:auto; flex:1 1 auto; }
.pt-modal-f { padding:15px 22px; border-top:1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; background:var(--paper); flex:0 0 auto; }

/* ConfirmDialog: the step before a delete. A soft red disc with a bin beside the question. */
.pt-confirm { display:flex; align-items:flex-start; gap:14px; }
.pt-confirm-mark { width:40px; height:40px; border-radius:99px; background:var(--alert-bg); color:var(--alert);
  border:1px solid rgba(178,58,46,.18); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.pt-confirm-mark svg { flex-shrink:0; }
.pt-confirm-text { font-size:13.5px; line-height:1.55; color:var(--ink-2); padding-top:2px; min-width:0; overflow-wrap:anywhere; }
.pt-confirm-text b, .pt-confirm-text strong { color:var(--ink); font-weight:650; }
.pt-confirm-text p { margin:0 0 6px; }
.pt-confirm-text p:last-child { margin-bottom:0; }

/* ── misc portal primitives ── */
/* A record's fields: the label bold and in the theme's navy, the data beside it in plain weight. */
.pt-kv { display:grid; grid-template-columns:minmax(120px, 42%) minmax(0, 1fr); align-items:center; gap:16px;
  font-size:14px; padding:9px 0; border-bottom:1px solid var(--line); }
.pt-kv:last-child { border-bottom:none; }
.pt-kv .k { color:var(--label); font-weight:700; }
.pt-kv .v { font-weight:400; text-align:left; overflow-wrap:anywhere; }
.pt-kv > .cd-chip, .pt-kv > a { justify-self:start; }
.pt-sec-title { font-size:15px; font-weight:700; letter-spacing:.01em; margin:0 0 12px; color:var(--label); }

/* ── avatar ── */
.cd-avatar {
  display:flex; align-items:center; justify-content:center; border-radius:99px;
  color:#fff; font-weight:700; flex-shrink:0;
}

/* ═══════════════════════════════════════════════════════════
   Legacy classes (existing pages not yet converted)
   ═══════════════════════════════════════════════════════════ */
.kicker { display:inline-block; font-size:10.5px; font-weight:600; letter-spacing:.09em;
  text-transform:uppercase; color:var(--petrol-700); background:var(--mist);
  padding:4px 11px; border-radius:999px; margin-bottom:14px; }
.label { font-size:13px; font-weight:700; color:var(--label); }

.card, .panel { background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--shadow-card); padding:22px; margin:0 0 18px; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; margin:0 0 18px; }
.card-grid .card { margin:0; }
.stat .num { font-size:32px; font-weight:600; letter-spacing:-.02em; color:var(--teal-600); }
.stat .lbl { font-size:13px; font-weight:700; color:var(--label); }
.hero { background:var(--petrol-800); border:none; }
.hero h1 { color:#fff; } .hero .kicker { background:rgba(255,255,255,.10); color:var(--aqua-300); }
.hero p { color:var(--aqua-150); }

label { display:block; font-size:13px; font-weight:600; color:var(--ink); margin:0 0 14px; }
label > input, label > select { display:block; margin-top:6px; }
input, select, textarea { width:100%; max-width:420px; font:inherit; color:var(--ink); background:#fff;
  border:1px solid var(--line); border-radius:var(--r-md); padding:10px 12px; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--teal-500);
  box-shadow:var(--focus); }
input[type=checkbox] { width:auto; }

/* ── validation ──
   Blazor puts .invalid on a field bound through an EditForm once it has been validated, so the red
   border follows the framework rather than page-level bookkeeping. Every selector is qualified by
   .invalid: the bare input / input:focus rules above are deliberately not touched, since widening
   them leaks a border and a focus ring into the custom-styled inputs (the sidebar search, the
   client/patient search) that opt out of them. Both the border and the focus ring have to be
   restated, or a field the user is correcting turns teal again while still wrong. */
.cd-input.invalid, input.invalid, select.invalid, textarea.invalid { border-color:var(--alert); }
.cd-input.invalid:focus, input.invalid:focus, select.invalid:focus, textarea.invalid:focus {
  border-color:var(--alert); box-shadow:0 0 0 3px rgba(178,58,46,.18); }
/* The class ValidationMessage renders. Sits inside .cd-field, which is already a 5px-gap column. */
.validation-message { font-size:11.5px; font-weight:600; color:var(--alert); }
details summary { cursor:pointer; font-size:13px; color:var(--ink-2); margin:6px 0 12px; }

button, .btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; font:inherit;
  font-weight:600; padding:11px 18px; border:1px solid transparent; border-radius:var(--r-md);
  background:var(--petrol-700); color:#fff; cursor:pointer; transition:background .12s,transform .05s; }
button:hover, .btn:hover { background:var(--petrol-800); }
button:active { transform:translateY(1px); }
button:disabled { opacity:.45; cursor:default; }
.btn-secondary { background:var(--mist); color:var(--petrol-700); }
.btn-secondary:hover { background:var(--aqua-150); }
.btn-ghost { background:#fff; color:var(--ink); border-color:var(--line); }
.btn-ghost:hover { background:#fff; border-color:var(--aqua-300); }

/* ── SC-138: keyboard focus ──
   One visible ring, in the theme's navy, on anything reached with Tab. :focus-visible only, so a
   mouse click draws nothing. Inputs keep their own border-and-glow treatment above. */
a:focus-visible, button:focus-visible, .cd-btn:focus-visible, [role=button]:focus-visible,
summary:focus-visible, [tabindex]:focus-visible:not(input):not(select):not(textarea) {
  outline:2px solid var(--teal-500); outline-offset:2px; }

.slots { display:flex; flex-wrap:wrap; gap:9px; margin:6px 0 4px; }
.slot { background:#fff; color:var(--ink); border:1px solid var(--line); font-family:var(--font-mono);
  font-size:13px; padding:8px 14px; border-radius:var(--r-md); }
.slot:hover { border-color:var(--aqua-300); background:var(--mist); }
.slot.selected { background:var(--petrol-700); color:#fff; border-color:var(--petrol-700); }

table { width:100%; border-collapse:collapse; font-size:14px; }
/* SC-138: plain table headings match .pt-table's: bold navy on the pale-blue band, normal case. */
thead th { font-size:13px; font-weight:700; color:var(--label); background:var(--band);
  text-align:left; padding:10px 12px; border-bottom:1.5px solid var(--line); }
tbody td { padding:11px 12px; border-bottom:1px solid var(--line); color:var(--ink-2); }
tbody tr:nth-child(even) { background:#FAFCFE; }
tbody tr:hover { background:var(--mist); }

.badge { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; letter-spacing:.02em;
  padding:3px 9px; border-radius:999px; }
.badge.ok { background:var(--good-bg); color:var(--good); }
.badge.warn { background:var(--warn-bg); color:var(--warn); }
.badge.danger { background:var(--alert-bg); color:var(--alert); }
.badge.info { background:var(--mist); color:var(--petrol-700); }
.badge.muted { background:transparent; border:1px solid var(--line); color:var(--ink-2); }
.error { background:var(--alert-bg); border:1px solid #E9C8C2; color:var(--alert);
  border-radius:var(--r-md); padding:12px 14px; margin:0 0 16px; font-size:14px; }
.alert-info { background:var(--mist); border:1px solid var(--aqua-150); color:var(--petrol-700);
  border-radius:var(--r-md); padding:12px 14px; margin:0 0 16px; font-size:14px; }

.muted { color:var(--ink-3); font-size:13px; }
.mono { font-family:var(--font-mono); }
.row-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
ol, ul { color:var(--ink-2); }

/* legacy shell — kept for pages still using .content wrapper */
.content { width:100%; }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
/* The sidebar is far too wide for a phone. It used to reflow into a full-width wall of wrapping
   pills, which buried the actual page a screen and a half down and dropped the site switcher and
   the sign-out button entirely. Below 820px it leaves the flex flow and becomes an off-canvas
   drawer over a scrim instead, keeping its normal vertical layout — including those two blocks.
   The `nav-open` class on <body> is toggled by the burger script in App.razor, because MainLayout
   and NavMenu render as static SSR and cannot own an interactive handler. */
@media (max-width:820px) {
  .pt-app { flex-direction:column; height:auto; overflow:visible; }
  .pt-main { height:auto; }

  .pt-side {
    position:fixed; top:0; bottom:0; left:0; z-index:60;
    width:min(284px, 84vw); height:100%;
    transform:translateX(-100%); visibility:hidden;
    transition:transform .22s ease, visibility 0s linear .22s;
  }
  /* Hidden as well as off-screen while closed, so Tab cannot wander into it. */
  body.nav-open .pt-side { transform:none; visibility:visible; transition-delay:0s; box-shadow:0 16px 44px rgba(0,0,0,.4); }
  /* Freeze the page behind the open drawer so a swipe scrolls the nav, not the content. */
  body.nav-open { overflow:hidden; }

  .pt-scrim {
    display:block; position:fixed; inset:0; z-index:50; background:rgba(6,32,37,.55);
    opacity:0; pointer-events:none; transition:opacity .22s ease;
  }
  body.nav-open .pt-scrim { opacity:1; pointer-events:auto; }

  .pt-burger { display:inline-flex; }

  /* The drawer clips again, and the search results stay inside it. */
  .pt-side { overflow:hidden; }
  .pt-gs-pop { width:auto; right:0; max-width:none; }

  /* Keep the burger reachable once the page has scrolled. */
  .pt-top { display:flex; position:sticky; top:0; z-index:20; }
  .pt-page { padding:20px 16px; }

  /* Page headers carry an inline `flex:1` on their title block, which collapses its basis to 0 and
     wraps the heading a word per line beside the action buttons. Give it a row of its own. */
  .pt-ph > :first-child { flex-basis:100% !important; }
}
/* iPhones held sideways (844–932px) show the drawer or the desktop layout, and viewport-fit=cover
   runs the page under the notch: the sidebar and the page keep clear of it. Zero on anything
   without a notch, so a desktop browser is unaffected. */
.pt-side { padding-left:env(safe-area-inset-left, 0px); }
.pt-main { padding-right:env(safe-area-inset-right, 0px); }

/* ═══════════════════════════════════════════════════════════
   Phone (SC-139): below 768px the Portal is laid out as a native app — a compact app bar at the
   top, a tab bar along the bottom, the menu as a sheet, lists as rows, pop-ups full screen. Every
   rule is inside the media query, and every new element is display:none outside it, so a window
   768px and wider looks exactly as it did.
   ═══════════════════════════════════════════════════════════ */
.pt-tabbar, .pt-top-brand, .pt-top-title, .pt-sheet-head, .pt-user-name, .pt-signout-label,
.pt-diary-picker, .pt-phone-only { display:none; }
/* The dashboard's phone date button: wider, only the plain date box shows. */
.pt-datepick { display:contents; }
.pt-datepick-face { display:none; }

@media (max-width:767.98px) {
  :root { --tabbar-h:58px; --topbar-h:52px; }
  body { -webkit-tap-highlight-color:transparent; }

  /* ── app bar ──
     The logo while the page's own heading is in view; the heading, small and centred, once it has
     scrolled up under the bar (the `titled` class, set by the script in App.razor). Translucent, as
     a native bar is, with the page scrolling under it; clear of the notch. */
  .pt-app:has(.pt-tabbar) .pt-burger { display:none; }
  .pt-top {
    position:sticky; top:0; z-index:30; height:auto; justify-content:center; gap:10px;
    min-height:calc(var(--topbar-h) + env(safe-area-inset-top));
    padding:env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background:rgba(255,255,255,.9); -webkit-backdrop-filter:saturate(1.8) blur(14px); backdrop-filter:saturate(1.8) blur(14px);
  }
  .pt-app:not(:has(.pt-tabbar)) .pt-top { justify-content:flex-start; }
  .pt-top-brand { display:flex; align-items:center; height:var(--topbar-h); transition:opacity .18s ease; }
  .pt-top-brand img { height:20px; width:auto; display:block; }
  .pt-top-title {
    display:block; position:absolute; left:64px; right:64px; bottom:0; height:var(--topbar-h);
    line-height:var(--topbar-h); text-align:center; font-size:16px; font-weight:650; color:var(--ink);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
    opacity:0; transform:translateY(6px); transition:opacity .18s ease, transform .18s ease;
  }
  .pt-top.titled .pt-top-title { opacity:1; transform:none; }
  .pt-top.titled .pt-top-brand { opacity:0; pointer-events:none; visibility:hidden; transition:opacity .18s ease, visibility 0s linear .18s; }

  /* ── tab bar ── */
  .pt-tabbar {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:45;
    padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background:rgba(255,255,255,.94); -webkit-backdrop-filter:saturate(1.8) blur(14px); backdrop-filter:saturate(1.8) blur(14px);
    border-top:1px solid var(--line);
  }
  /* Links and the More button alike; the button opts out of the global button rule's fill, padding,
     radius and press-nudge. */
  .pt-tab-item {
    flex:1 1 0; min-width:0; height:var(--tabbar-h); display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:2px; padding:5px 2px 4px; margin:0;
    background:transparent; border:none; border-radius:0; color:var(--ink-2); font:inherit;
    font-size:11.5px; font-weight:600; line-height:1.2; text-decoration:none; cursor:pointer;
    -webkit-user-select:none; user-select:none;
  }
  .pt-tab-item:hover { background:transparent; color:var(--ink-2); }
  .pt-tab-item:active { transform:none; }
  .pt-tab-item span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  /* The icon sits in a pill that fills in for the current tab, Material-style, and tints while
     pressed. */
  .pt-tab-item svg {
    flex-shrink:0; box-sizing:content-box; width:24px; height:24px; padding:3px 16px; border-radius:99px;
    transition:background .15s ease;
  }
  .pt-tab-item:active svg { background:var(--mist); }
  .pt-tab-item[aria-current=page], .pt-tab-more[aria-expanded=true], .pt-tab-more.is-here {
    color:var(--petrol-700); }
  .pt-tab-item[aria-current=page] svg, .pt-tab-more[aria-expanded=true] svg, .pt-tab-more.is-here svg {
    background:var(--aqua-150); }
  /* With the menu open, More is the one lit, not the page's own tab as well. */
  body.nav-open .pt-tab-item[aria-current=page] { color:var(--ink-2); }
  body.nav-open .pt-tab-item[aria-current=page] svg { background:none; }
  .pt-phone-only { display:inline; }
  .pt-tab-item:focus-visible { outline:2px solid var(--teal-500); outline-offset:-4px; border-radius:12px; }

  /* Room under the page for the tab bar, so the last row can be scrolled clear of it. */
  .pt-app:has(.pt-tabbar) .pt-scroll { padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .pt-app:has(.pt-tabbar):has(.pt-fab) .pt-scroll { padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 76px); }

  /* ── the menu, as a sheet from the bottom (More) ──
     The 820px block makes it a drawer from the left; below 768px it rises from the bottom instead,
     over the tab bar, with a grab handle, a close button, and its own scrolling list. */
  .pt-scrim { z-index:65; background:rgba(20,33,63,.42); }
  .pt-side {
    top:auto; bottom:0; left:0; right:0; z-index:70; width:100%; height:auto;
    max-height:calc(100% - 40px - env(safe-area-inset-top));
    border-right:none; border-radius:20px 20px 0 0; background:#fff;
    padding-bottom:env(safe-area-inset-bottom);
    transform:translateY(105%); visibility:hidden;
    transition:transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
  }
  /* Hidden as well as off-screen while closed, so Tab and a screen reader cannot wander into it. */
  body.nav-open .pt-side { transform:none; visibility:visible; transition-delay:0s; box-shadow:0 -12px 40px rgba(20,33,63,.22); }
  .pt-side-brand { display:none; }
  .pt-side { padding-left:0; }
  .pt-main { padding-right:0; }
  .pt-sheet-head { display:flex; align-items:center; gap:10px; position:relative; flex-shrink:0;
    padding:20px 12px 4px 20px; }
  .pt-sheet-grip { position:absolute; top:8px; left:50%; width:40px; height:5px; margin-left:-20px;
    border-radius:99px; background:var(--line); }
  .pt-sheet-title { flex:1; min-width:0; font-size:17px; font-weight:700; color:var(--ink);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pt-sheet-close { width:44px; height:44px; padding:0; flex-shrink:0; border-radius:99px;
    background:var(--mist); color:var(--ink-2); }
  .pt-sheet-close:hover { background:var(--aqua-150); color:var(--ink); }
  .pt-sheet-close svg { flex-shrink:0; }
  .pt-side-search { padding:8px 16px 6px; }
  .pt-search { padding:10px 14px; }
  .pt-gs-pop { max-height:46vh; }
  .pt-nav { min-height:0; padding:4px 12px 10px; overscroll-behavior:contain; }
  .pt-nav-item, .pt-nav-toggle { min-height:48px; padding:11px 12px; }
  .pt-nav-item.pt-nav-child { min-height:44px; }
  .pt-nav-item:active { background:var(--mist); }
  .pt-user { padding:12px 16px; }
  .pt-user-name { display:block; font-size:12.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .pt-signout { min-height:44px; padding:0 14px !important; gap:8px; border:1px solid var(--line) !important;
    border-radius:var(--r-md); color:var(--ink); font-weight:600; font-size:14px; }
  .pt-signout-label { display:inline; }

  /* A record's avatar or photo leads the header (SC-139). The 820px rule giving the header's first
     child a row of its own would stretch it into a full-width bar; it keeps its size, and the name
     takes the rest of its row. */
  .pt-ph > .cd-avatar:first-child, .pt-ph > .pt-ph-lead { flex-basis:auto !important; }
  .pt-ph > .pt-ph-lead + div { flex:1 1 0 !important; min-width:0; }

  /* ── page ── */
  .pt-page { padding:12px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  .pt-ph { gap:10px; margin-bottom:14px; }
  .pt-ph h1, .pt-ph .cd-h1 { font-size:24px !important; }
  .pt-ph .pt-ph-lead .pt-patient-photo { width:64px !important; height:64px !important; }
  .pt-ph .pt-ph-lead { margin-right:2px !important; }
  /* The name has the rest of the lead's row to itself; the star and the actions go under it. */
  .pt-ph > .pt-ph-lead + div { flex:1 1 calc(100% - 90px) !important; }
  .pt-phone-hide { display:none !important; }
  /* An icon button whose words are dropped on a phone; the aria-label still says them. */
  .pt-phone-icon > span { display:none; }
  .pt-phone-icon { min-width:44px; padding-left:0 !important; padding-right:0 !important; }

  /* Tap targets: buttons at least 44px tall, segmented controls 44px with their inset. */
  .cd-btn:not(.tiny) { min-height:44px; }
  .cd-btn.icon { min-width:44px; }
  .pt-seg > div, .pt-seg > button { min-height:44px; display:inline-flex; align-items:center; justify-content:center; padding:6px 14px; font-size:14px; flex-shrink:0; white-space:nowrap; }
  /* A switcher with more options than the screen is wide (a client's five appointment periods)
     scrolls sideways inside itself rather than pushing the page wider. */
  .pt-seg { max-width:100%; overflow-x:auto; scrollbar-width:none; }
  .pt-seg::-webkit-scrollbar { display:none; }
  .pt-seg > div:active, .pt-seg > button:active { transform:none; }
  .cd-star { width:44px; height:44px; }
  .pt-crumb { margin-bottom:2px; }
  .pt-crumb a { display:inline-flex; align-items:center; min-height:44px; }

  /* Inputs at 16px, or iOS zooms the page in on every tap into a field. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size:16px !important; }

  /* Date controls on one line: the three buttons, and the date taking what is left. */
  .pt-datenav { display:flex; width:100%; }
  .pt-datenav .cd-input.sm { flex:1 1 auto; min-width:0; width:auto; max-width:none; padding:8px 10px; }
  .pt-datenav .pt-datenav-date { display:inline-block; }

  /* A page's toolbar (search, filters) takes the full width under the title. */
  .pt-ph-actions { flex-wrap:wrap; width:100%; }
  .pt-ph-searchbox { flex:1 1 100%; }
  .pt-ph-search { width:100% !important; max-width:none; }

  /* The page's one main action floats over the content, above the tab bar, as a native app's does. */
  .pt-fab {
    position:fixed; z-index:44; right:max(16px, env(safe-area-inset-right));
    bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
    min-height:54px; padding:0 20px 0 16px !important; border-radius:18px; font-size:15px;
    box-shadow:0 8px 20px rgba(20,33,63,.26), 0 2px 5px rgba(20,33,63,.16);
  }
  .pt-fab:active { transform:scale(.97); }

  /* Side-by-side layouts written inline (a record's two columns, a form's three fields to a row)
     stack into one column. Their cells' spans go with them, or a span of 4 would open new tracks. */
  .pt-page [style*="grid-template-columns"]:not(.pt-keep-cols),
  .pt-modal-b [style*="grid-template-columns"]:not(.pt-keep-cols) { grid-template-columns:minmax(0,1fr) !important; }
  .pt-page [style*="grid-template-columns"]:not(.pt-keep-cols) > *,
  .pt-modal-b [style*="grid-template-columns"]:not(.pt-keep-cols) > * { grid-column:auto !important; }
  .pt-kpis { gap:10px; }

  /* A record's tabs scroll sideways in one line instead of running off the page. The rule under
     them is a shadow, because the strip has to clip, and a border would be clipped with it. */
  .pt-tabs {
    flex-wrap:nowrap; gap:22px; overflow-x:auto; overflow-y:hidden; scrollbar-width:none;
    margin-left:-16px; margin-right:-16px; padding:0 16px; border-bottom:none;
    box-shadow:inset 0 -1px 0 var(--line); -webkit-overflow-scrolling:touch;
  }
  .pt-tabs::-webkit-scrollbar { display:none; }
  .pt-tab { flex:0 0 auto; white-space:nowrap; margin-bottom:0; padding:12px 1px 11px; font-size:14.5px; }
  /* --ink-3 is about 3.3:1 on the page; inactive tabs need 4.5:1. */
  .pt-tab, .pt-tab:hover { color:var(--ink-2); }
  .pt-tab.active, .pt-tab.active:hover { color:var(--petrol-700); }

  /* Rows answer a tap, not a hover: a hover background sticks after the finger has gone. */
  .pt-table tbody tr:hover td { background:none; }
  .pt-table tbody tr:active td { background:var(--mist); }

  /* ── dashboard ── */
  .pt-card-head { flex-wrap:wrap; gap:2px 8px; padding:14px 16px 10px !important; }
  .pt-card-head > .cd-sub { margin-left:0 !important; flex-basis:100%; }
  .pt-outstanding-head { padding:14px 16px; min-height:56px; }
  .pt-outstanding-head:hover { background:none; }
  .pt-outstanding-head:active { background:var(--paper); border-radius:var(--r-lg); }
  .pt-action-banner { flex-wrap:wrap; }

  /* The dashboard's header: the heading with a Reminders bell beside it; then the day as
     ‹ Sat 14 Nov ›, Today appearing only once you have moved off it; then Today | Overview across
     the width. */
  .pt-dash .pt-ph > :first-child { flex:1 1 calc(100% - 64px) !important; }
  .pt-dash .pt-dash-reminders { order:1; width:44px; height:44px; border-radius:12px; }
  .pt-dash .pt-datenav { order:2; gap:8px; }
  .pt-dash .pt-datenav > .cd-btn { min-width:44px; height:44px; border-radius:12px; }
  .pt-dash .pt-datenav > :first-child { order:1; }
  .pt-dash .pt-datenav > [aria-label="Next day"] { order:3; }
  .pt-dash .pt-datenav-today { order:4; }
  .pt-dash .pt-datenav-today[disabled] { display:none; }
  .pt-datepick { order:2; position:relative; display:flex; flex:1 1 auto; min-width:0; }
  .pt-datepick-face {
    display:flex; flex:1; align-items:center; justify-content:center; gap:8px; height:44px;
    border:1px solid var(--line); border-radius:12px; background:var(--card);
    font-size:15px; font-weight:600; color:var(--ink); white-space:nowrap; }
  .pt-datepick-face svg { color:var(--petrol-700); flex-shrink:0; }
  .pt-datepick:focus-within .pt-datepick-face { border-color:var(--teal-500); box-shadow:var(--focus); }
  /* The real date box, invisible over the face: a tap opens the phone's own picker. */
  .pt-datepick input.cd-input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
  .pt-dash .pt-dash-seg { order:3; width:100%; display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); border-radius:12px; }
  .pt-dash .pt-dash-seg > div { border-radius:9px; font-size:14.5px; }

  /* The day sheet, one card to an appointment (SC-139, reworked 14 Nov 2026 from the mobile
     mock-up): the time on the left; the patient; the breed and owner; the service and its length;
     then Treatment and Payment side by side, saying what pressing them does. Equipment, price and
     block are dropped; the patient's record has them. A flex row that wraps rather than a grid, so
     the breed and owner sit together on one line whatever their lengths. */
  .pt-daysheet-card { background:none; border:none; box-shadow:none; overflow:visible; }
  .pt-daysheet-card > .pt-card-head { flex-wrap:nowrap; align-items:baseline; padding:0 2px 10px !important; }
  .pt-daysheet-card > .pt-card-head .cd-h3 { font-size:17px; }
  .pt-daysheet-card > .pt-card-head > .cd-sub { flex-basis:auto; margin-left:auto !important; font-size:13px !important; text-align:right; }
  .pt-daysheet-card > :not(.pt-card-head):not(table) { background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg); }
  .pt-daysheet thead { display:none; }
  .pt-daysheet { display:block; }
  .pt-daysheet tbody { display:flex; flex-direction:column; gap:6px; }
  .pt-daysheet tbody tr {
    display:flex; flex-wrap:wrap; align-items:center; column-gap:10px; row-gap:0;
    padding:7px 10px 7px 14px; border:1px solid var(--line); border-radius:var(--r-lg);
    box-shadow:var(--shadow-card); }
  .pt-daysheet tbody tr, .pt-daysheet tbody tr:hover, .pt-daysheet tbody tr:nth-child(even) { background:var(--card); }
  .pt-daysheet tbody tr:active { background:var(--paper); }
  .pt-daysheet tbody tr td, .pt-daysheet tbody tr:active td { background:none; }
  .pt-daysheet tbody td { display:block; padding:0 !important; border:none; min-width:0; line-height:1.35; text-align:left !important; }
  .pt-daysheet .ds-time { order:1; flex:0 0 52px; font-size:17px; font-weight:700; }
  .pt-daysheet .ds-time a { color:var(--petrol-700); }
  .pt-daysheet .ds-patient { order:2; flex:1 1 calc(100% - 126px); font-size:16.5px; font-weight:700; color:var(--ink); }
  .pt-daysheet .ds-note { order:3; flex:0 0 36px; }
  .pt-daysheet .ds-note .cd-icon-btn { width:36px; height:36px; }
  .pt-daysheet .ds-note .cd-sub { display:none; }
  .pt-daysheet .ds-alert { order:4; flex:0 0 52px; }
  .pt-daysheet .ds-alert > span { justify-content:flex-start !important; }
  .pt-daysheet .ds-breed, .pt-daysheet .ds-client { font-size:13.5px; white-space:nowrap; overflow:hidden; }
  .pt-daysheet .ds-breed { order:5; flex:0 1 auto; max-width:60%; display:flex; align-items:center; }
  .pt-daysheet .ds-breed::after { content:"·"; margin-left:6px; color:var(--ink-3); }
  .pt-daysheet .ds-breed:has(> .cd-sub) { display:none; }
  .pt-daysheet .ds-client { order:6; flex:1 1 0; margin-left:-4px; }
  .pt-daysheet .ds-client a, .pt-daysheet .ds-breed > span { display:block; min-height:26px; line-height:26px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .pt-daysheet .ds-service { order:7; flex:1 1 100%; padding-left:62px !important; font-size:13.5px !important; color:var(--ink); }
  .pt-daysheet .ds-service:not([data-dur=""])::after { content:" · " attr(data-dur); color:var(--ink-2); }
  .pt-daysheet .ds-treat { order:8; }
  .pt-daysheet .ds-pay { order:9; }
  .pt-daysheet .ds-treat, .pt-daysheet .ds-pay { flex:1 1 calc(50% - 5px); margin-top:6px; }
  /* The buttons say what pressing does ("Finish notes", "Take £48.50") from data-phone; the words
     for wider windows (Add, Draft, View) stay in the button, at no size. */
  .pt-daysheet .ds-treat .cd-chip, .pt-daysheet .ds-pay .cd-chip {
    width:100%; min-height:38px; padding:0 12px; gap:8px; border-radius:12px; font-size:0 !important;
    justify-content:flex-start !important; border:1px solid rgba(20,33,63,.14) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 2px 4px rgba(20,33,63,.18); }
  .pt-daysheet .ds-treat .cd-chip::after, .pt-daysheet .ds-pay .cd-chip::after {
    content:attr(data-phone); font-size:15px; font-weight:700; line-height:1.2; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis; }
  .pt-daysheet .ds-treat .cd-chip::before, .pt-daysheet .ds-pay .cd-chip::before {
    content:""; width:18px; height:18px; flex-shrink:0; background:currentColor;
    -webkit-mask:var(--ds-icon) center/contain no-repeat; mask:var(--ds-icon) center/contain no-repeat; }
  .pt-daysheet .ds-treat .cd-chip { --ds-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
  .pt-daysheet .ds-pay .cd-chip { --ds-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); }
  /* Next Appointment (Geoff, 17 Nov 2026): a line under the service, under the patient's name like
     it, saying "Next:"; left off when there is none. */
  .pt-daysheet .ds-next { order:7; flex:1 1 100%; padding-left:62px !important; font-size:13.5px; color:var(--ink-2); }
  .pt-daysheet .ds-next::before { content:"Next: "; }
  .pt-daysheet .ds-next:has(> .cd-sub) { display:none; }
  /* Book Again (Geoff, 17 Nov 2026): under Treatment and Payment, the width of the card — it is the
     last thing done at the end of a session. */
  .pt-daysheet .ds-rebook { order:10; flex:1 1 100%; margin-top:6px; }
  .pt-daysheet .ds-rebook .cd-btn { width:100%; min-height:34px; justify-content:center; border-radius:12px;
    font-size:15px !important; font-weight:700; }
  .pt-daysheet .ds-equip, .pt-daysheet .ds-price, .pt-daysheet .ds-block { display:none !important; }
  /* The session under way: filled pale blue with a darker edge, and a NOW tag under the time.
     One finished with (notes signed, nothing to take) steps back. */
  .pt-daysheet tbody tr.ds-now, .pt-daysheet tbody tr.ds-now:hover { background:#DCE6F5; border-color:var(--petrol-700); }
  .pt-daysheet tr.ds-now .ds-time::after {
    content:"NOW"; display:block; width:max-content; margin-top:4px; padding:2px 6px; border-radius:6px;
    background:var(--petrol-700); color:#fff; font-size:11px; font-weight:700; letter-spacing:.03em; line-height:1.3; }
  .pt-daysheet tbody tr.ds-done { opacity:.72; }

  /* Outstanding work: one grouped list under a "Needs attention" heading, not a card each. */
  .pt-attn-title { display:block; margin:20px 2px 10px; font-size:17px; font-weight:700; color:var(--ink); }
  .pt-cards.pt-attn { gap:0; }
  .pt-attn > .cd-card { border-radius:0; border-top-width:0; box-shadow:none; }
  .pt-attn > .cd-card:first-child { border-top-width:1px; border-top-left-radius:var(--r-lg); border-top-right-radius:var(--r-lg); }
  .pt-attn > .cd-card:last-child { border-bottom-left-radius:var(--r-lg); border-bottom-right-radius:var(--r-lg); box-shadow:var(--shadow-card); }
  .pt-attn .pt-outstanding-head { min-height:60px; }
  .pt-attn .pt-outstanding-head .cd-h3 { font-size:15px !important; }

  /* Any other list table that opts in (class="pt-table stack"): the first cell is the row's title,
     and the rest run on under it as one line of facts, wrapping as they need. */
  .pt-table.stack thead { display:none; }
  .pt-table.stack, .pt-table.stack tbody { display:block; }
  .pt-table.stack tbody tr { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 6px; padding:12px 16px; border-bottom:1px solid var(--line); }
  .pt-table.stack tbody tr:last-child { border-bottom:none; }
  .pt-table.stack tbody td { display:block; padding:0; border:none; min-width:0; text-align:left !important;
    font-size:13px !important; color:var(--ink-2); overflow-wrap:anywhere; }
  .pt-table.stack tbody td:first-child { flex-basis:100%; font-size:14.5px !important; font-weight:650; color:var(--ink); }
  .pt-table.stack tbody td + td + td::before { content:"·"; margin-right:6px; color:var(--ink-3); }
  /* A row's chevron or empty cell is dropped; its buttons go to the end of the line, undotted. */
  .pt-table.stack tbody td:empty, .pt-table.stack tbody td:has(> svg:only-child) { display:none; }
  .pt-table.stack tbody td:not(:first-child):has(button, .cd-btn, .cd-icon-btn) { margin-left:auto; }
  .pt-table.stack tbody td:has(button, .cd-btn, .cd-icon-btn)::before { content:none !important; }
  .pt-table.stack tbody td[colspan] { flex-basis:100%; text-align:center !important; }
  /* Any other table (a ledger, an editor, invoice lines) scrolls sideways inside its own box
     rather than widening the page. */
  .pt-page:has(> table.pt-table:not(.stack):not(.pt-daysheet)),
  .pt-page :has(> table.pt-table:not(.stack):not(.pt-daysheet)),
  .pt-modal-b :has(> table.pt-table:not(.stack):not(.pt-daysheet)) { overflow-x:auto; max-width:100%; }

  /* ── diary ── one calendar's column at a time, picked from a strip of chips. */
  .pt-diary-picker { display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; margin:0 -16px 10px; padding:2px 16px; }
  .pt-diary-picker::-webkit-scrollbar { display:none; }
  .pt-diary-pick { flex:0 0 auto; min-height:44px; padding:0 15px; gap:8px; border-radius:99px; background:#fff;
    color:var(--ink); border:1px solid var(--line); font-size:14px; font-weight:600; white-space:nowrap; }
  .pt-diary-pick:hover { background:#fff; }
  .pt-diary-pick:active { transform:none; background:var(--mist); }
  .pt-diary-pick.on, .pt-diary-pick.on:hover { background:var(--petrol-700); color:#fff; border-color:var(--petrol-700); }
  .pt-diary-pick-dot { width:10px; height:10px; border-radius:3px; flex-shrink:0; box-shadow:0 0 0 1.5px #fff; }
  .pt-board .pt-board-col:not(.is-focus) { display:none !important; }
  .pt-diary-views > [data-view=Week], .pt-diary-views > [data-view=Month] { display:none; }

  /* ── pop-ups: full-screen sheets ── the page behind does not scroll under them. */
  body:has(.pt-overlay) { overflow:hidden; }
  .pt-overlay { padding:0; align-items:stretch; }
  .pt-modal, .pt-modal.wide, .pt-modal.xwide {
    max-width:none; width:100%; height:100%; max-height:none; border-radius:0;
    animation:pt-sheet-up .26s cubic-bezier(.2,.8,.2,1);
  }
  .pt-modal-h { min-height:56px; padding:calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .pt-modal-h .cd-btn { min-width:44px; justify-content:center; border-radius:99px; background:var(--mist); color:var(--ink-2); }
  .pt-modal-b { padding:16px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
  .pt-modal-f { flex-wrap:wrap; padding:10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .pt-modal-f > .cd-btn { flex:1 1 0; min-height:48px; font-size:15px; }
}
@keyframes pt-sheet-up { from { transform:translateY(32px); opacity:0; } to { transform:none; opacity:1; } }
@media (max-width:767.98px) and (prefers-reduced-motion:reduce) {
  .pt-side, .pt-top-title, .pt-top-brand { transition:none; }
  .pt-modal, .pt-modal.wide, .pt-modal.xwide { animation:none; }
}

/* ═══════════════════════════════════════════════════════════
   Navigation progress bar + spinner
   ═══════════════════════════════════════════════════════════ */
#nav-progress { position:fixed; top:0; left:0; height:3px; width:100%; transform:scaleX(0);
  transform-origin:left center; background:linear-gradient(90deg,var(--teal-500),var(--aqua-300));
  z-index:9999; opacity:0; pointer-events:none; }
#nav-progress.loading { opacity:1; animation:nav-progress 1.8s cubic-bezier(.2,.8,.2,1) forwards; }
#nav-progress.done { opacity:0; transform:scaleX(1); transition:opacity .25s ease .1s; }
@keyframes nav-progress { 0%{transform:scaleX(.05);} 55%{transform:scaleX(.65);} 100%{transform:scaleX(.92);} }

.spinner { display:inline-block; width:22px; height:22px; border:3px solid var(--mist);
  border-top-color:var(--teal-500); border-radius:50%; animation:spin .7s linear infinite; vertical-align:middle; }
.spinner-lg { width:34px; height:34px; border-width:4px; }
.loading-row { display:flex; align-items:center; gap:10px; color:var(--ink-3); padding:18px 0; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Favourite / star toggle ───────────────────────────────────── */
:root { --star:#D9A521; }
.cd-star { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px;
  border:none; background:transparent; border-radius:8px; cursor:pointer; color:var(--ink-3);
  padding:0; transition:background .12s, color .12s, transform .08s; }
.cd-star:hover { background:var(--mist); color:var(--star); }
.cd-star:active { transform:scale(.9); }
.cd-star.on { color:var(--star); }
.cd-star svg { width:17px; height:17px; }
.cd-star.lg { width:38px; height:38px; }
.cd-star.lg svg { width:22px; height:22px; }

/* ── Diary alert flag ──────────────────────────────────────────────
   A booking whose patient or owner carries an alert used to be marked with a
   2px inset ring in the warning amber. At the widths a busy column gives a
   block that reads as a slightly different border, and it was being missed.
   The flag is now a red disc carrying the warning icon, hung over the block's
   top-left corner so it crosses the border instead of sitting inside it. The
   white ring keeps it legible over any calendar colour. */
.dg-alert-badge {
  position:absolute; top:-8px; left:-8px; width:18px; height:18px; border-radius:99px;
  background:var(--alert); color:#fff; border:2px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,.3);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; z-index:4; }
.dg-alert-badge svg { width:11px; height:11px; display:block; }

/* ── Patient photo ─────────────────────────────────────────────────
   Square, cropped to fill, on the mist tint the species icon already sat on
   so a patient with a photo and one without are the same shape in a list. */
.pt-patient-photo { background:var(--mist); display:flex; align-items:center; justify-content:center;
  overflow:hidden; flex:0 0 auto; }
.pt-patient-photo img { width:100%; height:100%; object-fit:cover; display:block; }

/* A small photo that can be seen larger (SC-78). Pointing at it shows a 240px preview beside it,
   in CSS so there is no round trip; clicking or tapping opens the full photo in the modal. The
   preview is hover-only, and only where there is a real pointer to hover with — a touch screen
   would otherwise show it on the same tap that opens the modal. It ignores the pointer itself, so
   it closes the moment the photo is left, and waits a beat before appearing so a pass down the
   rows does not flash a picture for each one. */
.pt-photo-zoom { position:relative; display:inline-flex; flex:0 0 auto; }
.pt-photo-zoom-btn { border:none; background:none; padding:0; margin:0; display:inline-flex;
  border-radius:9px; cursor:zoom-in; }
.pt-photo-zoom-btn:focus-visible { outline:2px solid var(--teal-500); outline-offset:2px; }
.pt-photo-zoom-preview { position:absolute; left:calc(100% + 10px); top:50%; transform:translateY(-50%);
  width:240px; height:240px; border-radius:15px; overflow:hidden; background:var(--mist);
  border:3px solid #fff; box-shadow:0 12px 32px rgba(20,33,63,.28); z-index:20;
  pointer-events:none; opacity:0; visibility:hidden; transition:opacity .12s ease, visibility 0s linear .12s; }
.pt-photo-zoom-preview img { width:100%; height:100%; object-fit:cover; display:block; }
@media (hover:hover) and (pointer:fine) {
  .pt-photo-zoom-btn:hover + .pt-photo-zoom-preview { opacity:1; visibility:visible;
    transition:opacity .12s ease .15s, visibility 0s linear .15s; }
}
@media (prefers-reduced-motion:reduce) {
  .pt-photo-zoom-preview, .pt-photo-zoom-btn:hover + .pt-photo-zoom-preview { transition:none; }
}
/* The photo in the modal: as large as the dialog allows, never cropped. */
.pt-photo-lightbox { display:block; width:100%; height:auto; max-height:70vh; object-fit:contain;
  border-radius:var(--r-md); background:var(--mist); }

/* A field whose value is settled — shown where a control would be, so the row keeps its
   rhythm without pretending there is a choice to make. Used where the centre has exactly
   one species configured and the dropdown would only ever hold one option. */
.cd-static { padding:10px 2px; font-size:14px; font-weight:600; color:var(--ink); line-height:1.45; }

/* ── Dashboard action banner ───────────────────────────────────────
   Online registrations and unconfirmed online bookings are the only
   outstanding work with a member of the public on the other end of it, so
   they are said out loud at the top of the day rather than left as two
   collapsed rows among five. Red, because the point is that somebody is
   waiting. */
.pt-action-banner { display:flex; align-items:center; gap:13px; margin-bottom:16px;
  padding:13px 18px; border-radius:var(--r-md); background:var(--alert-bg);
  border:1px solid rgba(178,58,46,.26); }
.pt-action-banner-mark { width:30px; height:30px; border-radius:99px; background:var(--alert); color:#fff;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.pt-action-banner-mark svg { width:18px; height:18px; }
.pt-action-banner-title { font-size:14px; font-weight:700; color:var(--alert); }
.pt-action-banner-sub { font-size:12.5px; color:var(--ink-2); margin-top:1px; }
.pt-action-banner .cd-btn { background:var(--alert); color:#fff; border:none; flex:0 0 auto; }
.pt-action-banner .cd-btn:hover { filter:brightness(1.08); }

/* A bare icon button inside a table cell — no chrome until it is pointed at, so
   a column of them does not read as a column of buttons. */
.cd-icon-btn { border:none; background:transparent; color:var(--ink-3); padding:4px; border-radius:7px;
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.cd-icon-btn:hover { background:var(--mist); color:var(--petrol-700); }
.cd-icon-btn svg { flex-shrink:0; }
/* Move up / Move down in an ordered list: two equal outlined squares with matching chevrons. */
.cd-order-btn { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0;
  border:1px solid var(--line); border-radius:7px; background:var(--card); color:var(--petrol-700); cursor:pointer;
  vertical-align:middle; transition:background .12s, border-color .12s; }
.cd-order-btn + .cd-order-btn { margin-left:4px; }
.cd-order-btn svg { flex-shrink:0; }
.cd-order-btn:hover:not(:disabled) { background:var(--mist); border-color:var(--petrol-700); }
.cd-order-btn:disabled { opacity:.35; cursor:default; }

/* Settings › Calendars (SC-60): rows are dragged to set the diary board order. The grip is the
   affordance; the whole row is the drag source so the drag image shows the calendar's name. */
.cal-grip { display:inline-flex; color:var(--ink-3); cursor:grab; }
.cal-order-grid .rz-data-row[draggable="true"] { cursor:grab; }
.cal-order-grid .rz-data-row[draggable="true"]:active { cursor:grabbing; }
.cal-order-grid .rz-data-row.cal-drop-target td { box-shadow:inset 0 2px 0 var(--teal-500); background:var(--mist) !important; }
/* Touch has no drag here, so the up/down buttons are the control — give them a finger-sized target. */
@media (pointer:coarse) { .cal-order-grid .cal-move { padding:10px; } }

/* Drag to reorder (SC-143) — the rows DragReorder makes draggable: field lists, measurement types,
   treatment-template fields. Same look as the calendars above. */
.dr-grip { display:inline-flex; color:var(--ink-3); cursor:grab; vertical-align:middle; }
.dr-grip svg { flex-shrink:0; }
.dr-row[draggable="true"] { cursor:grab; }
.dr-row[draggable="true"]:active { cursor:grabbing; }
.dr-row.dr-drop-target td { box-shadow:inset 0 2px 0 var(--teal-500); background:var(--mist) !important; }
/* Drag needs a mouse; on touch, the grip promises something it can't do. */
@media (pointer:coarse) { .dr-grip { display:none; } }
/* ── Dead-circuit and reconnect UI (SC-58) ──────────────────────────────────
   Styled inline in App.razor, not here: they are on screen exactly when this stylesheet may have
   failed to load (a deploy), and with their rules only here they all showed at once, unstyled. */

/* ── Patient notes browser (SC-65) ──────────────────────────────────────────
   The shared notes pop-up: a compact list of every note down the left, the chosen one on the right. */
.pt-notes-browser { display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; }
.pt-notes-list { display:flex; flex-direction:column; gap:3px; max-height:56vh; overflow:auto;
  padding-right:6px; border-right:1px solid var(--line); }
.pt-notes-item { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%;
  padding:7px 10px; border:1px solid transparent; border-radius:var(--r-sm); background:transparent;
  color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
.pt-notes-item:hover { background:var(--paper); }
.pt-notes-item.active { background:var(--mist); border-color:var(--aqua-150); }
.pt-notes-item-title { font-size:13px; font-weight:650; line-height:1.3; }
.pt-notes-pos { flex:1; min-width:0; text-align:center; font-size:13px; font-weight:650; color:var(--ink-2); }
@media (max-width:820px) {
  .pt-notes-browser { grid-template-columns:1fr; }
  .pt-notes-list { max-height:170px; border-right:none; border-bottom:1px solid var(--line); padding:0 0 8px; }
}

/* ── Treatment note answers (SC-84) ─────────────────────────────────────────
   v1's TreatmentRender: a 12-column grid of bold label over value, each answer as wide as its field
   (the span is set inline). On a phone every answer takes the whole row. The form uses the same grid. */
.tn-answers { display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); gap:12px 16px; }
.tn-answer { min-width:0; }
.tn-answer-label { font-size:12.5px; font-weight:700; color:var(--ink); margin-bottom:3px; }
.tn-answer-value { font-size:13.5px; line-height:1.55; color:var(--ink-2); white-space:pre-wrap; overflow-wrap:anywhere; }
.tn-answer-value.blank { color:var(--ink-3); }
/* Rich text shown as markup outside a treatment note (SC-126): a client's or a patient's Notes and Alert,
   a referral's sections. Colour and highlight arrive as inline styles from the sanitiser. */
.pt-richtext { white-space:normal; overflow-wrap:anywhere; }
.pt-richtext p, .pt-richtext ul, .pt-richtext ol, .pt-richtext blockquote { margin:0 0 6px; }
.pt-richtext ul, .pt-richtext ol { padding-left:20px; }
.pt-richtext h3, .pt-richtext h4 { margin:8px 0 4px; font-size:14px; }
.pt-richtext > :last-child { margin-bottom:0; }
.tn-rich { white-space:normal; }
.tn-rich p, .tn-rich ul, .tn-rich ol, .tn-rich blockquote { margin:0 0 6px; }
.tn-rich h3, .tn-rich h4 { margin:8px 0 4px; font-size:14px; }
.tn-fields { display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); gap:0 14px; }
.tn-fields > div { min-width:0; }
@media (max-width:640px) {
  .tn-answer, .tn-fields > div { grid-column:span 12 !important; }
}

/* ── Help (SC-127) ── one question per row; the answer opens under it. */
.help-faq { border-bottom:1px solid var(--line); }
.help-faq:last-child { border-bottom:none; }
.help-faq summary { padding:13px 20px; font-weight:600; font-size:14px; cursor:pointer; color:var(--ink); }
.help-faq summary:hover { color:var(--petrol-700); }
.help-faq[open] summary { color:var(--petrol-700); }
.help-answer { padding:0 20px 14px; font-size:13.5px; line-height:1.55; color:var(--ink-2); }
@media (max-width:820px) { .help-grid { grid-template-columns:minmax(0,1fr) !important; } }

/* Printing a page (the note page's Print / PDF): the page only — no sidebar, burger strip or buttons —
   and all of it, not just what fits the window the app shell scrolls inside. */
/* SC-168: shown only on paper — the note page prints a saved note's read-only rendering, not its boxes. */
.print-only { display:none; }
@media print {
  .print-only { display:block !important; }
  .pt-side, .pt-top, .pt-scrim, .pt-tabbar, .no-print { display:none !important; }
  .pt-app { display:block; height:auto; overflow:visible; }
  .pt-main, .pt-scroll { overflow:visible; height:auto; }
  .cd-card { break-inside:avoid-page; box-shadow:none; }
}

/* SC-95: any page printed from the browser prints as a document — A4 with even margins, no buttons,
   tabs or dialogs, and a long table's header row repeated at the top of every page it runs onto. The
   centre's own documents (statements, receipts, appointment lists) are PDFs on its letterhead; these
   rules are for a screen printed as it stands. */
@page { size: A4; margin: 15mm 14mm; }
@media print {
  html, body { background:#fff !important; }
  button, .cd-btn, .cd-icon-btn, .pt-tabs, .pt-seg, .pt-crumb, .pt-overlay, .pt-modal, input[type=checkbox] { display:none !important; }
  .pt-page { padding:0 !important; max-width:none !important; }
  thead { display:table-header-group; }
  tfoot { display:table-footer-group; }
  tr, img { break-inside:avoid; }
  a { color:inherit; text-decoration:none; }
  /* SC-126: text colour and highlight are part of what was written; browsers drop backgrounds when
     printing unless told otherwise. */
  .tn-rich [style], .pt-richtext [style] { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* ── SC-45: online vet consent ─────────────────────────────────────────────────────────────── */
/* The form's fields: as many columns as fit, with the long ones across the whole row. */
.vc-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:0 12px; }
.vc-grid .vc-wide { grid-column:1 / -1; }

/* A signatory block: the statement, then Signed / Print name / Date as on the paper form. */
.vc-sign { border:1px solid var(--line); border-radius:var(--r-md); padding:14px 16px; margin-bottom:12px; background:#fff; }
.vc-sign.invalid { border-color:var(--alert); }
.vc-sign-text { font-size:13.5px; color:var(--ink); margin-bottom:12px; white-space:pre-wrap; }
.vc-sign-grid { display:grid; grid-template-columns:minmax(220px, 2fr) minmax(150px, 1.4fr) minmax(110px, 1fr); gap:12px; align-items:start; }
@media (max-width:640px) { .vc-sign-grid { grid-template-columns:1fr; } }
.vc-sign-pad { position:relative; height:110px; border:1px dashed var(--line); border-radius:var(--r-md); background:var(--mist); }
.vc-sign-pad canvas { width:100%; height:100%; display:block; cursor:crosshair; touch-action:none; }
.vc-sign-pad.typed { display:flex; align-items:center; padding:0 14px; font-family:'Segoe Script','Brush Script MT','Lucida Handwriting',cursive; font-size:26px; color:#14213d; overflow:hidden; white-space:nowrap; }
.vc-sign-pad.typed.static { height:auto; min-height:56px; border-style:solid; background:#fff; }
.vc-sign-clear { position:absolute; right:6px; bottom:6px; font-size:11.5px; padding:2px 8px; border:1px solid var(--line); border-radius:var(--r-sm); background:#fff; color:var(--ink-2); cursor:pointer; }
.vc-sign-mode { display:inline-flex; border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.vc-sign-mode button { padding:2px 10px; font-size:11.5px; border:0; background:#fff; color:var(--ink-2); cursor:pointer; }
.vc-sign-mode button.on { background:var(--petrol-700); color:#fff; }
.vc-sign-image { max-height:70px; max-width:100%; display:block; background:#fff; border:1px solid var(--line); border-radius:var(--r-md); padding:4px; }

/* A choice drawn as a card rather than a radio: class diffs reliably, a radio's checked state does not. */
.vc-choice { display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; padding:10px 13px; border:1px solid var(--line); border-radius:var(--r-md); background:#fff; color:var(--ink); cursor:pointer; font-size:13px; }
.vc-choice.on { border-color:var(--petrol-700); box-shadow:0 0 0 2px color-mix(in srgb, var(--petrol-700) 20%, transparent); }
/* The bare button rule (above) darkens every button on hover; these are light surfaces. */
.vc-choice:hover, .vc-sign-clear:hover, .vc-sign-mode button:hover { background:var(--paper); color:var(--ink); }
.vc-sign-mode button.on:hover { background:var(--petrol-800); color:#fff; }
.vc-choice, .vc-sign-clear, .vc-sign-mode button { box-shadow:none; min-height:0; }

/* SC-201: a centre's own tick-box field (CustomFieldInput) — the box beside its wording, not a stretched
   input under a label. Neutralises the bare input rules (border, padding, max-width, focus ring) and the
   bare label rule (block, bottom margin). */
.cd-tick { display:flex; align-items:flex-start; gap:9px; margin:0; cursor:pointer; font-size:13.5px; font-weight:600; color:var(--label); }
.cd-tick input[type=checkbox] { width:17px; height:17px; min-width:17px; max-width:none; margin:1px 0 0; padding:0; border:none;
  flex-shrink:0; accent-color:var(--teal-500); cursor:pointer; }
.cd-tick input[type=checkbox]:focus { border:none; box-shadow:none; }
.cd-tick input[type=checkbox]:focus-visible { outline:2px solid var(--teal-500); outline-offset:2px; }
.cd-tick.invalid span { color:var(--alert); }

/* SC-203/SC-205: a form builder's sections (FormSectionLayoutEditor) — the title in blue so each section
   stands out from the fields under it, the centre's own sections titled in a box of the same weight. */
.fs-section { border:1px solid var(--line); border-radius:var(--r-md); padding:12px 14px; margin-bottom:10px; background:#fff; }
.fs-section-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.fs-title { font-size:12px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; color:var(--teal-600); }
.fs-title-input { max-width:320px; padding:6px 10px; font-size:12px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; color:var(--teal-600); }
.fs-section-head .cd-btn.sm { padding:4px 9px; }
