/* =====================================================================
   VYVE Command Centre — Refine layer (Nov 2026)
   Loaded LAST. One calm, enterprise-grade layer over every page:
   graphite surfaces, teal reserved for action and state, one type
   family, one page-header style, quiet sentence-case labels.
   Rollback = remove the <link> to this file in index.html.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font-head: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-head);
  /* Mono is retired as a costume: every var(--font-mono) now renders in Geist with
     tabular figures. Real code and keys use --font-code. */
  --font-mono: var(--font-head);
  --font-code: 'Geist Mono', 'SF Mono', ui-monospace, monospace;

  --bg: #F5F6F6; --bg-alt: #F9FAFA; --surface: #FFFFFF;
  --surface-2: #F2F4F4; --surface-3: #E8ECEC; --surface-sunken: #EEF1F1;
  --surface-raised: #FFFFFF;
  --border: #E3E7E7; --border-strong: #CDD4D4;
  --text: #101A1A; --text-muted: #53625F; --text-dim: #6F7D7B;

  --accent: #17706F; --accent-hover: #115A59; --accent-pale: #E3F0EF;
  --accent-light: #2E8A88; --on-accent: #FFFFFF;
  --gold: #8A6D24; --gold-pale: #F5EEDA;

  --hover-overlay: rgba(16,26,26,.04); --active-overlay: rgba(16,26,26,.07);
  --focus-ring: 0 0 0 3px rgba(23,112,111,.22);

  --sidebar-bg: #FAFBFB; --sidebar-bg-2: #F3F5F5;
  --sidebar-text: #485754; --sidebar-active: #EAEEEE; --sidebar-active-fg: #101A1A;
  --sidebar-hover: rgba(16,26,26,.04); --sidebar-section: #7A8785;
  --sidebar-border: #E3E7E7;

  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px;
  --shadow-xs: none;
  --shadow-sm: 0 1px 2px rgba(16,26,26,.04);
  --shadow-md: 0 2px 6px rgba(16,26,26,.05), 0 8px 24px rgba(16,26,26,.06);
  --shadow-lg: 0 8px 24px rgba(16,26,26,.08), 0 24px 48px rgba(16,26,26,.10);
  --shadow-xl: 0 12px 32px rgba(16,26,26,.10), 0 32px 64px rgba(16,26,26,.14);
  --elev-card: none;

  --t-fast: .15s cubic-bezier(.22,1,.36,1);
  --t-base: .2s cubic-bezier(.22,1,.36,1);
  --sidebar-w: 248px;
}

html[data-theme="dark"] {
  --bg: #0C1010; --bg-alt: #0E1313; --surface: #121818;
  --surface-2: #171E1E; --surface-3: #1E2727; --surface-sunken: #0A0E0E;
  --surface-raised: #171E1E;
  --border: rgba(225,240,238,.075); --border-strong: rgba(225,240,238,.14);
  --text: #E8EEED; --text-muted: #A1AEAC; --text-dim: #7D8B89;
  --accent: #4FB3AE; --accent-hover: #6CC4BF; --accent-pale: rgba(79,179,174,.12);
  --accent-light: #6CC4BF; --on-accent: #06201F;
  --gold: #D4B865; --gold-pale: rgba(212,184,101,.12);
  --hover-overlay: rgba(232,238,237,.045); --active-overlay: rgba(232,238,237,.08);
  --focus-ring: 0 0 0 3px rgba(79,179,174,.30);
  --sidebar-bg: #090C0C; --sidebar-bg-2: #090C0C;
  --sidebar-text: #A1AEAC; --sidebar-active: rgba(232,238,237,.07); --sidebar-active-fg: #F2F6F5;
  --sidebar-hover: rgba(232,238,237,.04); --sidebar-section: #6E7C7A;
  --sidebar-border: rgba(225,240,238,.06);
  --shadow-sm: none; --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.5); --shadow-xl: 0 24px 64px rgba(0,0,0,.55);
  --success: #5BD08A; --warning: #E7AE5C; --danger: #F08484; --info: #74AEF5;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0C1010; --bg-alt: #0E1313; --surface: #121818;
    --surface-2: #171E1E; --surface-3: #1E2727; --surface-sunken: #0A0E0E;
    --surface-raised: #171E1E;
    --border: rgba(225,240,238,.075); --border-strong: rgba(225,240,238,.14);
    --text: #E8EEED; --text-muted: #A1AEAC; --text-dim: #7D8B89;
    --accent: #4FB3AE; --accent-hover: #6CC4BF; --accent-pale: rgba(79,179,174,.12);
    --accent-light: #6CC4BF; --on-accent: #06201F;
    --gold: #D4B865; --gold-pale: rgba(212,184,101,.12);
    --hover-overlay: rgba(232,238,237,.045); --active-overlay: rgba(232,238,237,.08);
    --focus-ring: 0 0 0 3px rgba(79,179,174,.30);
    --sidebar-bg: #090C0C; --sidebar-bg-2: #090C0C;
    --sidebar-text: #A1AEAC; --sidebar-active: rgba(232,238,237,.07); --sidebar-active-fg: #F2F6F5;
    --sidebar-hover: rgba(232,238,237,.04); --sidebar-section: #6E7C7A;
    --sidebar-border: rgba(225,240,238,.06);
    --shadow-sm: none; --shadow-md: 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.5); --shadow-xl: 0 24px 64px rgba(0,0,0,.55);
    --success: #5BD08A; --warning: #E7AE5C; --danger: #F08484; --info: #74AEF5;
  }
}

/* ---------- 2. Base and browser surfaces ---------- */
html, body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 0, "cv11" 1;
}
body { background: var(--bg); color: var(--text); letter-spacing: -0.003em; }
::selection { background: var(--accent-pale); color: var(--text); }
html[data-theme="dark"] ::selection { background: rgba(79,179,174,.28); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { text-underline-offset: 3px; }
input, textarea { caret-color: var(--accent); }

/* No italics anywhere (house style) */
#app em, #app i, #app cite, #app [style*="italic"], #login em, #login i { font-style: normal !important; }

/* Figures line up in every table, KPI and count */
#page-slot, .nav-item, .topnav { font-variant-numeric: tabular-nums; }

/* Mono only for code and keys, never as a costume */
#app [style*="font-mono"], #app [style*="DM Mono"], #app [style*="monospace"] { font-family: var(--font-body) !important; }
#page-slot code, #page-slot kbd, kbd { font-family: var(--font-code) !important; font-size: .86em; }

/* ---------- 3. Sidebar (now the "All pages" drawer) ---------- */
.sidebar { background: var(--sidebar-bg) !important; border-right: 1px solid var(--sidebar-border) !important; }
.sidebar .brand { padding: 20px 20px 14px !important; border-bottom: 0 !important; }
.sidebar .brand-title { font-family: var(--font-head) !important; font-size: 17px !important; font-weight: 700 !important; letter-spacing: .06em !important; color: var(--text) !important; }
.sidebar .brand-sub { font-family: var(--font-head) !important; font-size: 12.5px !important; font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-dim) !important; margin-top: 2px !important; }
.sidebar .brand-tagline { display: none !important; }
.nav-section { padding: 6px 10px 2px !important; }
.nav-section-label {
  font-family: var(--font-head) !important; font-size: 12px !important; font-weight: 500 !important;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--sidebar-section) !important;
  padding: 10px 10px 4px !important; display: flex !important; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; border-radius: 6px;
}
.nav-section-label:hover { color: var(--text) !important; }
.nav-section-label .rf-chev { width: 14px; height: 14px; opacity: .55; transition: transform var(--t-fast); flex: none; }
.nav-section.rf-collapsed .rf-chev { transform: rotate(-90deg); }
.nav-section.rf-collapsed .nav-item { display: none !important; }
.nav-item {
  font-family: var(--font-head) !important; font-size: 13.5px !important; font-weight: 450 !important;
  color: var(--sidebar-text) !important; padding: 7px 10px !important; border-radius: 7px !important;
  min-height: 32px; gap: 10px !important; letter-spacing: -0.005em !important;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--sidebar-hover) !important; color: var(--text) !important; }
