/* PracticeVue console styles. Plain CSS so Hostinger needs no build step. */
:root {
  --brand: #0B6E5C;
  --brand-dark: #08513F;
  --brand-soft: #E6F2EE;
  --ink: #15202B;
  --muted: #4A5662;
  --line: #E3E6E1;
  --ground: #FBFBF8;
  --card: #FFFFFF;
  /* Neutrals: fixed, so text always stays readable. */
  --line-strong: #B8C0B7;   /* form fields */
  /* Send feedback: the same bright yellow in every practice so it's always easy to find. */
  --feedback: #F5B800; --feedback-hover: #E0A800;
  --help: #1A5BC4; --help-hover: #144A9F;
  --line-soft: #EDEFEB;     /* table rows */
  --surface: #F5F7F4;       /* subtle panels */
  --hover: #EEF1EC;
  /* Status roles, accounting software labels and sticky note papers (App\Support\Branding\ColourScheme).
     These are the defaults; each practice's own (Settings > Colours) are written into every page by partials/brand-theme. */
  --danger-bg: #FFEBE8;
  --danger-fg: #A43C32;
  --danger-line: #FFB5AA;
  --danger-strong: #CB473B;
  --warning-bg: #FFECDF;
  --warning-fg: #944F00;
  --warning-line: #FABC8D;
  --warning-strong: #B15F00;
  --waiting-bg: #FBF0D2;
  --waiting-fg: #7A6000;
  --waiting-line: #E2C884;
  --waiting-strong: #8F7000;
  --success-bg: #E1F7E7;
  --success-fg: #0F7644;
  --success-line: #A6D9B6;
  --success-strong: #278552;
  --info-bg: #E6F1FF;
  --info-fg: #2564AB;
  --info-line: #A8CEFD;
  --info-strong: #3876BF;
  --sw-quickfile-bg: #E2F7E2; --sw-quickfile-fg: #247629;
  --sw-freeagent-bg: #E6F1FF; --sw-freeagent-fg: #2564AB;
  --sw-xero-bg: #DEF4FF; --sw-xero-fg: #006D8E;
  --sw-other-bg: #F2EDFF; --sw-other-fg: #6E4DA8;
  --sw-none-bg: #F4EFE9; --sw-none-fg: #6E614D;
  --sn-yellow-bg: #FFF0A6; --sn-yellow-edge: #DBC557;
  --sn-pink-bg: #FFD6DF; --sn-pink-edge: #DEA7B4;
  --sn-blue-bg: #D2E8FF; --sn-blue-edge: #A1BFDE;
  --sn-green-bg: #D6F1CF; --sn-green-edge: #A5CA9C;
  --sn-orange-bg: #FFDDBA; --sn-orange-edge: #DEB07F;
  --sn-purple-bg: #E6DBFF; --sn-purple-edge: #BEAEDF;
  --sn-teal-bg: #CBEFE8; --sn-teal-edge: #96C8BF;
  /* Older names, kept so nothing breaks. */
  --warn-bg: var(--warning-bg); --warn-fg: var(--warning-fg);
  --bad-bg: var(--danger-bg);   --bad-fg: var(--danger-fg);
  --ok-bg: var(--success-bg);   --ok-fg: var(--success-fg);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--ground); font-size: 16px; line-height: 1.5; }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; letter-spacing: -0.02em; margin: 0; }
a { color: var(--brand); } a:hover { color: var(--brand-dark); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 10; }

