/* ─────────────────────────────────────────────────────────────────────────
   roc.up — Meridian Design System
   Institutional. Ink navy anchors. Brass punctuates. Forest verifies.
   Steady ground for serious work — built for Australian NDIS providers.
   Every page in the app inherits these tokens.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces — pure white page + white cards; depth comes from shadow,
     not from a beige page tint. Soft-bone --surface-2 / --surface-3 are
     kept for hover wells, table heads and sunken state where a slight
     differentiation against white reads better than pure-white-on-white. */
  --bg:            #FFFFFF;   /* white — page background */
  --surface:       #FFFFFF;   /* white — cards & elevated surfaces */
  /* Was cream/bone (#F5F3ED / #EBE8E0). Swapped to neutral grays so
     hover wells, table heads, and sunken state still differentiate
     against the white canvas without any beige cast. */
  --surface-2:     #F4F5F8;   /* faint gray — hovers, wells, table heads */
  --surface-3:     #E8EAEF;   /* light gray — sunken wells, neutral tags */

  /* Ink / type */
  --ink:           #1D2230;   /* near-black slate — primary text + headings */
  --ink-2:         #525A6B;   /* secondary text */
  --ink-3:         #6F5CD6;   /* lavender — link colour, interactive ink */
  --muted:         #8A92A3;   /* captions, metadata */
  --muted-2:       #AAB2BF;   /* disabled / subtle */

  /* Borders — neutral grays, no warm cast */
  --border:        #E6E8EC;   /* default dividers */
  --border-2:      #D8DBE1;   /* stronger separation */
  --border-strong: #B7BCC5;   /* strongest neutral rule */

  /* Brand — Soft Modern: lavender carries interaction, ink anchors actions */
  --accent:        #6F5CD6;   /* lavender — primary interactive */
  --accent-hover:  #5B49D0;   /* deeper lavender */
  --accent-soft:   #EEEAFB;   /* lavender-100 — soft tint, active nav */
  --accent-ink:    #5546B8;   /* lavender text on soft */

  --cta:           #1D2230;   /* ink — primary action buttons (modern, calm) */
  --cta-hover:     #0E1119;   /* deeper ink */
  --cta-light:     #6F5CD6;   /* lavender — accent on dark */
  --cta-soft:      #EEEAFB;   /* lavender-100 */
  --cta-ink:       #5546B8;   /* lavender text on soft */

  /* Soft surface for nested cards (home blocks etc.) — was bone, now
     white so home-block containers blend with the page bg and the
     participant cards inside lift via shadow instead. */
  --cream-soft:    #FFFFFF;   /* white — middle-tier card surface */
  --cream-ink:     #5546B8;   /* lavender text on bone */

  /* Semantic — pastel families (mint / amber / soft-red / sky) */
  --success:       #2E9E78;   /* mint */
  --success-soft:  #E4F4EE;   /* mint-100 */
  --warning:       #B98420;   /* amber */
  --warning-soft:  #FBF1DF;   /* amber-100 */
  --danger:        #D14B3C;   /* soft red */
  --danger-soft:   #FBE7E5;   /* red-100 */

  /* Sidebar — Soft Modern: light panel, lavender active state */
  --sb-bg:         #FFFFFF;   /* white sidebar */
  --sb-bg-2:       #F4F5F8;   /* faint gray — avatar wells */
  --sb-ink:        #1D2230;   /* dark sidebar text */
  --sb-muted:      #8A92A3;   /* muted text */
  --sb-border:     #E6E8EC;   /* light divider */

  /* Radius — rounder, friendlier */
  --r-xs: 6px;
  --r-sm: 8px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 100px;

  /* Shadow — soft, low, diffuse. Stronger now that the page bg is
     white: cards need a visible drop to read as separate surfaces
     without a hairline border carrying the work. */
  --shadow-xs: 0 1px 2px rgba(29,34,48,.06);
  --shadow-sm: 0 1px 2px rgba(29,34,48,.06), 0 4px 10px -4px rgba(29,34,48,.10);
  --shadow:    0 2px 4px rgba(29,34,48,.06), 0 10px 24px -8px rgba(29,34,48,.16);
  --shadow-lg: 0 4px 8px rgba(29,34,48,.06), 0 22px 50px -18px rgba(29,34,48,.22);

  /* Type scale */
  --t-xs:  11px;
  --t-sm:  12px;
  --t-md:  13px;
  --t-base:14px;
  --t-lg:  15px;
  --t-xl:  18px;
  --t-2xl: 22px;
  --t-3xl: 28px;
  --t-4xl: 36px;
  --t-5xl: 48px;
  --t-6xl: 64px;
  --t-7xl: 80px;

  /* Spacing — used implicitly; multiples of 4 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Motion */
  --ease: cubic-bezier(.22,1,.36,1);
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--ink); color: var(--bg); }