.nav-item.active { background: var(--sidebar-active) !important; color: var(--sidebar-active-fg) !important; font-weight: 550 !important; }
.nav-item.active::before { display: none !important; }
.nav-item svg { width: 16px !important; height: 16px !important; stroke-width: 1.75 !important; opacity: .7; }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.sidebar-footer { border-top: 1px solid var(--sidebar-border) !important; background: transparent !important; }
.sidebar-footer .email { color: var(--text-muted) !important; font-family: var(--font-head) !important; }
.sidebar-footer button { color: var(--text-muted) !important; border-color: var(--border) !important; background: transparent !important; font-family: var(--font-head) !important; }
.sidebar-footer .footer-version { font-family: var(--font-head) !important; color: var(--text-dim) !important; }

/* ---------- 4. Top bar ---------- */
.topnav { background: color-mix(in srgb, var(--bg) 86%, transparent) !important; backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
.topnav-eyebrow { display: none !important; }
.topnav-wordmark { font-family: var(--font-head) !important; letter-spacing: .06em !important; font-weight: 700 !important; }
.topnav-bell, .topnav-menu { color: var(--text-muted) !important; border-radius: 8px !important; background: transparent !important; border: 0 !important; }
.topnav-bell:hover, .topnav-menu:hover { background: var(--hover-overlay) !important; color: var(--text) !important; }
.topnav-bell svg, .topnav-menu svg, .topnav-search svg { stroke-width: 1.75; }
.topnav-search { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; color: var(--text-dim) !important; font-family: var(--font-head) !important; box-shadow: none !important; }
.topnav-search:hover { border-color: var(--border-strong) !important; color: var(--text-muted) !important; }
.topnav-search-kbd { font-family: var(--font-code) !important; background: var(--surface-2) !important; border: 1px solid var(--border) !important; color: var(--text-dim) !important; border-radius: 5px !important; }
.topnav-role { font-family: var(--font-head) !important; background: transparent !important; border: 1px solid var(--border-strong) !important; color: var(--text-muted) !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; font-size: 12px !important; border-radius: 6px !important; padding: 3px 8px !important; }
#viewas-select { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; color: var(--text-muted) !important; font-family: var(--font-head) !important; font-size: 12.5px !important; padding: 6px 8px !important; height: 32px; }
.topnav-user .user-avatar, .sidebar-footer .user-avatar { background: var(--accent-pale) !important; color: var(--accent) !important; font-family: var(--font-head) !important; font-weight: 600 !important; box-shadow: none !important; }
.topnav-crumbs { border-top: 0 !important; background: transparent !important; }
.topnav-crumbs .crumb, .topnav-crumbs .crumb-sep, .topnav-crumbs .crumb-current { font-family: var(--font-head) !important; font-size: 12.5px !important; letter-spacing: 0 !important; text-transform: none !important; }
.topnav-crumbs .crumb { color: var(--text-dim) !important; }
.topnav-crumbs .crumb-current { color: var(--text) !important; font-weight: 500 !important; }

/* ---------- 5. Page canvas and headers ---------- */
.content { max-width: 1280px !important; }

/* Kickers above titles are removed; the title carries its own weight */
#page-slot .page-hero > .eyebrow,
#page-slot :is([class$="-eyebrow"],[class*="-eyebrow "]):not([class*="hm-"]) { display: none !important; }

/* One title style for every page */
#page-slot .page-title,
#page-slot :is([class$="-h1"],[class*="-h1 "]),
#page-slot .page-header h1,
#page-slot .page-hero h1 {
  font-family: var(--font-head) !important; font-size: 26px !important; line-height: 1.2 !important;
  font-weight: 600 !important; letter-spacing: -0.022em !important; color: var(--text) !important;
  margin: 0 0 4px !important; text-wrap: balance;
}
#page-slot .page-sub,
#page-slot :is(.fn-meta,.cr-meta,.ov-meta,.dm-meta,.hm-meta,.iv-meta,.in-meta,.pd-meta,.ct-meta),
#page-slot .page-header .page-sub {
  font-family: var(--font-head) !important; font-size: 14px !important; line-height: 1.5 !important;
  color: var(--text-muted) !important; letter-spacing: 0 !important; text-transform: none !important;
  max-width: 68ch; margin-top: 0 !important;
}
#page-slot .page-hero { padding: 4px 0 0 !important; margin-bottom: 24px !important; background: none !important; border: 0 !important; box-shadow: none !important; }
#page-slot .page-hero .hero-actions { margin-top: 16px !important; }
#page-slot :is(.fn-head,.cr-head,.ov-head,.hm-head,.iv-head,.in-head,.pd-head) { margin-bottom: 24px !important; align-items: flex-start !important; }
#page-slot .page-header { margin-bottom: 24px !important; padding: 4px 0 0 !important; text-align: left !important; }
#page-slot .page-wrap { padding: 0 !important; max-width: none !important; }

/* ---------- 6. Labels: quiet sentence case, never mono ---------- */
#page-slot .section-label,
#page-slot .stat-label,
#page-slot :is([class$="-kl"],[class*="-kl "]),
#page-slot :is([class$="-label"],[class*="-label "]),
#page-slot :is([class$="-sec"],[class*="-sec "]),
#page-slot :is([class$="-sect"],[class*="-sect "]),
#page-slot :is([class$="-stage-h"],[class*="-stage-h "]),
#page-slot :is([class$="-th"],[class*="-th "]),
#page-slot .card-meta,
#page-slot th,
#page-slot .kanban-col-title,
#page-slot :is([class$="-col-title"],[class*="-col-title "]) {
  font-family: var(--font-head) !important; text-transform: none !important; letter-spacing: 0 !important;
}
#page-slot .section-label,
#page-slot :is([class$="-sec"],[class*="-sec "]),
#page-slot :is([class$="-sect"],[class*="-sect "]),
#page-slot :is([class$="-stage-h"],[class*="-stage-h "]) {
  font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important;
}
#page-slot .stat-label, #page-slot :is([class$="-kl"],[class*="-kl "]) { font-size: 13px !important; font-weight: 500 !important; color: var(--text-muted) !important; }
#page-slot th, #page-slot :is([class$="-th"],[class*="-th "]) { font-size: 12.5px !important; font-weight: 500 !important; color: var(--text-muted) !important; }