.staging-banner { background: var(--warning-fg); color: #fff; text-align: center; font-size: 14px; font-weight: 600; padding: 6px 16px; }

.topbar { border-bottom: 1px solid var(--line); background: var(--ground); }
/* The menu stays at the top while the page scrolls (above page content, below chat and pop-ups).
   Links to a section on the page stop below it rather than under it. */
.topbar { position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 var(--line), 0 6px 16px -12px rgba(21,32,43,.25); }
html { scroll-padding-top: calc(var(--topbar-h, 72px) + 12px); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: Manrope, sans-serif; font-weight: 800; font-size: 20px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.brand small { font-family: Inter, sans-serif; font-weight: 500; font-size: 14px; color: var(--muted); }
.user-menu { display: flex; align-items: center; gap: 16px; font-size: 15px; color: var(--muted); }
/* Send feedback: a warm amber button that stands out against any practice's brand colour. */
.btn-feedback { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--feedback); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(21, 32, 43, 0.12); transition: background-color 150ms ease-out; }
.btn-feedback:hover { background: var(--feedback-hover); color: var(--ink); }
.btn-feedback[aria-current="page"] { background: var(--ink); color: #fff; }
@media (prefers-reduced-motion: reduce) { .btn-feedback, .btn-help, .btn-community { transition: none; } }
/* Help: a filled blue pill beside Send feedback (white on #1A5BC4 is 6.3:1), opening the help for the page
   you're on in a new tab. Blue, not the practice's brand colour, so it stands out whatever the branding. */
.btn-help { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--help); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(21, 32, 43, 0.12); transition: background-color 150ms ease-out; }
.btn-help:hover { background: var(--help-hover); color: #fff; }
.btn-help:focus-visible { outline: 3px solid var(--help); outline-offset: 2px; }
.btn-help[aria-current="page"] { background: #15202B; color: #fff; box-shadow: none; }
/* Community: a quiet outlined pill. */
.btn-community { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: background-color 150ms ease-out; }
.btn-community:hover { background: var(--hover); color: var(--ink); }

.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.narrow { max-width: 520px; margin: 0 auto; padding: 48px 24px 64px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card + .card { margin-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* Cards side by side line up at the same height (the grid gap does the spacing). */
.grid > .card + .card { margin-top: 0; }
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.page-head p { margin: 0; color: var(--muted); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .label { font-size: 14px; color: var(--muted); }
.stat .value { font-family: Manrope, sans-serif; font-weight: 800; font-size: 30px; }

label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  font: inherit; color: var(--ink); background: #fff;
}
textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
select { padding: 0 12px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #7CC4B3; outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.check label { font-weight: 400; margin: 0; }
.addon { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.addon input { border: 0; border-radius: 0; min-width: 0; }
.addon span { display: flex; align-items: center; padding: 0 12px; background: var(--surface); color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; min-height: 44px; }

.alert { border-radius: 10px; padding: 12px 16px; font-size: 15px; }
.alert-ok { background: var(--success-bg); color: var(--success-fg); }
.alert-error { background: var(--bad-bg); color: var(--bad-fg); }
.error { color: var(--bad-fg); font-size: 14px; margin-top: 6px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.pill-ok { background: var(--success-bg); color: var(--success-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill-info { background: var(--info-bg); color: var(--info-fg); }
.pill-bad { background: var(--bad-bg); color: var(--bad-fg); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; position: relative; }
.muted { color: var(--muted); }

.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.mainnav a:hover { background: var(--hover); color: var(--ink); }
.mainnav a[aria-current=page] { color: var(--ink); background: var(--hover); font-weight: 600; }
dt { font-size: 15px; }

/* Bank feed status rows: red = no feed / expired, orange = renew within 30 days, white = fine */
.feed-row.feed-missing { background: var(--danger-bg); }
.feed-row.feed-missing .feed-label { color: var(--bad-fg); }
.feed-row.feed-renew_soon { background: var(--warning-bg); }
.feed-row.feed-renew_soon .feed-label { color: var(--warn-fg); }
.feed-row.feed-ok { background: #FFFFFF; }
.feed-row.feed-not_needed td { color: var(--muted); }
/* The row just changed (No feed needed, Direct feed…): back at it after the page reloads, briefly marked. */
.feed-row { scroll-margin-top: 120px; }
.feed-row.feed-row-changed { outline: 2px solid var(--brand); outline-offset: -2px; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--line); }
.legend-missing { background: var(--danger-line); } .legend-renew_soon { background: var(--warning-line); } .legend-ok { background: var(--card); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bookkeeping software: pastel shade each, dark text for contrast */
.software-quickfile { background: var(--sw-quickfile-bg); color: var(--sw-quickfile-fg); }
.software-freeagent { background: var(--sw-freeagent-bg); color: var(--sw-freeagent-fg); }
.software-xero      { background: var(--sw-xero-bg); color: var(--sw-xero-fg); }
.software-other     { background: var(--sw-other-bg); color: var(--sw-other-fg); }
.software-none      { background: var(--sw-none-bg); color: var(--sw-none-fg); }
.software-quickbooks { background: #E2F3DA; color: #24561A; }
.software-sage      { background: #E3F5D6; color: #24501A; }

/* Due dates: overdue red, within 30 days orange */
td.due-overdue { color: var(--danger-fg); font-weight: 600; background: var(--danger-bg); }
td.due-soon { color: var(--warning-fg); font-weight: 600; background: var(--warning-bg); }

/* Sortable column headers */
table.sortable th a { color: var(--muted); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
table.sortable th a:hover, table.sortable th[aria-sort=ascending] a, table.sortable th[aria-sort=descending] a { color: var(--ink); }
.sort-arrow { font-size: 11px; opacity: .7; }

html { scroll-behavior: smooth; }
.feed-row a.feed-label { text-decoration: underline; }
.feed-row.feed-missing a.feed-label { color: var(--bad-fg); }
.feed-row.feed-renew_soon a.feed-label { color: var(--warn-fg); }

/* ---------- Staff messaging panel (public/js/messages.js) ---------- */
.pvm-tab { position: fixed; right: 20px; bottom: 0; z-index: 1000; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 -2px 12px rgba(21,32,43,.12); }
.pvm-tab:hover { background: var(--brand-dark); }
.pvm-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--danger-strong); color: #fff; font-size: 12px; font-weight: 700; }
.pvm-badge[hidden] { display: none; }
.pvm-panel { position: fixed; z-index: 1000; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 32px rgba(21,32,43,.18); font-size: 15px; }
.pvm-panel.pvm-docked { top: 0; right: 0; bottom: 0; width: min(760px, 100vw); border-radius: 0; border-top: 0; border-bottom: 0; border-right: 0; }
.pvm-panel.pvm-floating { border-radius: var(--radius); resize: both; overflow: hidden; min-width: 340px; min-height: 320px; }
.pvm-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--ground); }
.pvm-floating .pvm-head { cursor: move; touch-action: none; user-select: none; }
.pvm-head-title { font-family: Manrope, Inter, sans-serif; font-size: 17px; }
.pvm-spacer { flex: 1; }
.pvm-icon-btn { min-width: 36px; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.pvm-icon-btn:hover { background: var(--hover); color: var(--ink); }
.pvm-flash { padding: 8px 14px; background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; }
.pvm-flash-bad { background: var(--bad-bg); color: var(--bad-fg); }
.pvm-body { flex: 1; display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); min-height: 0; }
.pvm-left { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; }
.pvm-right { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pvm-left-top { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
/* The search box takes the space left over, so the New chat button always fits (it wraps underneath if the column is very narrow). */
.pvm-left-top .pvm-search { flex: 1 1 120px; min-width: 0; width: auto; min-height: 38px; font-size: 14px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); font-family: inherit; }
.pvm-left-top .pvm-btn-small { flex: 0 0 auto; }
.pvm-btn-small { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pvm-btn-small:hover { background: var(--brand-soft); }
.pvm-danger { border-color: var(--bad-fg); color: var(--bad-fg); }
.pvm-danger:hover { background: var(--bad-bg); }
.pvm-filters { padding: 0 10px 6px; font-size: 13px; color: var(--muted); }
.pvm-filters summary { cursor: pointer; min-height: 28px; }
.pvm-filter-grid { display: grid; gap: 6px; padding-top: 6px; }
.pvm-filter-grid label { font-weight: 500; font-size: 12px; margin: 0; }
.pvm-filter-grid select, .pvm-filter-grid input { min-height: 34px; font-size: 13px; }
.pvm-filter { padding: 0 10px 6px; font-size: 13px; color: var(--muted); }
.pvm-filter .btn-link { min-height: 0; }
.pvm-list { flex: 1; }
.pvm-row { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.pvm-row:hover { background: var(--surface); }
.pvm-row-open { background: var(--brand-soft); }
.pvm-row-top, .pvm-row-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pvm-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvm-row-unread .pvm-row-name { font-weight: 800; }
.pvm-row-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pvm-row-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvm-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pvm-client-pill { align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--info-bg); color: var(--info-fg); text-decoration: none; }
.pvm-section { font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px 4px; margin: 0; }
.pvm-settings .pvm-section { padding: 16px 0 4px; }
.pvm-empty, .pvm-placeholder p { color: var(--muted); padding: 16px 12px; margin: 0; font-size: 14px; }
.pvm-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
.pvm-new { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pvm-new-head { display: flex; align-items: center; gap: 12px; }
.pvm-new label, .pvm-settings label { font-size: 13px; margin: 6px 0 0; }
.pvm-new input[type=text], .pvm-new textarea, .pvm-settings input[type=text], .pvm-settings select, .pvm-ta input { min-height: 40px; font-size: 14px; }
.pvm-new .pvm-submit { min-height: 42px; margin-top: 6px; }
.pvm-hint { font-size: 12px; color: var(--muted); margin: 0; }
.pvm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pvm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; }
.pvm-chip button { border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; min-width: 26px; min-height: 26px; }
.pvm-perms { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.pvm-perms legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.pvm-check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; min-height: 32px; margin: 0 !important; }
.pvm-check input { width: 18px; height: 18px; }
.pvm-ta { position: relative; }
.pvm-ta-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(21,32,43,.12); max-height: 240px; overflow-y: auto; }
.pvm-ta-list li { display: flex; flex-direction: column; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.pvm-ta-list li small { color: var(--muted); font-size: 12px; }
.pvm-ta-list li.pvm-ta-active, .pvm-ta-list li:hover { background: var(--brand-soft); }
.pvm-ta-list li.pvm-ta-none { color: var(--muted); cursor: default; }
.pvm-chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pvm-chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pvm-chat-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvm-chat-sub { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.pvm-back { display: none; }
.pvm-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.pvm-older { align-self: center; min-height: 32px; font-size: 13px; }
.pvm-day { align-self: center; font-size: 12px; color: var(--muted); background: var(--hover); padding: 2px 10px; border-radius: 10px; margin: 8px 0 2px; }
.pvm-system { align-self: center; font-size: 12px; color: var(--muted); text-align: center; max-width: 90%; }
.pvm-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; }
.pvm-msg.pvm-mine { align-self: flex-end; align-items: flex-end; }
.pvm-sender { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 4px 2px; }
.pvm-bubble { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.pvm-mine .pvm-bubble { background: var(--brand-soft); border-color: var(--line); border-radius: 14px 14px 4px 14px; }
.pvm-deleted { font-style: italic; color: var(--muted); }
.pvm-time { font-size: 11px; color: var(--muted); margin: 2px 4px 0; }
.pvm-highlight .pvm-bubble { outline: 3px solid var(--warning-line); }
.pvm-composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: end; }
.pvm-composer textarea { min-height: 44px; max-height: 160px; font-size: 15px; }
.pvm-composer .btn { min-height: 44px; }
.pvm-composer .pvm-hint { grid-column: 1 / -1; }
.pvm-join { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pvm-settings { flex: 1; overflow-y: auto; padding: 0 16px 20px; }
.pvm-settings .pvm-chat-head { margin: 0 -16px 8px; }
.pvm-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.pvm-inline label { flex: 1; min-width: 160px; }
.pvm-members { list-style: none; margin: 0; padding: 0; }
.pvm-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.pvm-members .pill { margin-left: 6px; }
.pvm-members .btn-link { min-height: 32px; font-size: 13px; }
/* Narrow panel or phone: one column, list or chat */
@media (max-width: 640px) {
  .pvm-panel.pvm-floating { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; resize: none; }
  .pvm-body { grid-template-columns: 1fr; }
  .pvm-has-open .pvm-left { display: none; }
  .pvm-panel:not(.pvm-has-open) .pvm-right { display: none; }
  .pvm-back { display: inline-block; }
  .pvm-tab { right: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .pvm-row, .pvm-tab { transition: background .15s; } }
/* Client page: conversations card */
.client-chats { list-style: none; margin: 0; padding: 0; }
.client-chats li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.client-chats .muted { font-size: 14px; }
/* Practice branding: logo in the header, a strip of the practice's exact colour, sign-in page logo */
.brand-strip { border-top: 4px solid var(--brand-exact, var(--brand)); }
.brand-logo { display: block; width: auto; max-width: 100%; }
.brand-logo-header { height: 40px; max-width: 240px; object-fit: contain; object-position: left center; }
.brand-logo-login { height: 80px; max-width: 360px; object-fit: contain; object-position: left center; }
.brand-mark img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.powered-by { text-align: center; font-size: 13px; color: var(--muted); padding: 0 24px 32px; }
/* Version number at the foot of every console page (docs/releases.md). Extra bottom room so the Messages tab doesn't cover it. */
.app-version { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 24px 64px; font-variant-numeric: tabular-nums; }

/* Settings > Branding */
.branding-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.logo-current { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 10px; background: repeating-conic-gradient(var(--surface) 0% 25%, #FFFFFF 0% 50%) 50% / 16px 16px; }
.logo-current img { max-height: 80px; max-width: 100%; }
.colour-row { display: flex; gap: 10px; align-items: center; }
.colour-row input[type=color] { width: 56px; height: 48px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; flex: 0 0 auto; }
.colour-row input[type=text] { max-width: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.swatch i { width: 24px; height: 24px; border-radius: 6px; display: inline-block; border: 1px solid rgba(0,0,0,.1); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--surface); color: var(--ink); }

/* Live preview: uses its own copy of the colours so changes show before saving */
.preview { --p-brand: var(--brand); --p-exact: var(--brand-exact); --p-soft: var(--brand-soft); display: grid; gap: 16px; }
.preview-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ground); }
.preview-label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 4px solid var(--p-exact); border-bottom: 1px solid var(--line); background: #fff; font-family: Manrope, sans-serif; font-weight: 800; }
.preview-bar img { height: 28px; width: auto; max-width: 180px; object-fit: contain; }
.preview-body { padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.preview-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; background: var(--p-brand); color: #fff; font-weight: 600; font-size: 15px; }
.preview-link { color: var(--p-brand); font-weight: 600; text-decoration: underline; }
.preview-tint { padding: 6px 10px; border-radius: 8px; background: var(--p-soft); font-size: 14px; }
.preview-email-head { background: var(--p-brand); color: #fff; padding: 12px 16px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.preview-email-head.has-logo { background: #fff; border-bottom: 4px solid var(--p-exact); }
.preview-email-head img { height: 32px; width: auto; max-width: 200px; display: block; }
/* Settings */
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); }
.btn-danger-link { color: var(--bad-fg); }
.subnav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; margin-bottom: 20px; }
.subnav a[aria-current=page] { font-weight: 600; color: var(--ink); text-decoration: none; }
.form-grid { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.methods { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.method { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.method[data-available=false] { color: var(--muted); background: var(--surface); }
.method input { margin-top: 4px; }
.method label { margin: 0; }
.method small { display: block; font-weight: 400; color: var(--muted); }
.status-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

[hidden] { display: none !important; }

/* Smaller action buttons, e.g. Sync now / Disconnect on a client's connection */
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.btn-outline { background: #fff; color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-danger { background: #fff; color: var(--bad-fg); box-shadow: inset 0 0 0 2px var(--danger-line); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad-fg); }
.action-group { display: inline-flex; align-items: center; gap: 6px; }

/* "?" help pop-ups */
.help-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.help-btn:hover, .help-btn:focus-visible { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.help-pop { max-width: 360px; width: calc(100% - 32px); padding: 18px 20px 10px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(20, 30, 20, .18); font-size: 15px; line-height: 1.5; color: inherit; background: #fff; }
.help-pop::backdrop { background: rgba(20, 30, 20, .15); }
.help-pop p { margin: 0 0 8px; }

/* Bank feed summary on the client list */
td.feed-cell-missing { background: var(--bad-bg); }
td.feed-cell-renew_soon { background: var(--warning-bg); }
/* Message alerts: preview cards above the Messages tab, permission banner, muted marker */
.pvm-toasts { position: fixed; right: 20px; bottom: 56px; z-index: 1001; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.pvm-toast { display: flex; align-items: flex-start; gap: 4px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: 0 8px 24px rgba(21,32,43,.18); }
.pvm-toast-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.pvm-toast-main strong { font-size: 14px; }
.pvm-toast-body { font-size: 14px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pvm-ask { margin: 0 10px 8px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.pvm-ask-actions { display: flex; gap: 12px; align-items: center; }
.pvm-ask .btn-link { min-height: 32px; font-size: 13px; }
.pvm-muted { font-weight: 400; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) { .pvm-toast { animation: pvm-in .2s ease-out; } }
@keyframes pvm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .pvm-toasts { right: 16px; left: 16px; width: auto; } }

/* Yearly volumes: totals row and summary tiles */
tr.totals-row th, tr.totals-row td { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; border-top: 2px solid var(--brand); }
.volume-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.volume-tile { border-radius: 12px; padding: 14px 16px; border: 1px solid transparent; }
.volume-tile-value { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.volume-tile-label { font-size: 13px; margin-top: 4px; }
.volume-tile-brand { background: var(--brand-soft); color: var(--brand-dark); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.volume-tile-info { background: var(--info-bg); color: var(--info-fg); }
.volume-tile-warn { background: var(--warn-bg); color: var(--warn-fg); }
.volume-tile-plain { background: var(--surface); color: inherit; border-color: var(--line); }

/* Charts (inline SVG bar charts, e.g. yearly volumes) */
.chart { margin: 0; padding: 18px 20px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 8px; }
.chart-title { font-weight: 700; font-size: 16px; }
.chart-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.chart-key-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-key strong { color: var(--ink, inherit); }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--brand); display: inline-block; }
.chart-swatch-partial { background: color-mix(in srgb, var(--brand) 38%, #fff); }
.chart-swatch-line { width: 18px; height: 0; border-top: 2px dashed #8A6A1F; display: inline-block; }
.chart-plot { position: relative; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-xlabel { font-size: 14.5px; }
.chart-bar { fill: var(--brand); transition: fill .15s ease, opacity .15s ease; }
.chart-bar-partial { fill: color-mix(in srgb, var(--brand) 38%, #fff); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-bar-group:focus { outline: none; }
.chart-bar-group:focus-visible .chart-hit { fill: color-mix(in srgb, var(--brand) 8%, transparent); }
.chart-bar-group.is-active .chart-bar { fill: var(--brand-dark); }
.chart-bar-group.is-active .chart-bar-partial { fill: color-mix(in srgb, var(--brand) 55%, #fff); }
.chart-bar-group.is-active .chart-xlabel { fill: var(--brand-dark); font-weight: 700; }
.chart-average { stroke: #8A6A1F; stroke-width: 2; stroke-dasharray: 6 5; pointer-events: none; }
.chart-tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: #1F2A24; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.35; white-space: nowrap; box-shadow: 0 8px 20px rgba(20, 30, 20, .2); z-index: 2; }
.chart-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: #1F2A24; }
.chart-tip-head { opacity: .8; font-size: 12px; }
.chart-tip-value { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.charts-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Client record: tabs, address cards, detail lists */
.client-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 24px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current=page] { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tab-count { font-size: 12px; background: var(--info-bg); color: var(--info-fg); border-radius: 10px; padding: 1px 8px; }
.tab-count-bad { background: var(--danger-bg); color: var(--danger-fg); }
.tab-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.tab-panel h2 { font-size: 20px; }
.address-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.address-row > .card + .card { margin-top: 0; }
.address-card address { font-style: normal; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.small { font-size: 13px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.label-heading { font-family: Inter, sans-serif; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.contact-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.detail-list { margin: 0; display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 10px 20px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.sensitive { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sensitive [data-sensitive-value] { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 560px) {
  .detail-list { grid-template-columns: 1fr; gap: 2px; }
  .detail-list dd { margin-bottom: 10px; }
  .tab-actions { justify-content: stretch; } .tab-actions .btn { width: 100%; }
}

/* Contact tab editing: repeatable rows */
.repeat-list { display: flex; flex-direction: column; gap: 12px; }
.repeat-row { display: grid; gap: 10px; grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) auto auto; align-items: end; }
.repeat-row.trading { grid-template-columns: minmax(0, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto auto; }
.repeat-row .main-choice { display: flex; align-items: center; gap: 6px; min-height: 48px; font-size: 14px; white-space: nowrap; }
.repeat-row .main-choice input { width: 18px; height: 18px; margin: 0; }
.repeat-row .main-choice label { margin: 0; font-weight: 400; }
.repeat-row label.row-label { font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 720px) {
  .repeat-row, .repeat-row.trading { grid-template-columns: 1fr 1fr; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .repeat-row > .field:first-child { grid-column: 1 / -1; }
}
.lookup-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lookup-row .field { flex: 1 1 140px; }
.lookup-results { width: 100%; }
input[type=date] { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); font: inherit; color: var(--ink); background: #fff; }
fieldset.card { margin: 0; min-width: 0; }
fieldset.card + fieldset.card, .address-row + fieldset.card { margin-top: 0; }
.card-legend { float: left; width: 100%; padding: 0; font-family: Manrope, Inter, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.card-legend + * { clear: both; }
.lookup-results select { margin-top: 4px; }
.lookup-note { font-size: 14px; margin: 4px 0 0; }
.lookup-note.warn { color: var(--warn-fg); }

/* Services tab */
.service-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.service-grid > .card + .card { margin-top: 0; }
.service-card { gap: 12px; }
.service-name { font-size: 18px; }
.detail-list.compact { grid-template-columns: minmax(80px, auto) 1fr; gap: 4px 16px; font-size: 15px; }
.service-details { margin: 0; font-size: 14px; background: var(--info-bg); color: var(--info-fg); border-radius: 8px; padding: 8px 10px; }
.service-actions { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-start; margin-top: auto; }
.end-service summary { list-style: none; display: inline-flex; align-items: center; }
.end-service summary::-webkit-details-marker { display: none; }
.past-services summary { cursor: pointer; min-height: 32px; }
.choose-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.choose-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.choose-list li:last-child { border-bottom: 0; }
.choose-list a { font-weight: 600; }
.addon-before span { border-left: 0; border-right: 1px solid var(--line); }
.settings-services td { vertical-align: top; }
@media (max-width: 560px) { .detail-list.compact { grid-template-columns: 1fr; } }

/* Button back to a client's record, at the top of the client's sub-pages */
.page-head .back-to-client { margin: 0 0 4px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 44px; padding: 0 18px 0 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark, var(--brand)); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s; }
.back-btn svg { flex: 0 0 auto; transition: transform .15s; }
.back-btn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.back-btn:hover svg { transform: translateX(-2px); }
.back-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .back-btn, .back-btn svg { transition: none; } }
/* Taxes, Software and Notes tabs */
.subsection { font-family: Inter, sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.label-like { font-size: 14px; font-weight: 600; display: block; }
.indent { margin-left: 30px; }
.copyable { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; word-break: break-all; }
/* Copy button beside an email address or phone number (<x-copy>). Small, but a 32px target for fingers. */
.copy-btn { background: none; border: 0; padding: 0 4px; margin-left: 6px; min-height: 32px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; vertical-align: baseline; white-space: nowrap; }
.copy-btn:hover, .copy-btn:focus-visible { color: var(--ink, inherit); }
.copy-btn.is-copied { color: var(--ok, #1a7f4b); text-decoration: none; }
.copyable .copy-btn { margin-left: 0; }
.login-list { list-style: none; margin: 0; padding: 0; }
.login-list li { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1.4fr) minmax(140px, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.login-list li:last-child { border-bottom: 0; }
.login-go { display: flex; gap: 16px; justify-content: flex-end; white-space: nowrap; }
.login-go a { min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .login-list li { grid-template-columns: 1fr; gap: 4px; }
  .login-go { justify-content: flex-start; }
}
.notes-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.notes-grid > .card + .card { margin-top: 0; }
.heading-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; flex: 1 1 auto; }
.heading-row input[type=text] { flex: 1 1 220px; width: auto; }
.agent-codes { display: flex; flex-direction: column; gap: 12px; }
.agent-code-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr); gap: 10px 16px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.agent-code-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .agent-code-row { grid-template-columns: 1fr 1fr; } .agent-code-row .label-like { grid-column: 1 / -1; } }

/* ── Sticky notes ─────────────────────────────────────────────────────────── */
.sn-yellow { --sn-bg: var(--sn-yellow-bg); --sn-edge: var(--sn-yellow-edge); }
.sn-pink   { --sn-bg: var(--sn-pink-bg); --sn-edge: var(--sn-pink-edge); }
.sn-blue   { --sn-bg: var(--sn-blue-bg); --sn-edge: var(--sn-blue-edge); }
.sn-green  { --sn-bg: var(--sn-green-bg); --sn-edge: var(--sn-green-edge); }
.sn-orange { --sn-bg: var(--sn-orange-bg); --sn-edge: var(--sn-orange-edge); }
.sn-purple { --sn-bg: var(--sn-purple-bg); --sn-edge: var(--sn-purple-edge); }
.sn-teal   { --sn-bg: var(--sn-teal-bg); --sn-edge: var(--sn-teal-edge); }

.sn-page-head { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sn-views { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: #ECE7DC; border-radius: 10px; }
.sn-views a { padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.sn-views a[aria-current="page"] { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.sn-tools { padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.sn-search { position: relative; }
.sn-search svg { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.sn-search input { width: 100%; height: 48px; padding: 0 14px 0 44px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; background: var(--ground); }
.sn-chip-row { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sn-chip-row legend { float: left; font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 8px; padding: 8px 0; }
.sn-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #D3CCBD; background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.sn-chip span { opacity: .75; }
input:checked + .sn-chip { background: #15202B; border-color: #15202B; color: #fff; }
input:focus-visible + .sn-chip, input:focus-visible + .sn-swatch { outline: 2px solid var(--brand); outline-offset: 2px; }
.sn-swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--sn-edge); background: var(--sn-bg); cursor: pointer; display: inline-block; }
input:checked + .sn-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #15202B; }
.sn-tools-end { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }

.sn-board { background-color: #EFEAE0; background-image: radial-gradient(#D9D0BE 1px, transparent 1px); background-size: 22px 22px; border: 1px solid #E2DCCF; border-radius: 18px; padding: 28px 24px 36px; display: flex; flex-direction: column; gap: 28px; }
.sn-section { display: flex; flex-direction: column; gap: 18px; }
.sn-section h2 { font-family: Inter, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5C564A; }
.sn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px 26px; align-items: start; }
.sn-grid-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; padding-top: 8px; }

.sn-note { position: relative; background: var(--sn-bg); border-top: 3px solid var(--sn-edge); border-radius: 3px 3px 16px 3px; padding: 20px 14px 14px 18px; min-height: 190px;
  display: flex; flex-direction: column; gap: 10px; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 8px 18px rgba(60,45,20,.12); transition: transform 150ms ease-out, box-shadow 150ms ease-out; color: #24211C; }
.sn-note:hover, .sn-note:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 16px 26px rgba(60,45,20,.18); }
.sn-note.sn-dragging { opacity: .5; }
.sn-tape { position: absolute; top: -11px; left: 50%; margin-left: -34px; width: 68px; height: 20px; background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.05); transform: rotate(-3deg); }
.sn-top { display: flex; align-items: flex-start; gap: 2px; }
.sn-top form { margin: 0; }
.sn-title { flex: 1; min-width: 0; font-family: Kalam, "Comic Sans MS", cursive; font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: 0; padding-top: 4px; overflow-wrap: anywhere; }
.sn-title a { color: inherit; text-decoration: none; }
.sn-title a:hover { text-decoration: underline; }
.sn-icon { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 8px; color: #6B6457; cursor: pointer; }
.sn-icon:hover { background: rgba(255,255,255,.55); }
.sn-pinned { color: var(--warning-strong); }
.sn-handle { cursor: grab; }
.sn-body { margin: 0; font-size: 14px; line-height: 1.5; color: #3A362E; white-space: pre-line; overflow-wrap: anywhere; }
.sn-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sn-checklist label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: #3A362E; cursor: pointer; padding: 2px 0; }
.sn-checklist input { margin: 2px 0 0; width: 17px; height: 17px; flex: none; accent-color: var(--brand); }
.sn-checklist input:checked + span { text-decoration: line-through; opacity: .65; }
.sn-done { margin: 0; font-size: 12px; color: #5C564A; }
.sn-foot { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.sn-clients { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-client { background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.08); color: #1F2A2E; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
a.sn-client:hover { background: #fff; color: #1F2A2E; }
.sn-client-none { background: none; border-style: dashed; border-color: rgba(0,0,0,.2); color: #5C564A; font-weight: 400; }
.sn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: #5C564A; }
.sn-remind { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.65); color: #3A362E; border-radius: 6px; padding: 3px 7px; font-weight: 600; }
.sn-remind.sn-today { background: var(--waiting-bg); color: var(--waiting-fg); }
.sn-remind.sn-overdue { background: var(--danger-bg); color: var(--danger-fg); }
.sn-private { display: inline-flex; align-items: center; gap: 4px; }
.sn-updated { margin-left: auto; }

.sn-empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sn-empty[hidden], .sn-section[hidden], .sn-note[hidden] { display: none; }
.sn-empty-paper { width: 110px; height: 100px; background: var(--sn-yellow-bg); transform: rotate(-4deg); border-radius: 3px 3px 14px 3px; box-shadow: 0 8px 18px rgba(60,45,20,.12); margin-bottom: 8px; }
.sn-empty h2 { font-size: 18px; }
.sn-empty p { margin: 0; max-width: 440px; }

/* The note form: the card is the note itself, in the note's colour. */
.sn-paper { background: var(--sn-bg); border-top: 4px solid var(--sn-edge); border-radius: 4px 4px 18px 4px; padding: 24px; box-shadow: 0 10px 28px rgba(60,45,20,.14); }
.sn-paper .field input, .sn-paper .field textarea, .sn-paper .sn-item-row input[type="text"], .sn-paper .sn-typeahead input { background: rgba(255,255,255,.8); }
.sn-form-heading { font-size: 22px; margin-bottom: 16px; }
.sn-title-input { font-family: Kalam, "Comic Sans MS", cursive !important; font-weight: 700; font-size: 20px !important; }
.sn-banner { margin: 0 0 16px; background: rgba(255,255,255,.65); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.sn-who { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.sn-who svg { flex: none; margin-top: 2px; }
.sn-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sn-fieldset legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.sn-item-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sn-item-row { display: flex; align-items: center; gap: 8px; }
.sn-item-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.sn-item-row input[type="text"] { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 15px; }
.sn-tagged { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: #15202B; color: #fff; font-size: 13px; font-weight: 600; }
.sn-tag button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 16px; cursor: pointer; }
.sn-tag button:hover { background: rgba(255,255,255,.2); }
.sn-typeahead { position: relative; }
.sn-typeahead input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
.sn-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(21,32,43,.12); max-height: 260px; overflow-y: auto; }
.sn-results li { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; }
.sn-results li small { color: var(--muted); font-size: 12px; }
.sn-results li[aria-selected="true"], .sn-results li:hover { background: var(--brand-soft); }
.sn-form-row { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-start; }
.sn-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sn-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sn-delete { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) { .sn-note { transition: none; } }
@media (max-width: 600px) {
  .sn-board { padding: 20px 14px 28px; }
  .sn-note, .sn-note:hover { transform: none; }
  .sn-tools-end { margin-left: 0; }
}

/* Sticky notes: sharing, archive and Bin */
.sn-views { flex-wrap: wrap; }
.sn-views .pvm-badge { margin-left: 6px; }
.sn-new { display: inline-block; vertical-align: middle; margin-left: 6px; font-family: Inter, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #15202B; color: #fff; border-radius: 6px; padding: 2px 6px; }
.sn-shared { margin: 0; display: flex; align-items: center; gap: 5px; font-size: 12px; color: #3A362E; }
.sn-state { margin: 0; font-size: 12px; color: #5C564A; }
.sn-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; }
.sn-card-actions form { margin: 0; }
.sn-share-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sn-share-row { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.7); border-radius: 10px; padding: 4px 4px 4px 12px; }
.sn-share-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.sn-share-name small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.sn-share-row select { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 14px; padding: 0 8px; background: #fff; }
.sn-delete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.sn-delete form { margin: 0; }

/* QuickFile: customers using the client portal (collapsed by default) */
.portal-customers { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.portal-customers > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; list-style-position: outside; }

/* Services tab: services on (light green) above services not on (pale pink) */
.services-section { border-radius: 14px; padding: 18px 20px; display: grid; gap: 14px; margin-bottom: 20px; }
.services-on { background: var(--success-bg); border: 1px solid var(--success-line); }
.services-off { background: var(--danger-bg); border: 1px solid var(--danger-line); }
.services-section-title { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.services-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.services-on .services-dot { background: var(--success-strong); }
.services-off .services-dot { background: var(--danger-strong); }
.services-on .service-card { background: #fff; }
.services-off-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.services-off-list li { background: #fff; border: 1px solid var(--danger-line); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Client form: Type as tick boxes (one business type, or any of an individual's roles) */
.client-types { border: 0; padding: 0; margin: 0; }
.client-types legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.client-types-groups { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 6px; }
.client-types-group { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.client-types-group .check { font-size: 15px; align-items: center; }

/* Client ID */
.client-ref { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
td > a.client-ref { color: var(--muted); text-decoration: none; }
td > a.client-ref:hover { color: var(--ink); text-decoration: underline; }


/* Main menu: Practice and Settings drop-downs (wide screens) */
.navgroup { position: relative; }
.navgroup > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; }
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary:hover, .navgroup[open] > summary { background: var(--hover); color: var(--ink); }
.navgroup > summary[aria-current] { color: var(--ink); background: var(--hover); font-weight: 600; }
.navgroup > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.navgroup-caret { transition: transform .15s; }
.navgroup[open] .navgroup-caret { transform: rotate(180deg); }
.navmenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 110; min-width: 220px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(21,32,43,.16); display: flex; flex-direction: column; }
.navmenu a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.navmenu a:hover { background: var(--hover); }
.navmenu a[aria-current=page] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.navmenu-heading { margin: 8px 12px 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.navmenu-heading:first-child { margin-top: 2px; }
/* Areas inside a drop-down: each opens to the side (to the left when there's no room on the right) */
.navsub > summary .pvm-badge { margin-left: 2px; }
.navsub { position: relative; }
.navsub > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 12px; border-radius: 8px; color: var(--ink); cursor: pointer; user-select: none; white-space: nowrap; }
.navsub > summary::-webkit-details-marker { display: none; }
.navsub > summary > span:first-child { flex: 1 1 auto; }
.navsub > summary:hover, .navsub[open] > summary { background: var(--hover); }
.navsub > summary[aria-current] { font-weight: 600; color: var(--brand-dark); }
.navsub > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.navsub-caret { flex: 0 0 auto; color: var(--muted); }
.navflyout { position: absolute; top: -9px; left: calc(100% + 10px); z-index: 111; min-width: 220px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(21,32,43,.16); display: flex; flex-direction: column; }
.navsub.navsub-left > .navflyout { left: auto; right: calc(100% + 10px); }
.navsub.navsub-left .navsub-caret { transform: rotate(180deg); order: -1; }
/* A bridge across the gap, so moving the pointer from an area into its flyout doesn't lose it */
.navsub[open] > .navflyout::before { content: ""; position: absolute; top: 0; bottom: 0; left: -12px; width: 12px; }
.navsub.navsub-left[open] > .navflyout::before { left: auto; right: -12px; }
.user-menu form { margin: 0; }
.user-name { color: inherit; }

/* Compact menu (phones and tablets): one coloured Menu button */
.menu-toggle { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(21,32,43,.18); }
.menu-toggle:hover { background: var(--brand-dark); }
.menu-toggle:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.menu-toggle .menu-toggle-close { display: none; }
.menu-toggle[aria-expanded=true] .menu-toggle-open { display: none; }
.menu-toggle[aria-expanded=true] .menu-toggle-close { display: inline; }
.menu-toggle .pvm-badge { background: #fff; color: var(--danger-strong); }
.compact-menu { display: none; }
.feedback-compact { display: none; }

@media (max-width: 999px) {
  .topbar-inner { flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar .mainnav, .topbar .user-menu { display: none; }
  .menu-toggle { display: inline-flex; }
  .feedback-compact { display: inline-flex; flex: 0 0 auto; min-height: 44px; }
  .compact-feedback { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 4px 0 8px; padding: 0 14px; border-radius: 12px;
    background: var(--feedback); color: var(--ink); font-weight: 700; text-decoration: none; }
  .compact-menu nav a.compact-feedback:hover { background: var(--feedback-hover); }
  .compact-menu nav a.compact-feedback[aria-current=page] { background: var(--ink); color: #fff; }
  /* The panel drops down over the page (it doesn't make the bar taller); its height is set by main-menu.js. */
  .topbar-inner { position: relative; }
  .compact-menu:not([hidden]) { display: block; }
  .compact-menu { position: absolute; top: 100%; left: 0; right: 0; max-height: 70vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 16px 16px; background: var(--ground); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px -16px rgba(21,32,43,.35); }
  .compact-menu nav { display: flex; flex-direction: column; }
  .compact-menu nav a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 17px; }
  .compact-menu nav a:hover { background: var(--hover); }
  .compact-menu nav a[aria-current=page] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
  .compact-heading { margin: 16px 12px 4px; padding-top: 12px; border-top: 1px solid var(--line); font-family: Manrope, sans-serif; font-weight: 800; font-size: 15px; color: var(--ink); }
  .compact-subheading { margin: 8px 12px 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .compact-subheading + a, .compact-heading + .compact-subheading { margin-top: 2px; }
  .compact-area > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 17px; cursor: pointer; }
  .compact-area > summary::-webkit-details-marker { display: none; }
  .compact-area > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
  .compact-area[open] > summary::after { transform: rotate(225deg); }
  .compact-area > summary:hover { background: var(--hover); }
  .compact-menu nav .compact-area > a { padding-left: 28px; }
  .compact-user { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 12px; padding: 16px 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
  .compact-user form { margin: 0; }
  .compact-user .btn-feedback { display: none; }   /* it's at the top of the panel and in the bar instead */
  body.menu-open { overflow: hidden; }
}
.navmenu { left: auto; right: 0; }
.user-menu { margin-left: auto; }
@media (max-width: 999px) {
  .topbar .brand { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .menu-toggle { flex: 0 0 auto; margin-left: auto; }
}
@media (max-width: 359px) { .feedback-compact span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .feedback-compact { padding: 0 12px; } }
@media (max-width: 559px) {
  .topbar-inner { padding-left: 16px; padding-right: 16px; gap: 10px; }
  .topbar .brand { font-size: 18px; gap: 8px; }
  .menu-toggle { padding: 0 14px; }
}

/* Help (docs/help) */
.help-search { display: flex; gap: 10px; max-width: 640px; }
.help-search input { flex: 1; min-width: 0; }
.help-areas { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.help-areas .card { padding: 22px 24px; }
.help-areas h2 { font-size: 18px; margin-bottom: 10px; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.help-list a { font-weight: 600; }
.help-list p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.help-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.help-results p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.help-page { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
@media (max-width: 900px) { .help-page { grid-template-columns: minmax(0, 1fr); } }
.help-crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.help-body { max-width: 720px; font-size: 16px; line-height: 1.65; }
.help-body h2 { font-size: 22px; margin: 32px 0 10px; scroll-margin-top: calc(var(--topbar-h, 72px) + 12px); }
.help-body h3 { font-size: 18px; margin: 24px 0 8px; scroll-margin-top: calc(var(--topbar-h, 72px) + 12px); }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 14px; }
.help-body li + li { margin-top: 6px; }
.help-body code { font-size: 14px; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.help-body table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-size: 15px; }
.help-body th, .help-body td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.help-body blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.help-body blockquote p { margin: 0; }
.help-side { position: sticky; top: calc(var(--topbar-h, 72px) + 16px); }
@media (max-width: 900px) { .help-side { position: static; } }
.help-side h2 { font-size: 15px; margin-bottom: 10px; }
.help-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.help-side a[aria-current=page] { font-weight: 700; color: var(--ink); text-decoration: none; }
.help-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* Help videos and "Show me" tours (public/js/help-tour.js) */
.help-video { padding: 0; overflow: hidden; margin: 0 0 24px; max-width: 720px; }
.help-video video { display: block; width: 100%; height: auto; background: #15202B; aspect-ratio: 16 / 9; }
.help-video-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; }
.help-video-foot p { margin: 0; }
.pv-tour-ring { position: fixed; z-index: 2147483000; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 3px var(--brand), 0 0 0 9999px rgba(21, 32, 43, .35); transition: top 200ms ease-out, left 200ms ease-out, width 200ms ease-out, height 200ms ease-out; }
.pv-tour-card { position: fixed; z-index: 2147483001; width: min(360px, calc(100vw - 32px)); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 16px 18px; box-shadow: 0 12px 32px rgba(21, 32, 43, .28); font-size: 15px; line-height: 1.5; }
.pv-tour-count { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.pv-tour-caption { margin: 0 0 12px; font-size: 16px; }
.pv-tour-note { margin: -4px 0 12px; font-size: 14px; color: var(--warning-fg); }
.pv-tour-actions { display: flex; gap: 8px; align-items: center; }
.pv-tour-spacer { flex: 1; }
.pv-tour-end { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .pv-tour-ring { transition: none; } }

/* What's new (docs/releases.md) */
.app-version a { color: inherit; }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning-strong); margin-left: 2px; box-shadow: 0 0 0 2px #fff; }
.whats-new-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.whats-new-list .card { padding: 18px 22px; }
.whats-new-row { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.whats-new-row h2 { font-size: 19px; margin: 0; }
.whats-new-video { padding: 0; overflow: hidden; margin: 0 0 20px; max-width: 720px; }
.whats-new-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.whats-new-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto; border: 0; border-radius: 14px;
  padding: 26px 28px 22px; box-shadow: 0 24px 60px rgba(21, 32, 43, .35); color: var(--ink); }
.whats-new-dialog::backdrop { background: rgba(21, 32, 43, .45); }
.whats-new-eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.whats-new-dialog h2 { font-size: 24px; margin: 0 0 14px; }
.whats-new-points { font-size: 15px; }
.whats-new-points h3 { font-size: 15px; margin: 14px 0 6px; }
.whats-new-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

/* Planned updates (docs/releases.md) */
.planned-update { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; padding: 12px 16px; border-radius: 10px;
  background: var(--info-bg); color: var(--info-fg); box-shadow: inset 0 0 0 1px var(--info-line); font-size: 15px; }
.planned-update svg { flex: 0 0 auto; margin-top: 1px; }
.planned-update p { margin: 0; }
.planned-update a { color: inherit; font-weight: 600; }
.planned-update-today { background: var(--warning-bg); color: var(--warning-fg); box-shadow: inset 0 0 0 1px var(--warning-line); }
.planned-update-notice { max-width: 640px; margin: 8px auto 0; padding: 28px 30px; }
.planned-update-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
.planned-update-facts dt { font-weight: 700; }
.planned-update-facts dd { margin: 0; }


/* Client data checks (App\Support\ClientChecks): pale pink when missing, pale yellow while a dismissal waits for a manager. */
.check-missing { background: var(--danger-bg); }
.check-cell.check-missing, .check-box.check-missing { border-radius: 6px; padding: 4px 8px; }
dd.check-cell { margin-left: -8px; }
[id^="check-"] { scroll-margin-top: 140px; }
.check-flag { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-left: 8px; font-size: 14px; }
.check-flag .btn-link { min-height: 28px; font-size: 14px; }
.check-help { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
    border: 1.5px solid var(--bad-fg); border-radius: 50%; background: var(--card, #fff); color: var(--bad-fg);
    font: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.check-help:hover, .check-help:focus-visible { background: var(--bad-fg); color: #fff; }
.check-overridden { font-size: 13px; }
.check-pop { max-width: min(420px, calc(100vw - 32px)); }
.check-pop textarea { width: 100%; font: inherit; }
.check-pop-title { margin: 0 0 8px; }
.check-pop-head { margin: 8px 0 2px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.check-pop-text { margin: 0 0 8px; font-size: 14px; }
.check-pop-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
.check-override { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.check-override summary { font-size: 14px; cursor: pointer; }
.check-override form { margin-top: 8px; }
.checks-table td { vertical-align: top; }
.checks-table .check-flag { flex-wrap: nowrap; margin-left: 0; white-space: nowrap; }
.checks-banner { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.log-count { font-size: 15px; margin: 0 0 12px; }
.check-status { margin-top: 8px; font-size: 14px; }
tr.check-missing > td, tr.check-missing > th { background: var(--danger-bg); }
.check-summary { border-left: 4px solid var(--bad-fg); }
.check-summary ul { margin: 0; padding-left: 20px; }
.check-summary li { margin: 2px 0; }
.checks-tabs-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.checks-tabs-row .tabs { margin: 0; flex: 1 1 auto; }
.check-group { scroll-margin-top: 140px; }
/* Client priority (internal): High uses Danger (pale pink), Normal uses Information (pale blue), Low uses Success (pale green). */
:root { --prio-high-bg: var(--danger-bg); --prio-high-fg: var(--danger-fg); --prio-high-line: var(--danger-line);
        --prio-normal-bg: var(--info-bg); --prio-normal-fg: var(--info-fg); --prio-normal-line: var(--info-line);
        --prio-low-bg: var(--success-bg); --prio-low-fg: var(--success-fg); --prio-low-line: var(--success-line); }
.pill.priority-high { background: var(--prio-high-bg); color: var(--prio-high-fg); }
.pill.priority-normal { background: var(--prio-normal-bg); color: var(--prio-normal-fg); }
.pill.priority-low { background: var(--prio-low-bg); color: var(--prio-low-fg); }
.priority-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.priority-choice legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.priority-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.priority-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 96px;
    padding: 0 18px; border-radius: 10px; border: 2px solid transparent; font-weight: 600; cursor: pointer; opacity: .75; }
.priority-button input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.priority-button.priority-high { background: var(--prio-high-bg); color: var(--prio-high-fg); }
.priority-button.priority-normal { background: var(--prio-normal-bg); color: var(--prio-normal-fg); }
.priority-button.priority-low { background: var(--prio-low-bg); color: var(--prio-low-fg); }
.priority-button:hover { opacity: 1; }
.priority-edit { border: 0; cursor: pointer; font-family: inherit; }
.priority-edit:hover { filter: brightness(.96); text-decoration: underline; }
.priority-pop { max-width: 340px; }
.priority-pop .priority-button { min-width: 84px; font: inherit; font-weight: 600; }
.priority-button.is-current { opacity: 1; border-color: currentColor; }
.priority-button.is-current::before { content: "✓ "; }
.priority-button:has(input:checked) { opacity: 1; border-color: currentColor; box-shadow: 0 1px 4px rgba(20, 30, 20, .12); }
.priority-button:has(input:checked) span::before { content: "✓ "; }
.priority-button:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
/* Settings > Colours */
.colour-role { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 8px 20px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.colour-role:first-of-type { border-top: 0; }
.colour-role-head { display: flex; flex-direction: column; gap: 2px; }
.colour-role-body { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 720px) { .colour-role { grid-template-columns: 1fr; } }
.swatch-pick { padding: 0 8px; }
.swatch.is-current { box-shadow: 0 0 0 2px var(--ink); }
.swatch input[type=radio] { margin: 0; }
.colour-sample { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.colour-sample-row { display: inline-block; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.colour-grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sticky-sample { display: inline-flex; align-items: flex-end; width: 120px; height: 64px; padding: 8px 10px; border-radius: 3px 3px 12px 3px; color: #24211C; font-size: 14px; font-weight: 600; }
/* Settings > Access */
.access-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.access-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.access-table th, .access-table td { padding: 8px 12px; text-align: center; vertical-align: middle; }
.access-table .access-page-col, .access-table th[scope=row], .access-table th[scope=rowgroup] { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 260px; max-width: 340px; }
.access-person { min-width: 110px; vertical-align: bottom !important; }
.access-name { display: block; font-weight: 700; }
.access-role { display: block; font-size: 12px; font-weight: 500; }
.access-reset { font-size: 12px; min-height: 24px; }
.access-page { font-weight: 500; }
.access-default { display: block; font-size: 12px; font-weight: 400; }
.access-group-row th, .access-group-row td { background: var(--surface) !important; font-family: Manrope, Inter, sans-serif; font-weight: 800; border-top: 1px solid var(--line); }
.access-table input[type=checkbox] { width: 20px; height: 20px; cursor: pointer; }
.access-changed { background: var(--waiting-bg); }
.access-key { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; font-size: 13px; vertical-align: middle; }
.access-on { color: var(--success-fg); font-weight: 800; }
.access-changed-key { background: var(--waiting-bg); box-shadow: inset 0 0 0 1px var(--waiting-line); }
/* Client data checks progress graph */
.progress-summary { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.progress-summary strong { color: var(--ink); }
.progress-line { fill: none; stroke: var(--danger-strong); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.progress-dot { fill: var(--danger-strong); stroke: #fff; stroke-width: 1.5; pointer-events: none; }
.chart-bar.progress-resolved { fill: var(--success-strong); }
.chart-bar-group.is-active .chart-bar.progress-resolved { fill: var(--success-fg); }
.progress-range { display: flex; gap: 8px; font-size: 14px; }
.progress-range a[aria-current] { font-weight: 700; color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- WhatsApp (pilot) */
.wa-list { list-style: none; margin: 0; padding: 0; }
.wa-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.wa-list li:first-child { border-top: 0; }
.wa-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-messages { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; min-height: 200px; overflow-y: auto; background: var(--ground); border-radius: 10px; }
.wa-msg { display: flex; }
.wa-in { justify-content: flex-start; }
.wa-out { justify-content: flex-end; }
.wa-system { justify-content: center; }
.wa-bubble { max-width: min(560px, 85%); padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.wa-out .wa-bubble { background: #DCF5E3; border-color: #C3E8CE; }
.wa-system .wa-bubble { background: var(--info-bg); font-size: 14px; }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wa-status[data-status="failed"] { color: var(--bad-fg); font-weight: 600; }
.wa-status[data-status="read"] { color: #1F7A4D; }
.wa-media img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; }
.wa-media audio { max-width: 260px; }
.wa-empty { padding: 16px; text-align: center; }
.wa-composer { display: flex; gap: 8px; align-items: flex-end; }
.wa-composer textarea { flex: 1; resize: vertical; }
.wa-templates summary { cursor: pointer; font-weight: 600; }
.wa-phone-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.wa-phone-row:first-of-type { border-top: 0; }
.wa-phone-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wa-phone-actions form { margin: 0; }
.wa-chain { margin: 0; padding-left: 20px; }
.wa-call-card { position: fixed; right: 20px; bottom: 80px; z-index: 300; width: min(320px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-left: 6px solid #25D366; border-radius: var(--radius); box-shadow: 0 16px 40px -12px rgba(21,32,43,.35); padding: 14px 16px; display: grid; gap: 6px; }
.wa-call-title { font-family: Manrope, Inter, sans-serif; font-weight: 800; }
.wa-call-status { color: var(--muted); font-size: 14px; }
.wa-call-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) { [data-wa-columns] { grid-template-columns: 1fr !important; } }

/* Dashboard widgets */
.dash-toolbar { display: flex; justify-content: flex-end; margin: -8px 0 12px; }
/* Arrange dashboard: a solid button in the practice's Information colour (Settings > Colours), so it's easy to spot. */
.btn-arrange { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--info-strong); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 2px 8px -2px rgba(21,32,43,.3); transition: background-color .15s ease; }
.btn-arrange:hover { background: var(--info-fg); }
.btn-arrange:focus-visible { outline: 3px solid var(--info-line); outline-offset: 2px; }
.btn-arrange[hidden] { display: none; }
.dash-arrange-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; border-left: 4px solid var(--brand); }
.dash-arrange-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dash-arrange-actions form { margin: 0; }
.dash-default-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.dash-default-form select { width: auto; min-width: 140px; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .widget-wide { grid-column: auto !important; } }
.widget { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); min-width: 0; }
.widget-wide { grid-column: span 2; }
.widget-linked { transition: box-shadow .15s ease, border-color .15s ease; }
.widget-linked:hover { border-color: var(--brand); box-shadow: 0 6px 18px -10px rgba(21,32,43,.35); }
.widget-title { font-size: 15px; font-weight: 700; margin: 0; font-family: Inter, system-ui, sans-serif; letter-spacing: 0; }
.widget-link { color: var(--ink); text-decoration: none; }
.widget-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }   /* the whole card opens the page */
.widget-link:focus-visible { outline: none; }
.widget-link:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 2px; }
.widget a:not(.widget-link), .widget button, .widget .chart-bar-group { position: relative; z-index: 1; }   /* links inside stay clickable */
.widget-value { margin: 0; font-family: Manrope, Inter, sans-serif; font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.widget-value-danger { color: var(--danger-fg); }
.widget-value-warning { color: var(--warning-fg); }
.widget-big-text { margin: 0; font-size: 20px; font-weight: 700; }
.widget-note { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.widget-list { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.widget-list li { margin: 2px 0; }
.widget-table { width: 100%; font-size: 14px; }
.widget-table th, .widget-table td { padding: 6px 8px; }
.widget .chart { border: 0; padding: 0; }
.widget-tools { position: relative; z-index: 2; display: flex; gap: 6px; align-items: center; margin: -6px -8px 4px; }
.widget-tools[hidden] { display: none; }
.widget-handle { cursor: grab; font-size: 18px; color: var(--muted); padding: 0 4px; }
.widget-tool { min-height: 32px; min-width: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; font-size: 13px; cursor: pointer; }
.widget-tool:hover { background: var(--hover); }
.dash-arranging .widget { border-style: dashed; border-color: var(--line-strong); cursor: grab; touch-action: none; user-select: none; -moz-user-select: none; }
.dash-arranging .widget * { -webkit-user-drag: none; }
.widget.is-dragging { cursor: grabbing; box-shadow: 0 12px 28px -12px rgba(21,32,43,.45); }
.dash-arranging .widget-link::after { display: none; }
.dash-arranging .widget a { pointer-events: none; }
.widget.is-dragging { opacity: .5; }
.needs-note { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* Import clients (settings/imports) */
.import-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.import-tiles .card { padding: 14px 16px; }
.import-tiles p { margin: 0; }
.import-tile-value { font-family: Manrope, Inter, sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.import-table td { vertical-align: top; }
.import-choice { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.import-option { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; min-height: 32px; white-space: nowrap; }
.import-problems { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.import-problems ul { margin: 2px 0 0; padding-left: 18px; font-size: 14px; }
.client-refs { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* Client list: tick to archive or restore (public/js/bulk-select.js) */
.bulk-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 12px; }
.bulk-assign { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-assign select { width: auto; min-width: 180px; min-height: 40px; }
.bulk-cell { width: 44px; padding-left: 20px !important; }
.bulk-cell input { width: 20px; height: 20px; margin: 0; cursor: pointer; }

/* Jobs and workflows */
.job-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.job-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; scroll-margin-top: 90px; }
.job-step-current { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.job-step-done { background: var(--surface); }
.job-step-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.job-step-number { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.job-step-done .job-step-number { background: var(--success-bg); color: var(--success-fg); }
.job-step-name { font-size: 18px; margin: 0 0 6px; }
.job-step-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.job-step-dates { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 10px; font-size: 14px; }
.job-step-dates dt { color: var(--muted); }
.job-step-dates dd { margin: 0; font-weight: 600; }
.job-step-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 14px; }
.job-step-note-action summary { list-style: none; }
.job-step-note-action summary::-webkit-details-marker { display: none; }
.job-step-note-action[open] { flex: 1 1 100%; }
.job-step-more { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.job-step-more > summary, .workflow-row details > summary { cursor: pointer; min-height: 32px; color: var(--muted); font-weight: 600; }
.carry-note { background: var(--waiting-bg); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.request-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.request-items li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.request-items li > span { flex: 1 1 200px; }
.workflow-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.workflow-step-row { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.workflow-step-row[data-new-step] { border-style: dashed; }
.workflow-step-grid { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; }
.workflow-row { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.workflow-row:first-of-type { border-top: 0; padding-top: 0; }
.step-people select { min-width: 160px; }
.step-people th[scope=row] { white-space: normal; }
.next-step { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.next-step-body { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.next-step-name { font-size: 18px; font-weight: 600; }

/* Setup checklist */
.setup-progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; max-width: 520px; }
.setup-progress span { display: block; height: 100%; background: var(--brand); }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-item { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.setup-item:first-child { border-top: 0; }
.setup-mark { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.setup-done .setup-mark { background: var(--success-strong); border-color: var(--success-strong); }
.start-task { background: var(--brand-soft); border-radius: 12px; padding: 14px 16px; }
.capacity-line strong { font-size: 18px; }
tr.capacity-selected td { background: var(--brand-soft); }
.widget-capacity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.widget-capacity li { display: flex; flex-direction: column; gap: 2px; }
.choice-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.choice-card { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; font-weight: 400; margin: 0; }
.choice-card:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.choice-card input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.choice-card-body { display: flex; flex-direction: column; gap: 8px; }

/* Tasks > Board: one workflow's tasks for a period, as a table or a view-only kanban. */
.board-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 18px; margin-bottom: 14px; }
.board-switch { display: flex; gap: 6px; margin-left: auto; }
.board-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.board-legend li { display: flex; align-items: center; gap: 6px; }
.board-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.tone-done { background: var(--success-bg); border-color: var(--success-line); }
.tone-current { background: var(--info-bg); border-color: var(--info-line); }
.tone-waiting { background: var(--waiting-bg); border-color: var(--waiting-line); }
.tone-problem { background: var(--danger-bg); border-color: var(--danger-line); }
.tone-later { background: var(--ground); }
.board-table td.tone-later .board-cell-status { color: var(--muted); font-weight: 500; }
.tone-skipped { background: repeating-linear-gradient(135deg, var(--ground), var(--ground) 4px, var(--line) 4px, var(--line) 5px); }
.board-table th[scope="row"] { font-weight: 600; min-width: 170px; text-align: left; }
.board-table th[scope="row"] .muted { font-weight: 400; }
.board-table td.board-cell { min-width: 120px; vertical-align: top; border-left: 1px solid var(--line); font-size: 14px; }
.board-table td.tone-none { color: var(--muted); text-align: center; }
.board-table td.tone-current { box-shadow: inset 3px 0 0 var(--info-strong); }
.board-table td.tone-problem { box-shadow: inset 3px 0 0 var(--danger-fg); }
.board-table td.tone-waiting { box-shadow: inset 3px 0 0 var(--waiting-strong); }
.board-cell-status { display: block; font-weight: 600; line-height: 1.3; }
.board-cell-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; color: var(--ink); font-size: 13px; }
.board-initials { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 11px; background: #fff; border: 1px solid var(--line); font-size: 11px; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.board-initials-review { border-style: dashed; }
.kanban { position: relative; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.kanban-col { flex: 1 0 180px; max-width: 300px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.kanban-head { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.kanban-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kanban-card { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.kanban-card:hover, .kanban-card:focus-visible { color: var(--ink); box-shadow: 0 0 0 2px var(--brand); }
.kanban-empty { padding: 6px 2px; }
@media (max-width: 640px) { .board-switch { margin-left: 0; } .kanban-col { flex-basis: 78vw; } }
/* Moving cards on the board. */
.kanban-item { display: grid; gap: 6px; }
.kanban-item[draggable="true"] > .kanban-card { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.kanban-item.is-dragging { opacity: .45; }
.kanban-item.is-moving { opacity: .6; pointer-events: none; }
.kanban-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.kanban-actions .btn-sm { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.kanban-col.drop-ok { border: 2px dashed var(--brand); padding: 11px; }
.kanban-col.drop-over { background: var(--brand-soft); }
.board-moved { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.move-back { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: min(460px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.move-back::backdrop { background: rgba(21,32,43,.45); }
/* Task page: finished steps folded under Completed, small and pale green with a tick. */
.job-steps-done { margin-top: 20px; }
.job-steps-done-title { font-size: 16px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; color: var(--success-fg); }
.job-steps-compact { gap: 6px; }
.job-step-folded > details { background: var(--success-bg); border: 1px solid var(--success-line); border-radius: 12px; scroll-margin-top: 90px; }
.job-step-folded > details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px; cursor: pointer; list-style: none; font-size: 14px; color: var(--success-fg); min-height: 44px; }
.job-step-folded > details > summary::-webkit-details-marker { display: none; }
.job-step-folded > details > summary::after { content: "Show"; margin-left: auto; font-size: 13px; text-decoration: underline; }
.job-step-folded > details[open] > summary::after { content: "Hide"; }
.job-step-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--success-strong); color: #fff; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.job-step-folded-name { font-weight: 600; color: var(--ink); }
.job-step-folded-meta { font-size: 13px; }
.job-step-folded > details > .job-step { border: 0; border-top: 1px solid var(--success-line); border-radius: 0 0 12px 12px; }
/* Board table: finished steps small and pale green with a tick; the current step has its button. */
.board-table td.board-cell-done { min-width: 76px; width: 76px; padding: 8px 10px; vertical-align: middle; font-size: 12px; color: var(--success-fg); white-space: nowrap; }
.board-table td.board-cell-done.tone-done { background: var(--success-bg); }
.board-tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--success-strong); color: #fff; font-size: 12px; font-weight: 700; margin-right: 4px; vertical-align: middle; }
.tone-skipped .board-tick { background: var(--muted); }
.board-table td.board-cell-current { min-width: 150px; }
.board-move-on { margin-top: 8px; }
.board-move-on .btn-sm { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.board-phone { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 640px) {
  .board-table-card { display: none; }
  .board-phone { display: grid; gap: 12px; }
}
.board-phone-card { padding: 14px; display: grid; gap: 10px; }
.board-phone-client { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.board-phone-current { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.board-phone-current > strong { font-size: 17px; }
.board-phone-current .board-move-on .btn-sm { min-height: 44px; font-size: 15px; width: 100%; }
.board-phone-finished { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--success-bg); color: var(--success-fg); font-weight: 600; }
.board-phone-tocome { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.board-phone-tocome li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 2px; border-bottom: 1px dashed var(--line-soft); color: var(--muted); }
.board-phone-done { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success-fg); }
.board-phone-done > .small { font-weight: 700; margin-right: 2px; }
.board-done-chip { font-size: 12px; background: #fff; border: 1px solid var(--success-line); border-radius: 999px; padding: 2px 8px; }
/* Kanban: steps every client has done fold into a small pale-green strip below the columns. */
.kanban-completed { background: var(--success-bg); border: 1px solid var(--success-line); border-radius: 12px; padding: 10px 14px; margin: 4px 0 12px; color: var(--success-fg); }
.kanban-completed-title { font-size: 14px; margin: 0 0 6px; }
.kanban-completed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.kanban-completed li { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--ink); }
.kanban-completed li .small { color: var(--success-fg); font-weight: 400; margin-left: 4px; }
/* Linking clients: chips for chosen clients and a suggestion list as you type. */
.link-chips { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.link-chips:empty { display: none; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: 14px; }
.link-chip-remove { border: 0; background: transparent; font-size: 18px; line-height: 1; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--ink); }
.link-chip-remove:hover, .link-chip-remove:focus-visible { background: var(--card); }
.link-picker { position: relative; }
.link-options { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 28px -12px rgba(21,32,43,.35); max-height: 340px; overflow-y: auto; }
.link-options-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: .03em; }
.link-option { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.link-option:hover, .link-option.is-active { background: var(--brand-soft); }
.related-groups { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.related-group-title { font-size: 15px; margin: 0 0 6px; color: var(--muted); }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.related-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.related-list li > div { display: grid; gap: 1px; min-width: 0; }
.related-add > summary { list-style: none; display: inline-flex; }
.related-add > summary::-webkit-details-marker { display: none; }
.officer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.officer { display: grid; gap: 8px; padding: 14px 16px; }
.officer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.officer-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
/* Search: the box in the top bar with quick results, and the results page. */
.topsearch { position: relative; display: flex; align-items: center; }
.topsearch > svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.topsearch input { width: 220px; min-height: 40px; padding: 0 12px 0 34px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font: inherit; font-size: 15px; transition: width .15s; }
.topsearch input:focus { width: 300px; }
.topsearch-results { position: absolute; z-index: 120; right: 0; top: calc(100% + 6px); width: min(520px, 90vw); max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 36px -16px rgba(21,32,43,.4); padding: 10px 12px; color: var(--ink); }
.search-quick-group h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 4px 4px; }
.search-quick-empty { margin: 6px 4px; color: var(--muted); }
.search-quick-all { display: block; margin: 8px 4px 2px; font-weight: 600; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.search-result { padding: 8px 10px; border-radius: 10px; display: grid; gap: 2px; }
.search-result:hover, .search-result:focus-within { background: var(--hover); }
.search-result-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-result-title { font-weight: 700; }
.search-matches { list-style: none; margin: 2px 0 0; padding: 0; font-size: 14px; display: grid; gap: 1px; overflow-wrap: anywhere; }
.search-match-label { color: var(--muted); }
.search-matches mark, .search-result mark { background: var(--feedback); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.search-links { margin-top: 2px; }
.search-page-form { display: flex; gap: 10px; padding: 14px; margin-bottom: 14px; }
.search-page-form input { flex: 1; min-width: 0; min-height: 48px; font-size: 17px; }
.search-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.search-jump a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-size: 14px; }
.search-group h2 { font-size: 18px; margin: 0 0 8px; }
.search-compact { display: none; }
@media (max-width: 999px) {
  .search-compact { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); }
  .search-compact[aria-current=page] { background: var(--brand-soft); }
}

/* A company's directors and PSCs, above the tabs. */
.officers-panel { display: grid; gap: 10px; margin-bottom: 16px; padding: 18px 20px; }
.officers-panel h2 { font-size: 18px; margin: 0; }
.officer-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.officer-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--success-bg); border: 1px solid var(--success-line); font-size: 15px; }
.officer-chip a { font-weight: 600; }
.officers-missing-title { font-size: 15px; margin: 4px 0 0; display: flex; align-items: center; gap: 8px; }
.officers-missing { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.officer-missing { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.officer-missing-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.officer-missing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.officer-missing-actions form { margin: 0; }
.officer-find > summary { list-style: none; cursor: pointer; }
.officer-find > summary::-webkit-details-marker { display: none; }
.officer-find[open] { flex: 1 1 100%; }
.officer-find-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 8px; }
.officer-find-form .link-picker-field { flex: 1 1 240px; }
.officers-missing .officer-missing.check-box { padding: 10px 12px; border-radius: 12px; }
.officers-missing .officer-missing.check-missing { background: var(--danger-bg); border-color: var(--danger-line); }

/* ── New client or prospect wizard and the sales pipeline (onboarding/*) ── */
.alert-info { background: var(--info-bg); color: var(--info-fg); }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 24px; padding: 0; font-size: 14px; color: var(--muted); }
.wizard-steps li { display: inline-flex; align-items: center; gap: 8px; }
.wizard-steps a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.wizard-steps a:hover { color: var(--ink); }
.wizard-steps .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); font-weight: 600; font-size: 13px; }
.wizard-steps .done .n { background: var(--success-bg); color: var(--success-fg); border-color: transparent; }
.wizard-steps .current { color: var(--ink); font-weight: 600; }
.wizard-steps .current .n { background: var(--brand); color: #fff; border-color: transparent; }
.choice-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px 16px; cursor: pointer; font-weight: 400; margin: 0; }
.choice-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.choice-card input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.choice-card > span { display: grid; gap: 4px; }
.ch-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ch-results li, .ch-picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ch-picked { background: var(--surface); }
.service-ticks { display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.review-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; }
.review-parties { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review-parties li { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.review-parties li:last-child { border-bottom: 0; padding-bottom: 0; }
.proposal-placeholder { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; }
.stage-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

/* Archive a client: reason asked inline (billing log) */
.archive-client { position: relative; }
.archive-client > summary { list-style: none; cursor: pointer; }
.archive-client > summary::-webkit-details-marker { display: none; }
.archive-client-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, calc(100vw - 32px));
    display: grid; gap: 6px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.archive-client-form p { margin: 0; }

/* Free trial countdown (partials/trial-countdown): bottom-left, clear of the messages tab on the right. */
.trial-pill { position: fixed; left: 16px; bottom: 16px; z-index: 900; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 16px; background: var(--info-bg); color: var(--info-fg); border: 1px solid var(--info-line); font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: 0 2px 8px rgba(21,32,43,.10); }
a.trial-pill:hover { background: var(--card); color: var(--info-fg); }
.trial-pill-soon { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-line); }
a.trial-pill-soon:hover { color: var(--warning-fg); }
@media print { .trial-pill { display: none; } }

/* Storage used (partials/storage-pill), in the header. */
.storage-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.storage-pill-full { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-line); }
@media (max-width: 900px) { .storage-pill { display: none; } }

/* Time recording (resources/views/time) */
.time-toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 18px; }
.time-toolbar .field { margin: 0; }
.time-grid-wrap { max-height: 70vh; overflow: auto; }
.time-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.time-grid th, .time-grid td { white-space: nowrap; vertical-align: middle; }
.time-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface, #fff); font-size: 13px; white-space: normal; min-width: 92px; max-width: 140px; }
.time-grid .time-grid-first { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); text-align: left; min-width: 200px; max-width: 260px; white-space: normal; }
.time-grid thead .time-grid-first { z-index: 3; }
.time-grid-section th { background: var(--panel, #F7F8F5); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5B6670); text-align: left; position: sticky; left: 0; }
.time-cell { display: flex; align-items: center; gap: 6px; }
.time-cell-total { min-width: 36px; font-variant-numeric: tabular-nums; font-weight: 600; }
.time-cell-total.is-empty { color: var(--muted, #5B6670); font-weight: 400; }
.time-cell input { width: 58px; padding: 6px 8px; font-size: 15px; text-align: right; }
.time-cell input[aria-invalid="true"] { border-color: var(--bad-fg); outline: 2px solid var(--bad-fg); }
.time-format-note strong { white-space: nowrap; }
.time-week td, .time-week th { text-align: right; font-variant-numeric: tabular-nums; }
.time-week th:first-child, .time-week td:first-child { text-align: left; }
.time-week tfoot td, .time-week tfoot th { font-weight: 700; border-top: 2px solid var(--line); }
.time-timer { position: fixed; right: 16px; bottom: 16px; z-index: 900; width: min(340px, calc(100vw - 32px)); background: var(--surface, #fff); border: 2px solid var(--brand, #1F5F8B); border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(21,32,43,.45); padding: 12px 14px; }
.time-timer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.time-timer-clock { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-timer select { width: 100%; margin: 6px 0; }
.time-timer.is-small .time-timer-body { display: none; }
.time-cal { border-collapse: collapse; font-size: 13px; }
.time-cal th, .time-cal td { border: 1px solid var(--line); padding: 4px; text-align: center; min-width: 26px; }
.time-cal th:first-child, .time-cal td:first-child { text-align: left; min-width: 140px; white-space: nowrap; }
.time-cal .is-weekend { background: var(--panel, #F7F8F5); }
.time-cal .is-off { background: var(--success-bg); color: var(--success-fg); font-weight: 700; }
.time-cal .is-pending { background: var(--warn-bg); color: var(--warn-fg); }
@media print { .time-timer { display: none; } }

/* Holiday overview (resources/views/time/holiday-overview.blade.php) */
.holiday-soon { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.holiday-h2 { font-size: 18px; margin: 0 0 10px; }
.holiday-today-name { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.holiday-row { padding: 6px 0; border-top: 1px solid var(--line); }
.holiday-row:first-of-type { border-top: 0; padding-top: 0; }
.holiday-clash { border-left: 4px solid var(--warn-fg); }
.holiday-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 20px 10px; }
.time-cal .is-today { outline: 2px solid var(--brand, #1F5F8B); outline-offset: -2px; }
.time-cal .is-half.is-off { background: linear-gradient(135deg, var(--success-bg) 50%, transparent 50%); }
.holiday-planner { border-collapse: collapse; font-size: 12px; }
.holiday-planner th, .holiday-planner td { border: 1px solid var(--line); padding: 3px 2px; text-align: center; min-width: 22px; }
.holiday-planner tbody th, .holiday-planner thead th:first-child { text-align: left; min-width: 140px; white-space: nowrap; padding: 3px 8px; position: sticky; left: 0; background: var(--surface, #fff); z-index: 1; }
.holiday-planner-month { font-weight: 700; background: var(--panel, #F7F8F5); }
.holiday-planner .is-full { background: var(--success-fg); color: #fff; font-weight: 700; }
.holiday-planner .is-part { background: var(--success-bg); color: var(--success-fg); font-weight: 700; }
.holiday-planner .is-pending { background: var(--warn-bg); color: var(--warn-fg); }
.holiday-planner .is-today { outline: 2px solid var(--brand, #1F5F8B); outline-offset: -2px; }
.holiday-bh { color: var(--warn-fg); display: block; line-height: .6; }
.holiday-allowances { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; }
.holiday-allowance-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.holiday-bar { display: flex; height: 12px; border-radius: 6px; background: var(--panel, #EEF0EC); overflow: hidden; margin-bottom: 4px; }
.holiday-bar-taken { background: var(--success-fg); }
.holiday-bar-booked { background: #6FB58A; }
.holiday-bar-pending { background: var(--warn-fg); opacity: .6; }
.holiday-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-left: 8px; }

/* "Did this help?" (help/partials/did-this-help) */
.help-helped { margin: 24px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; max-width: 720px; }
.help-video .help-helped { margin: 0 16px 12px; }
.help-helped-ask { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.help-helped-ask span { font-weight: 600; margin-right: 4px; }
.help-helped-done { margin: 0; color: var(--muted); }
.help-helped-more { display: grid; gap: 8px; }
.help-helped-more textarea { width: 100%; }
.help-helped-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.link-button { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }
.help-bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-bottom: 2px; }
.help-bar span { display: block; height: 100%; background: var(--brand); }
td.num, th.num { text-align: right; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Documents: drop-zone uploads, the review and file queue */
.doc-upload { display: flex; flex-direction: column; gap: 12px; }
.doc-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink); background: var(--card); }
.doc-drop svg { color: var(--brand); }
.doc-drop.is-over { border-color: var(--brand); background: var(--info-bg); }
.doc-choose { color: var(--brand-dark); text-decoration: underline; cursor: pointer; font-weight: 600; }
.doc-choose input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-choose:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.doc-error { color: var(--bad-fg); }
.doc-upload-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.doc-upload-row .field { flex: 1 1 200px; margin: 0; }
.doc-bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.doc-bulk-move { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-queue { display: flex; flex-direction: column; gap: 12px; }
.doc-queue .card + .card { margin-top: 0; }
.doc-item { padding: 18px; }
.doc-item-inbox { border-left: 4px solid var(--warn-fg); }
.doc-item-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.doc-item-head input[type=checkbox] { width: 22px; height: 22px; margin-top: 4px; }
.doc-title { font-size: 17px; margin: 0; overflow-wrap: anywhere; }
.doc-file-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; margin-top: 14px; }
.doc-file-form .field { margin: 0; }
.doc-file-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* The version under the sign-in and demo cards. */
.version-line { text-align: center; margin: 12px 0 0; }

/* Document viewer (js/document-viewer.js): a document opens over the page rather than downloading. */
.doc-viewer { width: min(1100px, calc(100vw - 24px)); height: calc(100vh - 24px); max-width: none; max-height: none; padding: 0; border: 0;
    border-radius: 14px; overflow: hidden; background: var(--card); color: var(--ink); }
.doc-viewer[open] { display: flex; flex-direction: column; }
.doc-viewer::backdrop { background: rgba(21, 32, 43, .55); }
.doc-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc-viewer-nav { display: flex; align-items: center; gap: 6px; }
.doc-viewer-nav .btn { min-width: 40px; padding: 0 10px; font-size: 20px; }
.doc-viewer-title { flex: 1; min-width: 160px; margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-viewer-body { flex: 1; min-height: 0; background: #E9ECE8; overflow: auto; display: flex; }
.doc-viewer-frame { flex: 1; width: 100%; border: 0; display: block; }
.doc-viewer-image { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; display: block; }
.doc-viewer-message { margin: auto; padding: 24px; max-width: 460px; text-align: center; color: var(--muted); }
.doc-viewer-error { color: var(--danger-fg); }
@media (max-width: 640px) {
    .doc-viewer { width: 100vw; height: 100vh; border-radius: 0; }
    .doc-viewer-title { order: -1; flex-basis: 100%; }
}

/* Documents that came in by email: the email beside the document. */
.doc-email { margin-top: 6px; }
.doc-email-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.doc-email-details summary { cursor: pointer; font-size: 14px; }
.doc-email-body { white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 12px; margin-top: 6px; font-size: 14px; max-height: 260px; overflow: auto; }
.doc-email-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-email-actions form { margin: 0; }
.inbound-address { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }

/* ClientVue: the client portal. Phone first: most clients will open it from an email on their phone. */
.cv-main { padding-top: 32px; }
.cv-wide { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }
.cv-h1 { font-size: 28px; line-height: 1.2; margin: 0; }
.cv-topbar { gap: 8px; }
.cv-account { display: flex; align-items: center; gap: 16px; }
.cv-account form { margin: 0; }
@media (max-width: 520px) {
    .topbar-inner.cv-topbar { flex-wrap: wrap; }
    .cv-topbar .brand { flex: 1 0 100%; min-width: 0; }
    .cv-account { flex: 1 0 100%; justify-content: space-between; }
    .cv-account .cv-switch, .cv-account .btn-link { white-space: nowrap; }
}
.cv-switch { font-weight: 600; }
.cv-preview-banner { background: var(--info-bg); color: var(--info-fg); display: flex; flex-wrap: wrap; justify-content: center;
    gap: 6px 16px; padding: 8px 16px; font-size: 14px; font-weight: 600; text-align: center; }
.cv-hello p { margin: 0 0 4px; }
.cv-summary { margin: 10px 0 0; }
.cv-summary .pill { font-size: 14px; padding: 6px 10px; }
.cv-request { border-left: 4px solid var(--brand); background: var(--surface); border-radius: 0 10px 10px 0; padding: 12px 14px; }
.cv-request-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.cv-note { margin: 8px 0 0; white-space: pre-line; }
.cv-items { margin: 8px 0 0; padding-left: 20px; }
.cv-items li + li { margin-top: 4px; }
.cv-columns { display: grid; grid-template-columns: 1fr; gap: 20px; }
.cv-columns .card + .card { margin-top: 0; }
@media (min-width: 760px) { .cv-columns { grid-template-columns: 1fr 1fr; } }
.cv-dates, .cv-tasks, .cv-company-list { list-style: none; margin: 0; padding: 0; }
.cv-dates li { display: grid; grid-template-columns: 92px 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.cv-dates li > :last-child { grid-column: 2; }
.cv-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.cv-late { color: var(--danger-fg); font-weight: 600; }
.cv-tasks li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.cv-task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cv-progress { height: 6px; background: var(--line-soft); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.cv-progress span { display: block; height: 100%; background: var(--brand); }
.cv-contact { text-align: center; }
.cv-practice-name { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0; }
.cv-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.cv-company-list li + li { margin-top: 8px; }
.cv-company-list form { margin: 0; }
.cv-company { width: 100%; min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 16px; font: inherit; color: var(--ink); cursor: pointer; }
.cv-company:hover, .cv-company:focus-visible { border-color: var(--brand); }
.cv-company[aria-current=true] { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.cv-company-name { font-weight: 600; }
.cv-row-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; }
.cv-row-actions form { margin: 0; }