/* ─── Display & headings — Plus Jakarta Sans ─── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

h1, h2, h3, h4, h5 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.1;
}
h1 { font-size: var(--t-5xl); letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: var(--t-3xl); letter-spacing: -0.02em; font-weight: 700; }
h3 { font-size: var(--t-xl); letter-spacing: -0.01em; font-weight: 600; }
h4 { font-size: var(--t-lg); font-weight: 600; }
p  { margin: 0; color: var(--ink-2); }

/* ─── Brand mark (legacy text wordmark, now orphaned — SVG logo is the primary asset) ─── */
.roc-mark {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-size: var(--t-xl);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  text-decoration: none;
}
.roc-mark::before {
  content: '';
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
  background-color: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Cpath d='M9 15 L15 9'/%3E%3Cpath d='M10 9 L15 9 L15 14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Cpath d='M9 15 L15 9'/%3E%3Cpath d='M10 9 L15 9 L15 14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.roc-mark .brand-tld {
  color: var(--cta);
  font-weight: 600;
}
.roc-mark.on-dark { color: #D4A55F; }
.roc-mark.on-dark .brand-tld { color: #B8853D; }
.roc-mark.on-dark::before { background-color: #D4A55F; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;   /* soft-modern pill buttons everywhere */
  font-family: inherit;
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), transform .08s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--cta);
  color: white;
  border-color: var(--cta);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }
.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white; }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-2);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--border-2);
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-lg { height: 44px; padding: 0 24px; font-size: var(--t-base); border-radius: 999px; }
.btn-sm { height: 28px; padding: 0 14px; font-size: var(--t-sm); border-radius: 999px; }
.btn-block { width: 100%; }

/* ─── Inputs ─── */
.input, input[type="text"].input, input[type="email"].input, input[type="password"].input,
input[type="number"].input, select.input, textarea.input {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border-2);
  border-radius: 11px;
  background: var(--surface);
  font-family: inherit;
  font-size: var(--t-base);
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--muted-2); }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.55; min-height: 80px; resize: vertical; }
.input-label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.input-hint { font-size: var(--t-xs); color: var(--muted); margin-top: 6px; }
.input-error { font-size: var(--t-xs); color: var(--danger); margin-top: 6px; }
.field { margin-bottom: 14px; }

/* ─── Cards ─── */
/* Borders removed — depth is carried by --shadow-sm alone now that
   the canvas is white. .card-flat keeps its border because it's the
   deliberately-flat variant (no shadow). */
.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card-hover {
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-flat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--space-6); }
.card-title { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.015em; margin-bottom: 4px; }
.card-sub { font-size: var(--t-md); color: var(--muted); }

/* ─── Badges / pills ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: -0.005em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge-accent  { background: var(--accent-soft);  color: var(--accent-ink); border-color: transparent; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── Eyebrow / overlines ─── */
.eyebrow {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-accent { color: var(--accent); }

/* ─── Section blocks ─── */
.section { padding: 96px 32px; }
.section-tight { padding: 56px 32px; }
.container { max-width: 1180px; margin: 0 auto; }
.container-narrow { max-width: 720px; margin: 0 auto; }
.container-wide { max-width: 1400px; margin: 0 auto; }

/* ─── App shell (authenticated pages with sidebar) ─── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  /* In-flow at desktop — scrolls with the page; inner .sidebar-nav has its
     own overflow:auto so the menu can scroll alone if items overflow.
     Mobile (max-width:900px) restores position:fixed for the drawer. */
  width: 232px;
  background: var(--sb-bg);
  color: var(--sb-ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sb-border);
  box-shadow: 1px 0 0 var(--sb-border);
}
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar-brand .roc-mark { color: var(--sb-ink); font-size: 20px; }
.sidebar-brand-sub { font-size: var(--t-xs); color: var(--sb-muted); margin-top: 4px; letter-spacing: 0; }