/* Catch-all: uppercase tracking costumes inside pages become sentence case */
#page-slot [style*="uppercase"] { text-transform: none !important; letter-spacing: 0 !important; }

/* ---------- 7. Surfaces: flat cards, no nesting shadows ---------- */
#page-slot .card,
#page-slot :is([class$="-card"],[class*="-card "]),
#page-slot :is([class$="-box"],[class*="-box "]),
#page-slot :is([class$="-panel"],[class*="-panel "]),
#page-slot :is([class$="-kpi"],[class*="-kpi "]),
#page-slot .stat, #page-slot .stat-cell,
#page-slot :is([class$="-tile"],[class*="-tile "]) {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important; box-shadow: none !important;
}
#page-slot .card .card, #page-slot :is([class$="-card"],[class*="-card "]) :is([class$="-card"],[class*="-card "]),
#page-slot .card :is([class$="-box"],[class*="-box "]), #page-slot :is([class$="-panel"],[class*="-panel "]) :is([class$="-card"],[class*="-card "]) {
  background: var(--surface-2) !important;
}
#page-slot .card-header { border-bottom: 1px solid var(--border) !important; background: transparent !important; }
#page-slot .card-title, #page-slot :is([class$="-card-title"],[class*="-card-title "]) { font-family: var(--font-head) !important; font-size: 14.5px !important; font-weight: 600 !important; letter-spacing: -0.01em !important; text-transform: none !important; color: var(--text) !important; }

/* Thick coloured edges become a hairline */
#page-slot [style*="border-left: 3px"], #page-slot [style*="border-left:3px"],
#page-slot [style*="border-left: 4px"], #page-slot [style*="border-left:4px"],
#page-slot [style*="border-left: 2px"], #page-slot [style*="border-left:2px"] { border-left-width: 1px !important; }

/* KPI figures */
#page-slot .stat-value, #page-slot .stat-num, #page-slot :is([class$="-kv"],[class*="-kv "]) {
  font-family: var(--font-head) !important; font-size: 26px !important; font-weight: 600 !important;
  letter-spacing: -0.025em !important; line-height: 1.15 !important;
}
#page-slot .stat-sub, #page-slot :is([class$="-ks"],[class*="-ks "]) { font-size: 12.5px !important; color: var(--text-dim) !important; font-family: var(--font-head) !important; letter-spacing: 0 !important; text-transform: none !important; }

/* ---------- 8. Controls ---------- */
#page-slot .btn, #page-slot :is([class$="-btn"],[class*="-btn "]), #login button.primary {
  font-family: var(--font-head) !important; font-weight: 550 !important; letter-spacing: -0.005em !important;
  text-transform: none !important; border-radius: var(--r-md) !important; box-shadow: none !important;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast) !important;
}
#page-slot .btn-primary, #page-slot :is([class$="-btn"],[class*="-btn "]).primary, #page-slot .btn.primary, #login button.primary {
  background: var(--accent) !important; color: var(--on-accent) !important; border: 1px solid transparent !important;
}
#page-slot .btn-primary:hover, #page-slot :is([class$="-btn"],[class*="-btn "]).primary:hover, #page-slot .btn.primary:hover { background: var(--accent-hover) !important; }
#page-slot .btn-ghost, #page-slot .btn:not(.btn-primary):not(.primary):not(.btn-gold):not(.danger),
#page-slot :is([class$="-btn"],[class*="-btn "]):not(.primary):not(.on):not(.active):not(.danger):not(.tab-btn):not([class*="-tab"]) {
  background: var(--surface) !important; border: 1px solid var(--border-strong) !important; color: var(--text) !important;
}
#page-slot .btn-ghost:hover, #page-slot .btn:not(.btn-primary):not(.primary):not(.btn-gold):not(.danger):hover,
#page-slot :is([class$="-btn"],[class*="-btn "]):not(.primary):not(.on):not(.active):not(.danger):not(.tab-btn):not([class*="-tab"]):hover { background: var(--surface-2) !important; }
#page-slot .btn-gold { background: var(--accent) !important; color: var(--on-accent) !important; border-color: transparent !important; }

/* Form fields: every input matches, including unstyled ones */
:where(#page-slot, .modal, .quick-search) :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea) {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; font-family: var(--font-head); font-size: 14px; padding: 7px 10px; min-height: 34px;
}
#page-slot input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
#page-slot select, #page-slot textarea {
  font-family: var(--font-head) !important; background-color: var(--surface) !important; color: var(--text) !important;
  border-color: var(--border-strong) !important; box-shadow: none !important;
}
#page-slot input::placeholder, #page-slot textarea::placeholder { color: var(--text-dim) !important; opacity: 1; }
#page-slot input:focus, #page-slot select:focus, #page-slot textarea:focus {
  outline: none !important; border-color: var(--accent) !important; box-shadow: var(--focus-ring) !important;
}
#page-slot input[type=checkbox], #page-slot input[type=radio] { accent-color: var(--accent); }

/* Tabs, segmented controls and chips: one vocabulary */
#page-slot :is([class$="-tabs"],[class*="-tabs "]):not(.bottom-tabs), #page-slot .tab-bar {
  border: 0 !important; border-bottom: 1px solid var(--border) !important; background: transparent !important; border-radius: 0 !important;
  padding: 0 !important; gap: 4px !important; box-shadow: none !important;
}
#page-slot .tab-btn, #page-slot :is([class$="-tab"],[class*="-tab "]), #page-slot .subtab {
  font-family: var(--font-head) !important; font-size: 13.5px !important; font-weight: 500 !important;
  text-transform: none !important; letter-spacing: 0 !important; color: var(--text-muted) !important;
  background: transparent !important; border: 0 !important; border-radius: 0 !important;
  box-shadow: inset 0 -2px 0 transparent !important; padding: 10px 10px !important; margin-bottom: -1px;
}
#page-slot .tab-btn:hover, #page-slot :is([class$="-tab"],[class*="-tab "]):hover, #page-slot .subtab:hover { color: var(--text) !important; }
#page-slot .tab-btn.active, #page-slot :is([class$="-tab"],[class*="-tab "]):is(.on,.active), #page-slot .subtab:is(.on,.active) {
  color: var(--text) !important; box-shadow: inset 0 -2px 0 var(--accent) !important;
}
#page-slot :is([class$="-chip"],[class*="-chip "]), #page-slot .filter-chip, #page-slot .seg-btn, #page-slot :is([class$="-seg"],[class*="-seg "]) > button {
  font-family: var(--font-head) !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important;
}

/* Pills and badges: quiet, sentence case */
#page-slot .pill, #page-slot .badge, #page-slot :is([class$="-pill"],[class*="-pill "]), #page-slot [class*="badge-"] {
  font-family: var(--font-head) !important; text-transform: capitalize !important; letter-spacing: 0 !important;
  font-weight: 500 !important; border-radius: 6px !important; font-size: 11.5px !important;
}

/* Tables */
#page-slot table { border-collapse: separate; border-spacing: 0; }
#page-slot th { background: transparent !important; border-bottom: 1px solid var(--border) !important; }
#page-slot td { border-bottom: 1px solid var(--border) !important; }
#page-slot tbody tr:hover td { background: var(--hover-overlay); }
#page-slot tbody tr:last-child td { border-bottom: 0 !important; }

/* Domain landings: tiles without the noise */
#page-slot .dm-tiles [class*="live"], #page-slot .dm-tiles [class*="status"] { display: none !important; }

/* Empty and loading */
#page-slot .empty, #page-slot .empty-state, #page-slot :is([class$="-empty"],[class*="-empty "]) { color: var(--text-muted) !important; font-family: var(--font-head) !important; }

/* ---------- 9. Overlays ---------- */
.modal, .quick-search-panel, #user-menu { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--r-xl) !important; box-shadow: var(--shadow-xl) !important; }
.modal-title { font-family: var(--font-head) !important; font-weight: 600 !important; letter-spacing: -0.015em !important; }
.toast { font-family: var(--font-head) !important; border-radius: 10px !important; }

/* ---------- 10. Sign-in ---------- */
#login .brand-pane { background: var(--sidebar-bg) !important; }
#login .eyebrow, #login .form-eyebrow { display: none !important; }
#login h1, #login h2, #login .pane-logo { font-family: var(--font-head) !important; letter-spacing: -0.02em !important; }
#login .pane-logo { letter-spacing: .06em !important; }
#login .pane-sub { text-transform: none !important; letter-spacing: 0 !important; font-family: var(--font-head) !important; }

/* ---------- 11. Mobile bottom tabs ---------- */
.bottom-tabs { background: color-mix(in srgb, var(--bg) 92%, transparent) !important; backdrop-filter: blur(12px); border-top: 1px solid var(--border) !important; }
.bottom-tab { font-family: var(--font-head) !important; letter-spacing: 0 !important; text-transform: none !important; }
.bottom-tab svg { stroke-width: 1.75 !important; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   12. Launchpad navigation (lib/refine.js)
   ===================================================================== */
:root { --tone-teal: #17706F; --tone-teal-bg: #E3F0EF; --tone-gold: #8A6D24; --tone-gold-bg: #F5EEDA; --tone-coral: #A9523F; --tone-coral-bg: #F7E5DF; }
html[data-theme="dark"] { --tone-teal: #5FC0BA; --tone-teal-bg: rgba(79,179,174,.13); --tone-gold: #D9BE6E; --tone-gold-bg: rgba(212,184,101,.12); --tone-coral: #E5998A; --tone-coral-bg: rgba(229,153,138,.12); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]):not([data-theme="dark"]) { --tone-teal: #5FC0BA; --tone-teal-bg: rgba(79,179,174,.13); --tone-gold: #D9BE6E; --tone-gold-bg: rgba(212,184,101,.12); --tone-coral: #E5998A; --tone-coral-bg: rgba(229,153,138,.12); } }

/* Rail retired on every width: it becomes the "All pages" drawer */
html.rf-launchpad aside.sidebar { transform: translateX(-100%) !important; width: 288px !important; transition: transform .22s cubic-bezier(.22,1,.36,1) !important; z-index: var(--z-drawer) !important; }
html.rf-launchpad aside.sidebar.open { transform: translateX(0) !important; box-shadow: var(--shadow-xl) !important; }
html.rf-launchpad .sidebar-overlay { background: rgba(5,10,10,.45) !important; }
html.rf-launchpad .sidebar-overlay.open { opacity: 1 !important; pointer-events: auto !important; }
html.rf-launchpad .app-body { margin-left: 0 !important; }
html.rf-launchpad .topnav-logo { display: flex !important; align-items: center; gap: 8px; text-decoration: none; color: var(--text) !important; }
html.rf-launchpad .topnav-wordmark { font-size: 16px !important; color: var(--text) !important; }
html.rf-launchpad .topnav-crumbs { display: none !important; }
.topnav-inner { max-width: 1280px !important; margin: 0 auto !important; padding: 0 var(--content-pad, 32px) !important; }
#page-slot .theme-toggle { display: none !important; }

/* Area bar */
.rf-areabar { border-top: 1px solid var(--border); }
.rf-areabar:empty { display: none; }
.rf-areabar-inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--content-pad, 32px); display: flex; align-items: center; gap: 14px; height: 46px; }
.rf-home { margin-left: -6px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-muted); text-decoration: none; padding: 5px 8px 5px 4px; border-radius: 6px; flex: none; }
.rf-home:hover { color: var(--text); background: var(--hover-overlay); }
.rf-back { width: 15px; height: 15px; transform: rotate(180deg); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rf-area-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); flex: none; padding-left: 14px; border-left: 1px solid var(--border); white-space: nowrap; }
.rf-area-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--tone-teal); }
.rf-area-dot.rf-tone-gold { background: var(--tone-gold); } .rf-area-dot.rf-tone-coral { background: var(--tone-coral); }
.rf-tabs { display: flex; align-items: stretch; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; margin-left: 6px; }
.rf-tabs::-webkit-scrollbar { display: none; }
.rf-tab { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; transition: color var(--t-fast), box-shadow var(--t-fast); }
.rf-tab:hover { color: var(--text); }
.rf-tab.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.rf-ext { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .55; flex: none; }

/* Home order: greeting, launchpad, today's numbers, planner */
html.rf-on-home #page-slot { display: flex; flex-direction: column; }
html.rf-on-home #page-slot > .hm-head { order: 0; }
html.rf-on-home #page-slot > .hm-error { order: 1; }
html.rf-on-home #page-slot > #rf-launch { order: 2; }
html.rf-on-home #page-slot > #hm-business, html.rf-on-home #page-slot > #hm-personal { order: 3; }
html.rf-on-home #page-slot > #hm-planner { order: 4; margin-top: 8px; }
html.rf-on-home #page-slot .hm-tiles, html.rf-on-home #page-slot .hm-sect { display: none !important; }
html.rf-on-home #page-slot .hm-head > div { display: flex; flex-direction: column; }
html.rf-on-home #page-slot .hm-eyebrow { order: 3; display: flex !important; margin-top: 2px; font-family: var(--font-head) !important; font-size: 13px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-dim) !important; }
html.rf-on-home #page-slot .hm-eyebrow .hm-dot { display: none !important; }
html.rf-on-home #page-slot .hm-h1 { font-size: 30px !important; }