/* SVG logo treatment — used in admin sidebars, login left panel, and anywhere
   the brand wordmark renders as the official rocup-logo.svg / rocup-logo-on-dark.svg. */
.logo-brand { height: 28px; width: auto; display: block; }
.sidebar-nav { flex: 1; padding: 18px 12px; overflow-y: auto; }
.sidebar-section {
  display: flex; align-items: center; gap: 9px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-ink);
  padding: 22px 14px 8px;
}
.sidebar-section::before {
  content: '';
  width: 14px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-section:first-child { padding-top: 10px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: var(--t-md);
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  margin-bottom: 2px;
  transition: background .14s, color .14s, transform .1s;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sidebar-link.active svg { color: var(--accent-ink); }
.sidebar-link svg, .sidebar-link .nav-icon svg {
  width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; color: var(--muted);
}
.sidebar-link .nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; }
/* Worker-only profile card injected by role-guard.js at the top of the
   sidebar. Mirrors the reference mock — circular photo, name, email. */
.sidebar-worker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sb-border);
  text-align: center;
}
.sidebar-worker-photo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--sb-bg-2) center/cover no-repeat;
  border: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--sb-ink);
  overflow: hidden;
}
.sidebar-worker-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-worker-name { font-size: 16px; font-weight: 700; color: var(--sb-ink); letter-spacing: -.01em; margin-top: 4px; }
.sidebar-worker-email { font-size: 12px; color: var(--sb-muted); word-break: break-all; line-height: 1.3; }

.sidebar-bottom { padding: 16px; border-top: 1px solid var(--sb-border); }
.sidebar-email { font-size: var(--t-xs); color: var(--sb-muted); margin-bottom: 10px; word-break: break-all; line-height: 1.5; }
.sidebar-signout {
  display: block;
  width: 100%;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.sidebar-signout:hover { background: var(--surface-3); color: var(--ink); border-color: var(--border-2); }

/* ── Collapsible sidebar (desktop) ─────────────────────────────────────── */
/* Desktop: freeze the sidebar in view — it stays pinned while the page content
   scrolls. The inner .sidebar-nav (flex:1; overflow-y:auto) scrolls on its own
   if the menu is taller than the viewport. Mobile (≤900px) restores the fixed
   slide-in drawer below. */
.sidebar { position: sticky; top: 0; align-self: flex-start; height: 100vh; transition: width .16s var(--ease); }
/* Reserve room under the brand for the injected search bar (positioned there,
   absolutely) so the nav never shifts when the bar injects/resolves. Pure CSS
   on an always-present element = immune to any JS churn. */
.sidebar-brand { position: relative; padding-bottom: 52px; }
.sidebar-toggle {
  position: fixed; top: 50%; transform: translateY(-50%); left: 221px;
  width: 22px; height: 52px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted-2); cursor: pointer; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: left .16s var(--ease), color .12s, background .12s;
}
.sidebar-toggle svg { width: 16px; height: 16px; }
.sidebar-toggle:hover { color: var(--ink); background: var(--surface-2); }
html[data-sidebar="collapsed"] .sidebar-toggle { left: 55px; }
@media (min-width: 901px) {
  html[data-sidebar="collapsed"] .sidebar { width: 66px; }
  html[data-sidebar="collapsed"] .sidebar-search-wrap { display: none; }
  html[data-sidebar="collapsed"] .sidebar-brand { padding: 20px 0 16px; text-align: center; }
  html[data-sidebar="collapsed"] .sidebar-brand-sub { display: none; }
  html[data-sidebar="collapsed"] .logo-brand { height: 34px; width: 34px; border-radius: 9px; object-fit: contain; margin: 0 auto; }
  html[data-sidebar="collapsed"] .sidebar-nav { padding: 14px 10px; }
  html[data-sidebar="collapsed"] .sidebar-section { display: none; }
  html[data-sidebar="collapsed"] .sidebar-link { font-size: 0; gap: 0; justify-content: center; padding: 11px 0; }
  html[data-sidebar="collapsed"] .sidebar-worker-card { display: none; }
  html[data-sidebar="collapsed"] .sidebar-bottom { display: none; }
}
@media (max-width: 900px) { .sidebar-toggle { display: none; } }