/* Launchpad tiles */
.rf-launch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 4px 0 32px; }
.rf-area { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-base); }
.rf-area:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.rf-area.rf-wide { grid-column: span 2; }
.rf-area-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 18px 14px; text-decoration: none; color: inherit; }
.rf-area-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--tone-teal-bg); color: var(--tone-teal); }
.rf-tone-gold .rf-area-icon { background: var(--tone-gold-bg); color: var(--tone-gold); }
.rf-tone-coral .rf-area-icon { background: var(--tone-coral-bg); color: var(--tone-coral); }
.rf-area-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rf-area-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rf-area-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em; color: var(--text); }
.rf-area-desc { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.rf-go { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--text-dim); margin-top: 9px; opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast), transform var(--t-base); flex: none; }
.rf-area-head:hover .rf-go, .rf-area-head:focus-visible .rf-go { opacity: 1; transform: none; color: var(--text); }
.rf-area-links { list-style: none; margin: 0; padding: 6px 8px 10px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr; gap: 1px; flex: 1; align-content: start; }
.rf-wide .rf-area-links { grid-template-columns: 1fr 1fr; column-gap: 8px; }
.rf-area-links a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 450; color: var(--text); text-decoration: none; transition: background var(--t-fast); }
.rf-area-links a:hover { background: var(--hover-overlay); }
.rf-li-icon { width: 15px; height: 15px; display: inline-grid; place-items: center; color: var(--text-dim); flex: none; }
.rf-li-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rf-area-links a:hover .rf-li-icon { color: var(--text-muted); }
.rf-li-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .rf-launch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .rf-launch { grid-template-columns: 1fr; gap: 12px; }
  .rf-area.rf-wide { grid-column: auto; }
  .rf-wide .rf-area-links { grid-template-columns: 1fr; }
  .rf-areabar-inner { padding: 0 12px; gap: 10px; }
  .rf-area-name { display: none; }
}

/* Computed micro-labels (lib/refine.js quietLabels) */
#page-slot .rf-ql { letter-spacing: 0 !important; font-family: var(--font-head) !important; }
#page-slot .rf-ql-none { text-transform: none !important; }
#page-slot .rf-ql-cap { text-transform: capitalize !important; }

/* Member admin: one surface, not an app inside a card */
#page-slot .ma { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#page-slot .ma-side { background: transparent !important; border: 0 !important; box-shadow: none !important; padding-left: 0 !important; }
#page-slot .ma-side .side-brand, #page-slot .ma-side .side-sub { display: none !important; }
#page-slot .ma-side .cp-item { border-radius: 7px !important; font-family: var(--font-head) !important; font-size: 13.5px !important; }
#page-slot .ma-side .cp-item.active { background: var(--active-overlay) !important; color: var(--text) !important; box-shadow: none !important; border: 0 !important; }
#page-slot .ma-side .cp-item.active::before { display: none !important; }

/* Any small label sitting directly above a page title is a kicker: removed */
#page-slot :is(div, span, p, small):not(:has(a, button, input, select, svg, img)):has(+ :is(h1, .page-title, [class$="-h1"], [class*="-h1 "])) { display: none !important; }

/* Page-level wrappers with their own width and padding align to the shared grid */
#page-slot > :is([class$="-wrap"], [class*="-wrap "]),
#page-slot > .page > :is([class$="-wrap"], [class*="-wrap "]) { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; padding-top: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }

/* Member admin: in-page menu sits at the top, not floating mid-height */
#page-slot .ma { align-items: start !important; }
#page-slot .ma-side { align-self: start !important; position: sticky; top: 132px; }

/* Settings link in the user menu */
#user-menu .rf-menu-link { display: block; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); text-decoration: none; }
#user-menu .rf-menu-link:hover { background: var(--hover-overlay); }

/* =====================================================================
   13. Brand and top bar (Nov 2026, round 2)
   ===================================================================== */
.rf-mark { width: 28px; height: 28px; flex: none; display: block; border-radius: 7px; }
.topnav-logo { gap: 10px !important; }
.topnav-logo .topnav-wordmark { font-size: 15px !important; letter-spacing: .14em !important; font-weight: 650 !important; }
.sidebar .brand { display: grid !important; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.sidebar .brand .rf-mark { grid-row: span 2; width: 30px; }
.sidebar .brand-title { letter-spacing: .14em !important; font-size: 15px !important; }
#login .rf-mark-lg { width: 56px; height: 56px; border-radius: 13px; margin-bottom: 18px; }
#login .pane-logo { letter-spacing: .16em !important; }

/* Top bar holds only what is used constantly: brand, search, alerts, you */
.topnav-role { display: none !important; }
.topnav-tools > #topnav-theme, .topnav-tools > #topnav-print, .topnav-tools > #topnav-help { display: none !important; }
.topnav-search { min-width: 300px !important; height: 36px !important; justify-content: flex-start !important; gap: 8px !important; padding: 0 10px 0 12px !important; }
.topnav-search-kbd { margin-left: auto !important; }
.topnav-user .user-avatar { width: 32px !important; height: 32px !important; font-size: 13px !important; }
.topnav-tools { gap: 6px !important; }
@media (max-width: 900px) { .topnav-search { min-width: 0 !important; } }

/* Avatar menu */
#user-menu.rf-user-menu { min-width: 260px !important; padding: 6px !important; top: 58px !important; }
#user-menu-email { font-size: 12.5px !important; color: var(--text-dim) !important; padding: 10px 10px 8px !important; }
.rf-menu-viewas { display: block; padding: 4px 10px 10px; }
.rf-menu-viewas > span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
#user-menu #viewas-select { width: 100% !important; max-width: none !important; height: 34px !important; font-size: 13px !important; }
.rf-menu-group { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 2px; }
#user-menu .rf-menu-row { display: flex !important; align-items: center; gap: 10px; width: 100%; height: auto !important; padding: 8px 10px !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--text) !important; font-family: var(--font-head) !important; font-size: 13.5px !important; font-weight: 450 !important; text-align: left; text-decoration: none; cursor: pointer; }
#user-menu .rf-menu-row:hover { background: var(--hover-overlay) !important; }
.rf-menu-ic { width: 16px; height: 16px; display: inline-grid; place-items: center; color: var(--text-dim); flex: none; }
.rf-menu-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rf-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
#user-menu-signout { font-family: var(--font-head) !important; font-weight: 500 !important; font-size: 13.5px !important; }

/* Home: a quiet brand moment behind the greeting */
html.rf-on-home .content { position: relative; isolation: isolate; }
html.rf-on-home .content::before { content: ""; position: absolute; inset: -40px 0 auto 0; height: 320px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 100% at 18% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }

/* =====================================================================
   14. In step with vyvehealth.co.uk (Nov 2026, round 3)
   The website's world: deep teal, teal #4DAAAA, button teal #1B7878,
   gold #C9A84C, cream for light, Playfair Display headings over Inter.
   On a working screen the world lends type, palette and one signature
   move only; controls stay standard.
   ===================================================================== */
:root {
  --font-head: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-head);
  --font-mono: var(--font-head);
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --bg: #F4F1EA; --bg-alt: #F8F6F0; --surface: #FFFFFF;
  --surface-2: #F3EFE6; --surface-3: #EAE4D8; --surface-sunken: #EFEBE2; --surface-raised: #FFFFFF;
  --border: #E5DFD3; --border-strong: #D1C9BA;
  --text: #0D2B2B; --text-muted: #4B6361; --text-dim: #627876;
  --accent: #1B7878; --accent-hover: #146262; --accent-pale: #DDEDEB; --accent-light: #2B8C8B; --on-accent: #FFFFFF;
  --btn-primary: #1B7878; --btn-primary-hover: #146262;
  --gold: #8C6E22; --gold-pale: #F4ECD6;
  --hover-overlay: rgba(13,43,43,.045); --active-overlay: rgba(13,43,43,.08);
  --focus-ring: 0 0 0 3px rgba(27,120,120,.22);
  --sidebar-bg: #F8F6F0; --sidebar-text: #435B59; --sidebar-active: #ECE7DC; --sidebar-active-fg: #0D2B2B;
  --sidebar-hover: rgba(13,43,43,.045); --sidebar-section: #6E8280; --sidebar-border: #E5DFD3;
  --tone-teal: #1B7878; --tone-teal-bg: #DDEDEB;
  --tone-gold: #8C6E22; --tone-gold-bg: #F4ECD6;
  --tone-coral: #2F7E99; --tone-coral-bg: #DDEBF1;
  --hero-glow-a: rgba(27,120,120,.10); --hero-glow-b: rgba(201,168,76,.08);
}
html[data-theme="dark"] {
  --bg: #0A2222; --bg-alt: #0C2626; --surface: #0F2B2B;
  --surface-2: #133131; --surface-3: #183A3A; --surface-sunken: #082020; --surface-raised: #133131;
  --border: rgba(190,230,226,.09); --border-strong: rgba(190,230,226,.16);
  --text: #EEF3F1; --text-muted: #A7C1BE; --text-dim: #809C99;
  --accent: #4DAAAA; --accent-hover: #6CC0BF; --accent-pale: rgba(77,170,170,.14); --accent-light: #6CC0BF; --on-accent: #FFFFFF;
  --btn-primary: #1B7878; --btn-primary-hover: #218989;
  --gold: #C9A84C; --gold-pale: rgba(201,168,76,.13);
  --hover-overlay: rgba(238,243,241,.05); --active-overlay: rgba(238,243,241,.09);
  --focus-ring: 0 0 0 3px rgba(77,170,170,.32);
  --sidebar-bg: #082020; --sidebar-text: #A7C1BE; --sidebar-active: rgba(238,243,241,.08); --sidebar-active-fg: #F4F8F6;
  --sidebar-hover: rgba(238,243,241,.05); --sidebar-section: #7A9693; --sidebar-border: rgba(190,230,226,.07);
  --tone-teal: #6CC0BF; --tone-teal-bg: rgba(77,170,170,.15);
  --tone-gold: #D9BC66; --tone-gold-bg: rgba(201,168,76,.14);
  --tone-coral: #6FB4CE; --tone-coral-bg: rgba(74,158,186,.15);
  --success: #5EC4B0; --warning: #E8A855; --danger: #E87070; --info: #6FB4CE;
  --hero-glow-a: rgba(77,170,170,.16); --hero-glow-b: rgba(201,168,76,.07);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0A2222; --bg-alt: #0C2626; --surface: #0F2B2B;
    --surface-2: #133131; --surface-3: #183A3A; --surface-sunken: #082020; --surface-raised: #133131;
    --border: rgba(190,230,226,.09); --border-strong: rgba(190,230,226,.16);
    --text: #EEF3F1; --text-muted: #A7C1BE; --text-dim: #809C99;
    --accent: #4DAAAA; --accent-hover: #6CC0BF; --accent-pale: rgba(77,170,170,.14); --accent-light: #6CC0BF; --on-accent: #FFFFFF;
    --btn-primary: #1B7878; --btn-primary-hover: #218989;
    --gold: #C9A84C; --gold-pale: rgba(201,168,76,.13);
    --hover-overlay: rgba(238,243,241,.05); --active-overlay: rgba(238,243,241,.09);
    --focus-ring: 0 0 0 3px rgba(77,170,170,.32);
    --sidebar-bg: #082020; --sidebar-text: #A7C1BE; --sidebar-active: rgba(238,243,241,.08); --sidebar-active-fg: #F4F8F6;
    --sidebar-hover: rgba(238,243,241,.05); --sidebar-section: #7A9693; --sidebar-border: rgba(190,230,226,.07);
    --tone-teal: #6CC0BF; --tone-teal-bg: rgba(77,170,170,.15);
    --tone-gold: #D9BC66; --tone-gold-bg: rgba(201,168,76,.14);
    --tone-coral: #6FB4CE; --tone-coral-bg: rgba(74,158,186,.15);
    --success: #5EC4B0; --warning: #E8A855; --danger: #E87070; --info: #6FB4CE;
    --hero-glow-a: rgba(77,170,170,.16); --hero-glow-b: rgba(201,168,76,.07);
  }
}

/* Headings speak in the website's voice; everything you read or click stays Inter */
#page-slot .page-title,
#page-slot :is([class$="-h1"],[class*="-h1 "]),
#page-slot .page-header h1,
#page-slot .page-hero h1 {
  font-family: var(--font-display) !important; font-weight: 600 !important; font-size: 30px !important;
  letter-spacing: -0.01em !important; line-height: 1.15 !important;
}
html.rf-on-home #page-slot .hm-h1 { font-size: 38px !important; letter-spacing: -0.015em !important; }
.rf-area-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
.modal-title { font-family: var(--font-display) !important; font-weight: 600 !important; letter-spacing: 0 !important; }
#login h1, #login h2 { font-family: var(--font-display) !important; letter-spacing: -0.01em !important; }

/* Wordmark as on the website: spaced capitals */
.topnav-logo .topnav-wordmark, .sidebar .brand-title, #login .pane-logo {
  font-family: var(--font-display) !important; font-weight: 700 !important; letter-spacing: .3em !important;
}
.topnav-logo .topnav-wordmark { font-size: 16px !important; }