.main { flex: 1; min-width: 0; }
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 32px 40px 28px;
}
.page-title { font-size: var(--t-3xl); font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.page-sub { font-size: var(--t-base); color: var(--muted); margin-top: 6px; max-width: 640px; }
/* Sub-tab strip used by the Detective Roc cluster — Detective Roc /
   Notes Review / Operations. The three pages live in the sidebar as a
   single "Detective Roc" entry; this strip switches between them. */
.detective-tabs {
  display: inline-flex; gap: 4px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 18px;
  box-shadow: 0 1px 2px rgba(20, 24, 31, .04);
  max-width: 100%;
  overflow-x: auto;
}
.detective-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.detective-tab:hover { color: var(--ink); background: var(--surface-2); }
.detective-tab.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.detective-tab svg { width: 15px; height: 15px; stroke-width: 2.2; }
.detective-tab.on svg { stroke-width: 2.4; }

/* Detective Roc — small live "scanning" orbit shown next to the tab strip on
   all three Detective Roc tabs. Continuously looping. */
.droc-orbit { position: relative; width: 38px; height: 38px; display: inline-block;
  vertical-align: middle; margin-left: 14px; flex: 0 0 auto; }
.droc-orbit .dob-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  border-radius: 50%; border: 1px dashed rgba(29,34,48,.12); }
.droc-orbit .r1 { width: 20px; height: 20px; }
.droc-orbit .r2 { width: 29px; height: 29px; }
.droc-orbit .r3 { width: 38px; height: 38px; }
.droc-orbit .dob-track { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; }
.droc-orbit .dob-track.t1 { animation: drocSpin 2.6s linear infinite; }
.droc-orbit .dob-track.t2 { animation: drocSpin 4.2s linear infinite reverse; }
.droc-orbit .dob-track.t3 { animation: drocSpin 6s linear infinite; }
.droc-orbit .dob-dot { display: block; width: 5px; height: 5px; border-radius: 50%; }
.droc-orbit .t1 .dob-dot { transform: translateY(-10px);   background: var(--success); box-shadow: 0 0 6px rgba(46,158,120,.6); }
.droc-orbit .t2 .dob-dot { transform: translateY(-14.5px); background: var(--warning); box-shadow: 0 0 6px rgba(185,132,32,.6); }
.droc-orbit .t3 .dob-dot { transform: translateY(-19px);   background: var(--danger);  box-shadow: 0 0 6px rgba(209,75,60,.6); }
.droc-orbit .dob-core { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent);
  filter: drop-shadow(0 0 4px rgba(111,92,214,.5)); animation: drocSpin 9s linear infinite, drocBreath 2200ms ease-in-out infinite; }
.droc-orbit .dob-core svg { width: 15px; height: 15px; }
@keyframes drocSpin { to { transform: rotate(360deg); } }
@keyframes drocBreath { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .droc-orbit .dob-track.t1, .droc-orbit .dob-track.t2, .droc-orbit .dob-track.t3, .droc-orbit .dob-core { animation: none; }
}
/* Detective Roc — the three status dots now orbit the tab strip's border
   (drocOrbit() in role-guard.js wraps the nav + positions these dots). The old
   small orbit icon is replaced by this. */
.droc-orbit { display: none; }
.droc-orbit-wrap { position: relative; display: inline-block; vertical-align: middle; overflow: visible; }
.droc-bdot {
  position: absolute; top: 0; left: 0; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: currentColor; pointer-events: none; z-index: 4;
  box-shadow: 0 0 6px 1px color-mix(in srgb, currentColor 55%, transparent);
  will-change: transform;
}
/* Eyebrow chip treatment inside the colored page header — a small pill that
   carries the section label more prominently than plain text. */
.page-header .eyebrow,
.page-header .eyebrow-accent {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  letter-spacing: .08em;
}
.page-content { padding: 32px 40px; }