/* Primary actions use the website's button teal */
#page-slot .btn-primary, #page-slot :is([class$="-btn"],[class*="-btn "]).primary, #page-slot .btn.primary, #page-slot .btn-gold, #login button.primary {
  background: var(--btn-primary) !important; color: #FFFFFF !important;
}
#page-slot .btn-primary:hover, #page-slot :is([class$="-btn"],[class*="-btn "]).primary:hover, #page-slot .btn.primary:hover, #page-slot .btn-gold:hover, #login button.primary:hover {
  background: var(--btn-primary-hover) !important;
}

/* Signature move: the website's hero light, behind the Home greeting only */
html.rf-on-home .content::before { display: none !important; }
html.rf-on-home .main {
  background-image:
    radial-gradient(900px 420px at 22% -60px, var(--hero-glow-a), transparent 70%),
    radial-gradient(700px 360px at 85% -40px, var(--hero-glow-b), transparent 70%) !important;
  background-repeat: no-repeat !important;
}
/* Gold hairline under the greeting, as the website rules its headings */
html.rf-on-home #page-slot .hm-head > div::after { content: ""; order: 4; display: block; width: 44px; height: 2px; margin-top: 16px; background: var(--gold); border-radius: 2px; }

/* Logo sits on one line; menu rows read left to right */
.topnav-logo { flex-direction: row !important; align-items: center !important; }
#user-menu .rf-menu-row { justify-content: flex-start !important; width: 100% !important; min-width: 0 !important; }


/* =====================================================================
   15. Symmetry and real buttons (Nov 2026, round 4)
   ===================================================================== */
/* Home: Workspace across the top, then a 3 x 2 grid of identical tiles */
.rf-launch { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 16px !important; margin: 0 0 28px !important; }
.rf-area.rf-wide { grid-column: 1 / -1 !important; }
.rf-area { border-radius: 16px !important; }
.rf-area-head { padding: 18px 20px 16px !important; align-items: center !important; }
.rf-area-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * 1.45em); }
.rf-wide .rf-area-desc { min-height: 0; -webkit-line-clamp: 1; }
.rf-go { margin-top: 0 !important; }

/* Page links are buttons */
.rf-area-links { padding: 14px 16px 18px !important; gap: 8px !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; grid-template-rows: repeat(3, 40px); align-content: start; }
.rf-wide .rf-area-links { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; grid-template-rows: none; grid-auto-rows: 40px; column-gap: 8px !important; }
.rf-area-links li { min-width: 0; }
.rf-area-links a {
  height: 40px; padding: 0 12px !important; gap: 9px !important; border-radius: 10px !important;
  background: var(--surface-2) !important; border: 1px solid var(--border) !important;
  font-size: 13.5px !important; font-weight: 500 !important; color: var(--text) !important;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) !important;
}
.rf-area-links a:hover {
  background: var(--accent-pale) !important; border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
}
.rf-area-links a:hover .rf-li-icon { color: var(--accent) !important; }
.rf-area-links a:active { transform: translateY(1px); }
.rf-area-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rf-area-links a.rf-more { background: transparent !important; border-style: dashed !important; color: var(--text-muted) !important; justify-content: space-between; }
.rf-area-links a.rf-more:hover { color: var(--text) !important; }
.rf-more-go { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rf-li-icon { color: var(--text-dim) !important; }

@media (max-width: 1100px) {
  .rf-launch { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .rf-wide .rf-area-links { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .rf-launch { grid-template-columns: 1fr !important; }
  .rf-wide .rf-area-links { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Home rhythm: one consistent gap between blocks */
html.rf-on-home #page-slot .hm-head { margin-bottom: 24px !important; }
html.rf-on-home #page-slot > #hm-business > *, html.rf-on-home #page-slot > #hm-personal > * { margin-top: 0 !important; }
html.rf-on-home #page-slot > #hm-business, html.rf-on-home #page-slot > #hm-personal { display: grid; gap: 16px; margin-bottom: 28px; }

/* KPI rows everywhere: balanced columns, never a lonely last tile */
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) {
  display: grid !important; gap: 12px !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(2):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(3):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(5):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(6):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(7):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(9):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(10):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell):nth-child(12):last-child):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
#page-slot :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell) { min-width: 0 !important; width: auto !important; margin: 0 !important; padding: 16px 18px !important; }
@media (max-width: 900px) {
  #page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)):not(:has(> :not(:is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)))) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* No holes: an odd last button spans the row; three or fewer pages stack full width */
.rf-area:not(.rf-wide) .rf-area-links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rf-area:not(.rf-wide) .rf-area-links:not(:has(li:nth-child(4))) { grid-template-columns: 1fr !important; }


/* =====================================================================
   16. Type back to principle (Nov 2026, round 5)
   One well-tuned sans for the whole product: headings, labels, buttons
   and data. No display face in the UI. Fixed scale, ratio about 1.2:
   12.5 / 13.5 / 16 / 26 / 30. The website's colours stay.
   ===================================================================== */
:root, html[data-theme] {
  --font-head: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-head);
  --font-mono: var(--font-head);
  --font-display: var(--font-head);
}
#page-slot .page-title,
#page-slot :is([class$="-h1"],[class*="-h1 "]),
#page-slot .page-header h1,
#page-slot .page-hero h1 {
  font-family: var(--font-head) !important; font-weight: 600 !important; font-size: 26px !important;
  letter-spacing: -0.022em !important; line-height: 1.2 !important;
}
html.rf-on-home #page-slot .hm-h1 { font-size: 30px !important; letter-spacing: -0.025em !important; }
.rf-area-title { font-family: var(--font-head) !important; font-size: 16px !important; font-weight: 600 !important; letter-spacing: -0.012em !important; }
.modal-title, #login h1, #login h2 { font-family: var(--font-head) !important; letter-spacing: -0.02em !important; }
.topnav-logo .topnav-wordmark, .sidebar .brand-title, #login .pane-logo {
  font-family: var(--font-head) !important; font-weight: 700 !important; letter-spacing: .18em !important;
}
.topnav-logo .topnav-wordmark { font-size: 15px !important; }


/* =====================================================================
   17. Calmer controls and fuller rows (Nov 2026, round 6)
   ===================================================================== */
/* Segmented filters: one quiet track, the chosen option lifts out of it */
#page-slot :is([class$="-seg"],[class*="-seg "]) {
  display: inline-flex !important; align-items: center; gap: 2px !important; padding: 3px !important;
  background: var(--surface-2) !important; border: 1px solid var(--border) !important;
  border-radius: 10px !important; overflow: visible !important; box-shadow: none !important;
}
#page-slot :is([class$="-seg"],[class*="-seg "]) > :is(button, a) {
  background: transparent !important; border: 0 !important; border-radius: 7px !important;
  padding: 6px 12px !important; min-height: 30px; font-family: var(--font-head) !important;
  font-size: 13px !important; font-weight: 500 !important; color: var(--text-muted) !important;
  text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important;
  transition: background var(--t-fast), color var(--t-fast) !important;
}
#page-slot :is([class$="-seg"],[class*="-seg "]) > :is(button, a):hover { color: var(--text) !important; background: var(--hover-overlay) !important; }
#page-slot :is([class$="-seg"],[class*="-seg "]) > :is(button, a):is(.on, .active, .sel, .selected, [aria-pressed="true"], [aria-selected="true"]) {
  background: var(--surface) !important; color: var(--text) !important;
  box-shadow: 0 0 0 1px var(--border-strong), 0 1px 2px rgba(0,0,0,.12) !important;
}
html[data-theme="dark"] #page-slot :is([class$="-seg"],[class*="-seg "]) > :is(button, a):is(.on, .active, .sel, .selected, [aria-pressed="true"], [aria-selected="true"]) { background: var(--surface-3) !important; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) #page-slot :is([class$="-seg"],[class*="-seg "]) > :is(button, a):is(.on, .active, .sel, .selected, [aria-pressed="true"], [aria-selected="true"]) { background: var(--surface-3) !important; } }

/* Filter rows sit side by side and wrap, instead of stacking one per line */
#page-slot .ov-cal-tools { display: inline-flex !important; flex-wrap: wrap; gap: 8px !important; margin: 0 8px 10px 0 !important; vertical-align: top; }

/* Empty states fill their whole row, never one lonely cell */
#page-slot :is([class$="-cards"],[class*="-cards "],[class$="-grid"],[class*="-grid "]) > :is([class$="-empty"],[class*="-empty "],.empty,.empty-state) { grid-column: 1 / -1 !important; }


/* =====================================================================
   18. Alignment pass (Nov 2026, round 7)
   ===================================================================== */
/* Partner Management: its own wrapper padding pushed content off the shared edge */
#page-slot .pt-content { padding: 0 0 48px !important; max-width: none !important; }
/* Member Admin: in-page menu starts level with the table */
#page-slot .ma-side { position: static !important; padding-top: 0 !important; }
#page-slot .ma-main { padding-top: 0 !important; }
/* KPI rows: no tile spans two columns, so every row is even */
#page-slot :is(div, section):has(> :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell)) > :is([class$="-kpi"],[class*="-kpi "],.stat,.stat-cell) { grid-column: auto !important; }
/* Area landing tiles: one height per row */
#page-slot .dm-tiles { grid-auto-rows: 1fr !important; }
/* Cards inside a grid never inherit the stacked-card top margin, so every cell starts level */
#page-slot :is(.grid, [class$="-grid"], [class*="-grid "], [class$="-cards"], [class*="-cards "]) > * { margin-top: 0 !important; }


/* =====================================================================
   19. Text stays inside its box (Nov 2026, round 8)
   Long unbroken strings (web addresses, file names, alert codes) wrap
   instead of running past the edge; calendar days share the width evenly.
   ===================================================================== */
#page-slot, #page-slot * { overflow-wrap: break-word; }
#page-slot :is(.card,[class$="-card"],[class*="-card "],[class$="-item"],[class*="-item "],[class$="-row"],[class*="-row "],[class$="-cell"],[class*="-cell "],li,td) { min-width: 0; }
#page-slot :is(.card,[class$="-card"],[class*="-card "]) :is(a,span,div,p,h3,h4,strong,b) { overflow-wrap: anywhere; }
#page-slot .cal-month-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
#page-slot .cal-month-grid > * { min-width: 0 !important; overflow: hidden; }
#page-slot .cal-day-events { min-width: 0; }
#page-slot .cal-event { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* =====================================================================
   20. Website match (Nov 2026, round 9)
   Same typeface and palette as vyvehealth.co.uk: Plus Jakarta Sans for
   everything (one family), website teal #1B7878, light teal #4DAAAA,
   dark #0D2B2B, gold #C9A84C, off-white #F4FAFA, border #D1E8E8.
   ===================================================================== */
:root, html[data-theme] {
  --font-head: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-head);
  --font-mono: var(--font-head);
  --font-display: var(--font-head);
}
:root {
  --bg: #F4FAFA; --bg-alt: #F8FCFC; --surface: #FFFFFF;
  --surface-2: #EEF7F7; --surface-3: #E0F2F2; --surface-sunken: #EAF4F4; --surface-raised: #FFFFFF;
  --border: #D1E8E8; --border-strong: #B2DEDE;
  --text: #1E293B; --text-muted: #4A6363; --text-dim: #64748B;
  --accent: #1B7878; --accent-hover: #156666; --accent-pale: #E0F2F2; --on-accent: #FFFFFF;
  --btn-primary: #1B7878; --btn-primary-hover: #156666;
  --gold: #8C6E22; --gold-pale: #F6EFD9;
  --hover-overlay: rgba(13,43,43,.045); --active-overlay: rgba(13,43,43,.08);
  --sidebar-bg: #F8FCFC; --sidebar-text: #4A6363; --sidebar-active: #E0F2F2; --sidebar-active-fg: #0D2B2B; --sidebar-border: #D1E8E8;
  --tone-teal: #1B7878; --tone-teal-bg: #E0F2F2;
  --hero-glow-a: rgba(27,120,120,.09); --hero-glow-b: rgba(201,168,76,.07);
}
#page-slot .page-title,
#page-slot :is([class$="-h1"],[class*="-h1 "]),
#page-slot .page-header h1,
#page-slot .page-hero h1 { font-weight: 700 !important; letter-spacing: -0.02em !important; line-height: 1.15 !important; }
html.rf-on-home #page-slot .hm-h1 { font-weight: 700 !important; }
.rf-area-title { font-weight: 700 !important; letter-spacing: -0.01em !important; }
.topnav-logo .topnav-wordmark, .sidebar .brand-title, #login .pane-logo { font-weight: 800 !important; letter-spacing: .16em !important; }

/* =====================================================================
   21. Brand pass (Nov 2026): one family everywhere, no side bars, status dots
   ===================================================================== */
/* One family: code names, shortcuts and stray Inter all use Plus Jakarta Sans */
.topnav-search-kbd, kbd, #page-slot :is(code, .mono, [class*="mono"], [style*="monospace"]), #page-slot [class*="-code"] {
  font-family: var(--font-head) !important; font-variant-numeric: tabular-nums;
}
#page-slot *:not(svg):not(svg *) { font-family: var(--font-head) !important; }
/* Calendar chips: category colour as a small dot, never a coloured side bar */
#page-slot .vp-chip { border-left-width: 0 !important; position: relative; padding-left: 18px !important; }
#page-slot .vp-chip::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--rf-chip, var(--accent)); }
#page-slot .vp-chip.more::before { display: none; }
#page-slot .vp-chip.more { padding-left: 8px !important; }
/* Status dots replace traffic-light emoji */
.rf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex: none; }
.rf-dot-ok { background: var(--success, #2E9A6A); }
.rf-dot-warn { background: var(--warning, #E8A855); }
.rf-dot-bad { background: var(--danger, #E05A5A); }