/* ─── ROC Sign tab strip (Dashboard / Templates / Organisation docs) ─── */
.rocsign-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rocsign-tabs::-webkit-scrollbar { display: none; }
.rs-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.rs-tab:hover { color: var(--ink); }
.rs-tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ─── Tables ─── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-base);
}
.table th {
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tr:hover td { background: var(--surface-2); }

/* ─── Soft Modern shared patterns (avatar tiles, chips, pills, toolbars) ─── */
/* Per-person avatar tile — rounded square, deterministic tone */
.avatar-tile { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: var(--t-base); letter-spacing: -.02em; flex-shrink: 0; }
.avatar-tile.sm { width: 36px; height: 36px; border-radius: 11px; font-size: var(--t-md); }
.avatar-tile.lg { width: 56px; height: 56px; border-radius: 16px; font-size: var(--t-xl); }
.tone-lav { background:#6F5CD6; } .tone-mint { background:#2E9E78; } .tone-sky { background:#3B7CC9; }
.tone-peach { background:#D9744A; } .tone-rose { background:#C6588E; } .tone-amber { background:#B98420; }
/* Soft tinted icon chip */
.icon-chip { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-chip svg { width: 19px; height: 19px; }
.chip-lav { background:#EEEAFB; color:#6F5CD6; } .chip-mint { background:#E4F4EE; color:#2E9E78; }
.chip-sky { background:#E7F0FB; color:#3B7CC9; } .chip-peach { background:#FCEDE6; color:#D9744A; }
.chip-rose { background:#FBE9F1; color:#C6588E; } .chip-amber { background:#FBF1DF; color:#B98420; }
.chip-red { background:#FBE7E5; color:#D14B3C; } .chip-gray { background:var(--surface-2); color:var(--muted); }
/* Stat-chip row — small KPI cards */
.stat-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-chip { flex: 1; min-width: 150px; background: var(--surface); border: 0; border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-sm); animation: smRise .5s var(--ease) backwards; }
.stat-chip .v { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-chip .k { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
/* Status pills — pastel */
.spill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.spill svg { width: 12px; height: 12px; }
.spill.green { background:#E4F4EE; color:#2E9E78; } .spill.amber { background:#FBF1DF; color:#B98420; }
.spill.sky { background:#E7F0FB; color:#3B7CC9; } .spill.red { background:#FBE7E5; color:#D14B3C; }
.spill.gray { background:var(--surface-2); color:var(--muted); } .spill.lav { background:#EEEAFB; color:#6F5CD6; }
/* Search pill — input with inline icon */
.search-pill { display: inline-flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 11px; padding: 0 14px; height: 40px; transition: border-color .14s, box-shadow .14s; }
.search-pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-pill svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search-pill input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: var(--t-base); color: var(--ink); }
/* Segmented toggle */
.seg-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg-toggle button { font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 9px; transition: background .14s, color .14s; }
.seg-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
/* Toolbar row */
.sm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.sm-toolbar .grow { flex: 1; min-width: 200px; }
/* Card grid + list rows */
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sm-rows { display: flex; flex-direction: column; gap: 10px; }
.sm-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-xs); transition: border-color .16s, box-shadow .16s, transform .16s; animation: smRise .5s var(--ease) backwards; text-decoration: none; color: inherit; }
.sm-row:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
.sm-row .grow { flex: 1; min-width: 0; }
.sm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-xs); transition: border-color .16s, box-shadow .16s, transform .16s; animation: smRise .5s var(--ease) backwards; }
.sm-card.hover:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
@keyframes smRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ─── Utilities ─── */
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.mono { font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 0.92em; }
.text-xs { font-size: var(--t-xs); }
.text-sm { font-size: var(--t-sm); }
.text-md { font-size: var(--t-md); }
.text-lg { font-size: var(--t-lg); }
.text-xl { font-size: var(--t-xl); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.hidden { display: none !important; }

/* ─── Mobile hamburger (used by every page that has the app shell) ─── */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 110;
  width: 38px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-family: inherit;
  padding: 0;
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 18px; height: 18px; pointer-events: none; }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,10,10,.4);
  z-index: 99;
}
.sidebar-backdrop.show { display: block; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-header { padding: 24px 20px 20px 64px; }
  .page-content { padding: 24px 20px; }
  .section { padding: 64px 20px; }
  h1 { font-size: var(--t-4xl); }
  h2 { font-size: var(--t-2xl); }
  .menu-toggle { display: inline-flex; }
}

/* Phone-specific tightening (single column, touch targets, padding). */
@media (max-width: 640px) {
  .page-header { padding: 18px 16px 14px 60px; }
  .page-title  { font-size: var(--t-2xl); }
  .page-sub    { font-size: var(--t-sm); }
  .page-content { padding: 16px; }

  /* Touch-friendly button height. Keep .btn-sm small for inline action rows. */
  .btn      { height: 44px; padding: 0 18px; font-size: var(--t-md); }
  .btn-sm   { height: 32px; padding: 0 12px; font-size: var(--t-sm); }

  /* Form controls — larger touch targets, full width inside cards. */
  .input, select.input, textarea.input,
  input[type=text], input[type=number], input[type=date], input[type=time],
  input[type=email], input[type=password], input[type=search], select, textarea {
    font-size: 16px;             /* iOS won't auto-zoom on focus when ≥16px */
    min-height: 44px;
    padding: 10px 12px;
  }
  textarea, textarea.input { min-height: 88px; }

  /* Generic card grids stack to single column. */
  .field-grid, .form-grid, .info-grid, .today-grid, .snap-gp-grid,
  .stats-row, .ts-stats, .check-grid {
    grid-template-columns: 1fr !important;
  }

  /* Catch inline-styled 2-col grids in onboarding / forms / quick layouts. */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables: let them scroll horizontally rather than crushing. */
  .table-wrap, .ts-table-wrap, .grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modals that aren't custom-styled — pad less. */
  .modal-card, .co-box, .drawer-panel {
    border-radius: 12px;
  }

  /* Sidebar opens to ~88% of viewport so the user can see the page peeking. */
  .sidebar { width: 88vw; max-width: 320px; }
}

/* ─── Print ─── */
@media print {
  .sidebar, .page-header { display: none; }
  .main { margin: 0; }
  body { background: white; }
}

/* ─── Global loading spinner ───────────────────────────────────────────────
   Drop-in replacement for "Loading…" text. Centered, modern, accessible.
   Usage:  <div class="app-loader"></div>
   Variants:  .app-loader.sm  (smaller, less padding)
              .app-loader.inline  (tiny, inline-flex)
*/
.app-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  width: 100%;
  min-height: 120px;
}
.app-loader::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-loader-spin 0.75s linear infinite;
}
.app-loader.sm { padding: 16px; min-height: 0; }
.app-loader.sm::after { width: 18px; height: 18px; border-width: 2px; }
.app-loader.inline {
  display: inline-flex;
  padding: 0;
  width: auto;
  min-height: 0;
  vertical-align: middle;
}
.app-loader.inline::after { width: 14px; height: 14px; border-width: 2px; }
@keyframes app-loader-spin {
  to { transform: rotate(360deg); }
}

/* ── Marketing chrome (shared by index.html + features.html) ──────────────
   Announcement bar, sticky-shrink nav, pill CTA. Adapted layout patterns
   rendered in the Meridian palette. Behaviour lives in nav-enhance.js. */
.lp-announce {
  background: var(--sb-bg); color: var(--surface);
  font-size: var(--t-sm); line-height: 1.4;
  padding: 9px 44px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; z-index: 60;
}
.lp-announce a { color: var(--cta-light); font-weight: 700; text-decoration: none; white-space: nowrap; }
.lp-announce a:hover { text-decoration: underline; text-underline-offset: 2px; }
.lp-announce .lp-announce-x {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; background: transparent;
  color: rgba(255,253,248,.6); cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
}
.lp-announce .lp-announce-x:hover { color: var(--surface); background: rgba(255,255,255,.08); }
.lp-announce.lp-hide { display: none; }

/* Sticky-shrink behaviour layered onto the existing .lp-nav */
.lp-nav { transition: height .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease); }
.lp-nav.lp-nav-shrink {
  height: 48px;
  box-shadow: 0 1px 0 var(--border), 0 10px 30px rgba(14,31,51,.07);
}

/* Pill CTA button in the nav */
.lp-nav-cta {
  background: var(--cta); color: var(--sb-bg) !important;
  font-weight: 700; font-size: var(--t-sm);
  padding: 9px 18px; border-radius: 999px;
  transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.lp-nav-cta:hover {
  background: var(--cta-light); transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(184,133,61,.28);
}
